修改
This commit is contained in:
@@ -71,7 +71,7 @@ namespace U8AppMain.Voucher
|
||||
var sqlPrefix = " Select Prefix1Rule From VoucherNumber Where CardNumber = '0413'";
|
||||
var prefix = conn.ExecuteScalar<string>(sqlPrefix, null, trans);
|
||||
//组装Code
|
||||
var cCode = prefix + cSeed.Substring(2,cSeed.Length-2) + maxCode.ToString().PadLeft(5, '0');
|
||||
var cCode = prefix + cSeed.Substring(2, cSeed.Length - 2) + maxCode.ToString().PadLeft(5, '0');
|
||||
//主表
|
||||
var sql = @"insert into MaterialAppVouch(id,ddate,ccode,crdcode,cdepcode,cpersoncode,cmaker,vt_id,iswfcontrolled,dnmaketime,cDefine12)
|
||||
values(@id,@ddate,@ccode,@crdcode,@cdepcode,@cpersoncode,@cmaker,@vt_id,@iswfcontrolled, getdate(),@cDefine12)";
|
||||
@@ -82,27 +82,27 @@ namespace U8AppMain.Voucher
|
||||
sql = @"INSERT INTO MaterialAppVouchs (autoid, id, cinvcode, inum, iquantity , cwhcode, iexpiratdatecalcu, irowno, iordertype, isotype , ipesotype)
|
||||
VALUES (@autoid, @id, @cinvcode, @inum, @iquantity , @cwhcode, @iexpiratdatecalcu, @irowno, @iordertype, @isotype , @ipesotype)";
|
||||
//明细
|
||||
var n = vouch.Vouchs.Count()-1;
|
||||
var n = vouch.Vouchs.Count() - 1;
|
||||
foreach (var item in vouch.Vouchs)
|
||||
{
|
||||
item.autoid = iChildId - n;
|
||||
item.id =iFatherId ;
|
||||
item.id = iFatherId;
|
||||
n--;
|
||||
item.IRowNO = n;
|
||||
}
|
||||
conn.Execute(sql, vouch.Vouchs, trans);
|
||||
trans.Commit();
|
||||
}
|
||||
catch (Exception err )
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
|
||||
trans.Rollback();
|
||||
throw err;
|
||||
return false;
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
|
||||
conn.Close();
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user