public bool EditDetails(int sid, SellerDetailsModel model) { using (ShoppingELFEntities context = new ShoppingELFEntities()) { SellerDetailsTable sdt = new SellerDetailsTable(); sdt = context.SellerDetailsTable.FirstOrDefault(x => x.SellerID == sid); if (sdt != null) { sdt.AddressLine1 = model.AddressLine1; sdt.AddressLine2 = model.AddressLine2; sdt.pincode = model.pincode; sdt.state = model.state; sdt.city = model.city; sdt.AccountHolderName = model.AccountHolderName; sdt.accountNumber = model.accountNumber; sdt.accountType = model.accountType; sdt.ShippingFee = model.ShippingFee; sdt.GSTNumber = model.GSTNumber; sdt.PANCardNumber = model.PANCardNumber; context.SaveChanges(); return(true); } else { return(false); } } }
public bool EnterDetails(int sid, SellerDetailsModel model) { using (ShoppingELFEntities context = new ShoppingELFEntities()) { SellerDetailsTable sdt = new SellerDetailsTable() { AddressLine1 = model.AddressLine1, AddressLine2 = model.AddressLine2, pincode = model.pincode, state = model.state, city = model.city, AccountHolderName = model.AccountHolderName, accountNumber = model.accountNumber, accountType = model.accountType, IFSCCode = model.IFSCCode, ShippingFee = model.ShippingFee, GSTNumber = model.GSTNumber, PANCardNumber = model.PANCardNumber, SellerID = sid }; context.SellerDetailsTable.Add(sdt); context.SaveChanges(); return(true); } }