This commit is contained in:
admin
2020-12-25 11:07:27 +08:00
parent 71a51e72a2
commit 56d6cc89e9
16 changed files with 354 additions and 31 deletions

View File

@@ -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;