public ShipperToDb(Shipper shipper) : base(s_metadata) { SetSqlInt64(0, shipper.ID); SetSqlString(1, shipper.Code); SetSqlString(2, shipper.Name); SetSqlString(3, shipper.EnglishName); SetSqlBoolean(4, shipper.IsDangerous ?? SqlTypes.SqlBoolean.Null); SetSqlBoolean(5, shipper.IsCustoms ?? SqlTypes.SqlBoolean.Null); SetSqlString(6, shipper.Email); SetSqlString(7, shipper.LawPerson); SetSqlBoolean(8, shipper.IsSupplier ?? SqlTypes.SqlBoolean.Null); SetSqlBoolean(9, shipper.IsBalance ?? SqlTypes.SqlBoolean.Null); SetSqlString(10, shipper.PostCode); SetSqlString(11, shipper.Address1); SetSqlString(12, shipper.Address2); SetSqlString(13, shipper.Bank); SetSqlString(14, shipper.Account); SetSqlString(15, shipper.TaxID); SetSqlString(16, shipper.InvoiceTitle); SetSqlString(17, shipper.Contactor1); SetSqlString(18, shipper.Title1); SetSqlString(19, shipper.Phone1); SetSqlString(20, shipper.Fax1); SetSqlString(21, shipper.Contactor2); SetSqlString(22, shipper.Title2); SetSqlString(23, shipper.Phone2); SetSqlString(24, shipper.Fax2); SetSqlString(25, shipper.WebSite); SetSqlString(26, shipper.RegistAdd); SetSqlString(27, shipper.Comment); SetSqlString(28, shipper.Creater); SetSqlDateTime(29, shipper.CreateTime ?? SqlTypes.SqlDateTime.Null); SetSqlString(30, shipper.Updater); SetSqlDateTime(31, shipper.UpdateTime ?? SqlTypes.SqlDateTime.Null); SetSqlString(32, shipper.InsuranceCompany); SetSqlString(33, shipper.InsuranceType); SetSqlString(34, shipper.InsuranceOrderNo); SetSqlDecimal(35, shipper.InsuranceCost ?? SqlTypes.SqlDecimal.Null); SetSqlDateTime(36, shipper.InsuranceStartTime ?? SqlTypes.SqlDateTime.Null); SetSqlDateTime(37, shipper.InsuranceEndTime ?? SqlTypes.SqlDateTime.Null); SetSqlBoolean(38, shipper.State); SetSqlInt64(39, shipper.SegmentID ?? 0); SetSqlString(40, shipper.SegmentName); SetSqlString(41, shipper.Remark); SetSqlString(42, shipper.Str1); SetSqlString(43, shipper.Str2); SetSqlString(44, shipper.Str3); }
public Shipper(Runbow.TWS.Entity.Shipper shipper) { this.ID = shipper.ID; this.Code = shipper.Code; this.Name = shipper.Name; this.EnglishName = shipper.EnglishName; this.IsDangerous = shipper.IsDangerous ?? false; this.IsCustoms = shipper.IsCustoms ?? false; this.Email = shipper.Email; this.LawPerson = shipper.LawPerson; this.IsSupplier = shipper.IsSupplier ?? false; this.IsBalance = shipper.IsBalance ?? false; this.PostCode = shipper.PostCode; this.Address1 = shipper.Address1; this.Address2 = shipper.Address2; this.Bank = shipper.Bank; this.Account = shipper.Account; this.TaxID = shipper.TaxID; this.InvoiceTitle = shipper.InvoiceTitle; this.Contactor1 = shipper.Contactor1; this.Title1 = shipper.Title1; this.Phone1 = shipper.Phone1; this.Fax1 = shipper.Fax1; this.Contactor2 = shipper.Contactor2; this.Title2 = shipper.Title2; this.Phone2 = shipper.Phone2; this.Fax2 = shipper.Fax2; this.WebSite = shipper.WebSite; this.RegistAdd = shipper.RegistAdd; this.Comment = shipper.Comment; this.Creater = shipper.Creater; this.CreateTime = shipper.CreateTime; this.Updater = shipper.Updater; this.UpdateTime = shipper.UpdateTime; this.InsuranceCompany = shipper.InsuranceCompany; this.InsuranceType = shipper.InsuranceType; this.InsuranceOrderNo = shipper.InsuranceOrderNo; this.InsuranceCost = shipper.InsuranceCost; this.InsuranceStartTime = shipper.InsuranceStartTime; this.InsuranceEndTime = shipper.InsuranceEndTime; this.State = shipper.State; this.Remark = shipper.Remark; this.Str1 = shipper.Str1; this.Str2 = shipper.Str2; this.Str3 = shipper.Str3; }
public ActionResult Edit(ShipperVM model) { if (ModelState.IsValid) { ShipperEntity shipper = new ShipperEntity() { ID = model.ID, Code = model.Code, Name = model.Name, EnglishName = model.EnglishName, IsDangerous = model.IsDangerous, IsCustoms = model.IsCustoms, Email = model.Email, LawPerson = model.LawPerson, IsSupplier = model.IsSupplier, IsBalance = model.IsBalance, PostCode = model.PostCode, Address1 = model.Address1, Address2 = model.Address2, Bank = model.Bank, Account = model.Account, TaxID = model.TaxID, InvoiceTitle = model.InvoiceTitle, Contactor1 = model.Contactor1, Title1 = model.Title1, Phone1 = model.Phone1, Fax1 = model.Fax1, Contactor2 = model.Contactor2, Title2 = model.Title2, Phone2 = model.Phone2, Fax2 = model.Fax2, WebSite = model.WebSite, RegistAdd = model.RegistAdd, Comment = model.Comment, Creater = model.Creater, CreateTime = model.CreateTime, InsuranceCompany = model.InsuranceCompany, InsuranceType = model.InsuranceType, InsuranceOrderNo = model.InsuranceOrderNo, InsuranceCost = model.InsuranceCost, InsuranceStartTime = model.InsuranceStartTime, InsuranceEndTime = model.InsuranceEndTime, Remark = model.Remark, State = model.State, Updater = base.UserInfo.Name, UpdateTime = DateTime.Now, Str1 = model.PostedShipperIdentifyIDs != null && model.PostedShipperIdentifyIDs.Any() ? string.Join(",", model.PostedShipperIdentifyIDs) : string.Empty, Str2 = model.Str2, Str3 = model.Str3 }; Response <long> response = new ShipperService().AddOrUpdateShipper(new AddOrUpdateShipperRequest() { Shipper = shipper }); if (response.IsSuccess) { ApplicationConfigHelper.RefreshApplicationShippers(); } ViewBag.Message = response.SuccessMessage; } model.AvailableShipperIdentifies = ApplicationConfigHelper.GetApplicationConfigs(Constants.SHIPPERIDENTIFY); model.SelectedShipperIdentifies = model.AvailableShipperIdentifies.Where(t => model.PostedShipperIdentifyIDs.Contains(t.ID.ToString())); model.IsEdit = true; return(View("Create", model)); }