public static bool SaveAccountInfo(CustomerAccountVM customer) { bool flag = false; tbl_Customer_Accounts cust = new tbl_Customer_Accounts(); try { using (var db = new SoneriCISEntities()) { cust.AccountNo = customer.AccountNo; cust.CIF = customer.CIF; cust.CardNo = customer.CardNo; cust.AccountStatusActive = customer.AccountStatusActive; cust.AccountTitle = customer.AccountTitle; cust.Address = customer.Address; cust.Mobile = customer.Mobile; cust.CNIC = customer.CNIC; db.tbl_Customer_Accounts.Add(cust); db.SaveChanges(); flag = true; } } catch (Exception ex) { throw ex; } return(flag); }
public bool UpdateCustomerAccount(tbl_Customer_Accounts row) { try { using (var db = new SoneriCISEntities()) { tbl_Customer_Accounts val = new DAL.tbl_Customer_Accounts(); val = db.tbl_Customer_Accounts.Where(a => a.ID == row.ID).FirstOrDefault(); val.ID = row.ID; val.AccountNo = row.AccountNo; val.CIF = row.CIF; val.CardNo = row.CardNo; val.AccountStatusActive = row.AccountStatusActive; val.Salutation = row.Salutation; val.AccountTitle = row.AccountTitle; val.Address = row.Address; val.Mobile = row.Mobile; val.DateofBirth = row.DateofBirth; val.MotherMaidenName = row.MotherMaidenName; val.Identification = row.Identification; val.CNIC = row.CNIC; val.AddressType = row.AddressType; val.AccountTypeID = row.AccountTypeID; val.WaiveCharges = row.WaiveCharges; val.PassportNo = row.PassportNo; val.LandlineNo = row.LandlineNo; val.Email = row.Email; val.Nationality = row.Nationality; val.AccountCategoryCode = row.AccountCategoryCode; val.PhoneOffice = row.PhoneOffice; val.Company = row.Company; val.IdentificationType = row.IdentificationType; val.Mobile2 = row.Mobile2; val.Address2 = row.Address2; val.Address3 = row.Address3; val.MainMobile = row.MainMobile; val.MainLandline = row.MainLandline; val.MainAddress = row.MainAddress; val.CustomerName = row.CustomerName; val.FatherName = row.FatherName; val.ResidenceStatus = row.ResidenceStatus; val.Currency = row.Currency; db.SaveChanges(); } return(true); } catch (Exception ex) { return(false); } }
public bool AddCustomerAccount(tbl_Customer_Accounts row) { try { using (var db = new SoneriCISEntities()) { db.tbl_Customer_Accounts.Add(row); db.SaveChanges(); } return(true); } catch (Exception ex) { return(false); } }