public int Save(BO.b02Status rec) { var p = new DL.Params4Dapper(); p.AddInt("pid", rec.b02ID); p.AddString("b02Name", rec.b02Name); p.AddString("b02Code", rec.b02Code); p.AddString("b02Entity", rec.b02Entity); p.AddInt("b02Ordinary", rec.b02Ordinary); p.AddString("b02Memo", rec.b02Memo); p.AddEnumInt("b02StartFlag", rec.b02StartFlag); p.AddEnumInt("b02MoveFlag", rec.b02MoveFlag); p.AddString("b02MoveBySql", rec.b02MoveBySql); p.AddString("b02Color", rec.b02Color); int intPID = _db.SaveRecord("b02Status", p.getDynamicDapperPars(), rec); if (rec.b02StartFlag == BO.b02StartFlagENUM.DefaultStatus) { _db.RunSql("UPDATE b02Status SET b02StartFlag=0 WHERE b02Entity LIKE @entity AND b02ID<>@pid", new { entity = rec.b02Entity, pid = intPID }); } return(intPID); }
public int Save(BO.p19Material rec) { if (rec.p20ID == 0) { _db.CurrentUser.AddMessage("Chybí vyplnit měrná jednotka."); return(0); } var p = new DL.Params4Dapper(); p.AddInt("pid", rec.p19ID); p.AddInt("p20ID", rec.p20ID, true); if (rec.j02ID_Owner == 0) { rec.j02ID_Owner = _db.CurrentUser.j02ID; } p.AddInt("j02ID_Owner", rec.j02ID_Owner, true); p.AddInt("p28ID", rec.p28ID, true); if (_db.CurrentUser.j03EnvironmentFlag == 2 && rec.p28ID != _db.CurrentUser.p28ID) { _db.CurrentUser.AddMessage("V klientském režimu se pořizuje materiál na míru klienta. Musíte záznam svázat s klientem s vazbou na váš profil."); return(0); } p.AddEnumInt("p19TypeFlag", rec.p19TypeFlag); p.AddInt("p10ID_Master", rec.p10ID_Master, true); p.AddString("p19Name", rec.p19Name); p.AddString("p19Code", rec.p19Code); p.AddString("p19Memo", rec.p19Memo); p.AddString("p19Supplier", rec.p19Supplier); p.AddString("p19Intrastat", rec.p19Intrastat); p.AddString("p19NameAlias", rec.p19NameAlias); p.AddString("p19ITSINC", rec.p19ITSINC); p.AddString("p19ITSCAS", rec.p19ITSCAS); p.AddString("p19ITSEINECS", rec.p19ITSEINECS); p.AddString("p19Lang1", rec.p19Lang1); p.AddString("p19Lang2", rec.p19Lang2); p.AddString("p19Lang3", rec.p19Lang3); p.AddString("p19Lang4", rec.p19Lang4); p.AddDouble("p19StockActual", rec.p19StockActual); p.AddDouble("p19StockReserve", rec.p19StockReserve); p.AddDateTime("p19StockDate", rec.p19StockDate); return(_db.SaveRecord("p19Material", p.getDynamicDapperPars(), rec)); }
public int Save(BO.p21License rec) { var p = new DL.Params4Dapper(); p.AddInt("pid", rec.p21ID); if (rec.pid == 0) { rec.b02ID = _mother.b02StatusBL.LoadStartStatusPID("p21", rec.b02ID); //startovací workflow stav } p.AddInt("b02ID", rec.b02ID, true); p.AddInt("p28ID", rec.p28ID, true); p.AddEnumInt("p21PermissionFlag", rec.p21PermissionFlag); p.AddString("p21Name", rec.p21Name); p.AddString("p21Code", rec.p21Code); p.AddString("p21Memo", rec.p21Memo); p.AddDouble("p21Price", rec.p21Price); p.AddDateTime("ValidFrom", rec.ValidFrom); p.AddDateTime("ValidUntil", rec.ValidUntil); int intPID = _db.SaveRecord("p21License", p.getDynamicDapperPars(), rec); return(intPID); }
public int Save(BO.x31Report rec) { if (ValidateBeforeSave(rec) == false) { return(0); } var p = new DL.Params4Dapper(); p.AddInt("pid", rec.x31ID); p.AddString("x31Entity", rec.x31Entity); p.AddString("x31FileName", rec.x31FileName); p.AddString("x31Name", rec.x31Name); p.AddString("x31Code", rec.x31Code); p.AddEnumInt("x31ReportFormat", rec.x31ReportFormat); p.AddString("x31Description", rec.x31Description); p.AddBool("x31Is4SingleRecord", rec.x31Is4SingleRecord); int intPID = _db.SaveRecord("x31Report", p.getDynamicDapperPars(), rec); return(intPID); }
public int Save(BO.p11ClientProduct rec) { if (rec.p12ID > 0) { rec.p21ID = _mother.p12ClientTpvBL.Load(rec.p12ID).p21ID; //licenci produktu zjistit z receptury } if (ValidateBeforeSave(rec) == false) { return(0); } var p = new DL.Params4Dapper(); p.AddInt("pid", rec.p11ID); p.AddInt("p12ID", rec.p12ID, true); p.AddInt("p10ID_Master", rec.p10ID_Master, true); p.AddInt("b02ID", rec.b02ID, true); p.AddInt("p20ID", rec.p20ID, true); p.AddInt("p20ID_Pro", rec.p20ID_Pro, true); p.AddInt("p21ID", rec.p21ID, true); p.AddString("p11Name", rec.p11Name); p.AddString("p11Code", rec.p11Code); p.AddString("p11Memo", rec.p11Memo); p.AddDouble("p11UnitPrice", rec.p11UnitPrice); p.AddDouble("p11RecalcUnit2Kg", rec.p11RecalcUnit2Kg); p.AddEnumInt("p11TypeFlag", rec.p11TypeFlag); p.AddString("p11PackagingCode", rec.p11PackagingCode); p.AddDouble("p11Davka", rec.p11Davka); p.AddDouble("p11DavkaMin", rec.p11DavkaMin); p.AddDouble("p11DavkaMax", rec.p11DavkaMax); p.AddDouble("p11SalesPerMonth", rec.p11SalesPerMonth); p.AddDouble("p11UnitsPerPalette", rec.p11UnitsPerPalette); int intPID = _db.SaveRecord("p11ClientProduct", p.getDynamicDapperPars(), rec); return(intPID); }
public int Save(BO.p10MasterProduct rec) { if (ValidateBeforeSave(rec) == false) { return(0); } var p = new DL.Params4Dapper(); p.AddInt("pid", rec.p10ID); p.AddInt("p13ID", rec.p13ID, true); if (rec.pid == 0) { rec.b02ID = _mother.b02StatusBL.LoadStartStatusPID("p10", rec.b02ID); //startovací workflow stav } p.AddInt("b02ID", rec.b02ID, true); p.AddInt("p20ID", rec.p20ID, true); p.AddInt("p20ID_Pro", rec.p20ID_Pro, true); p.AddString("p10Name", rec.p10Name); p.AddString("p10Code", rec.p10Code); p.AddString("p10Memo", rec.p10Memo); p.AddDouble("p10RecalcUnit2Kg", rec.p10RecalcUnit2Kg); p.AddEnumInt("p10TypeFlag", rec.p10TypeFlag); p.AddString("p10PackagingCode", rec.p10PackagingCode); p.AddDouble("p10Davka", rec.p10Davka); p.AddDouble("p10DavkaMin", rec.p10DavkaMin); p.AddDouble("p10DavkaMax", rec.p10DavkaMax); p.AddDouble("p10SalesPerMonth", rec.p10SalesPerMonth); p.AddDouble("p10UnitsPerPalette", rec.p10UnitsPerPalette); int intPID = _db.SaveRecord("p10MasterProduct", p.getDynamicDapperPars(), rec); var recP19 = _mother.p19MaterialBL.LoadByMasterP10ID(intPID); if (rec.p10TypeFlag == BO.ProductTypeEnum.Polotovar || rec.p10TypeFlag == BO.ProductTypeEnum.Vyrobek) //zkopírovat polotovar nebo výrobek do surovin p19 { if (recP19 == null) { recP19 = new BO.p19Material(); } recP19.p10ID_Master = intPID; recP19.p19Name = rec.p10Name; recP19.p19Code = rec.p10Code; recP19.p20ID = rec.p20ID; recP19.p19Memo = rec.p10Memo; if (rec.p10TypeFlag == BO.ProductTypeEnum.Polotovar) { recP19.p19TypeFlag = BO.p19TypeFlagEnum.Polotovar; } if (rec.p10TypeFlag == BO.ProductTypeEnum.Vyrobek) { recP19.p19TypeFlag = BO.p19TypeFlagEnum.Vyrobek; } _mother.p19MaterialBL.Save(recP19); } else { if (recP19 != null) { _mother.CBL.DeleteRecord("p19", recP19.pid); } } return(intPID); }