public int Update(Admin admin) { Admin adminToUpdate = context.Admins.SingleOrDefault(d => d.Admin_Id == admin.Admin_Id); adminToUpdate.Admin_Name = admin.Admin_Name; adminToUpdate.Admin_address = admin.Admin_address; adminToUpdate.Admin_mobile = admin.Admin_mobile; adminToUpdate.Admin_password = admin.Admin_password; LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(admin.Admin_Name); li.Login_Password = admin.Admin_password; lrepo.Update(li); return(context.SaveChanges()); }
public int Update(User User) { User userToUpdate = context.Users.SingleOrDefault(d => d.User_acc_no == User.User_acc_no); userToUpdate.User_address = User.User_address; userToUpdate.User_balance = User.User_balance; userToUpdate.User_mobile = User.User_mobile; userToUpdate.Deadline = User.Deadline; userToUpdate.User_password = User.User_password; LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(User.User_Name); li.Login_Password = User.User_password; lrepo.Update(li); return(context.SaveChanges()); }
public int Update(MDirector MDirector) { MDirector MDirectorToUpdate = context.MDirectors.SingleOrDefault(d => d.MD_Id == MDirector.MD_Id); MDirectorToUpdate.MD_name = MDirector.MD_name; MDirectorToUpdate.MD_password = MDirector.MD_password; MDirectorToUpdate.MD_address = MDirector.MD_address; MDirectorToUpdate.MD_mobile = MDirector.MD_mobile; MDirectorToUpdate.MD_Salary = MDirector.MD_Salary; MDirectorToUpdate.MD_mobile = MDirector.MD_mobile; LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(MDirector.MD_name); li.Login_Password = MDirector.MD_password; lrepo.Update(li); return(context.SaveChanges()); }
public int Update(BranchManager branchMangaer) { BranchManager branchMangaerToUpdate = context.BranchManagers.SingleOrDefault(d => d.Manager_Id == branchMangaer.Manager_Id); branchMangaerToUpdate.Manager_Name = branchMangaer.Manager_Name; branchMangaerToUpdate.Manager_address = branchMangaer.Manager_address; branchMangaerToUpdate.Manager_Balance = branchMangaer.Manager_Balance; branchMangaerToUpdate.Manager_branch = branchMangaer.Manager_branch; branchMangaerToUpdate.Manager_LastPaymentDate = branchMangaer.Manager_LastPaymentDate; branchMangaerToUpdate.Manager_mobile = branchMangaer.Manager_mobile; branchMangaerToUpdate.Manager_password = branchMangaer.Manager_password; branchMangaerToUpdate.Manager_Salary = branchMangaer.Manager_Salary; branchMangaerToUpdate.Manager_TotalPayment = branchMangaer.Manager_TotalPayment; LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(branchMangaer.Manager_Name); li.Login_Password = branchMangaer.Manager_password; lrepo.Update(li); return(context.SaveChanges()); }
public int Update(Cashier cashier) { Cashier cashierToUpdate = context.Cashiers.SingleOrDefault(d => d.Cashier_Id == cashier.Cashier_Id); cashierToUpdate.Cashier_Name = cashier.Cashier_Name; cashierToUpdate.Cashier_address = cashier.Cashier_address; cashierToUpdate.Cashier_branch = cashier.Cashier_branch; cashierToUpdate.Cashier_LastPaymentDate = cashier.Cashier_LastPaymentDate; cashierToUpdate.Cashier_mobile = cashier.Cashier_mobile; cashierToUpdate.Cashier_password = cashier.Cashier_password; cashierToUpdate.Cashier_Salary = cashier.Cashier_Salary; cashierToUpdate.Cashier_Balance = cashier.Cashier_Balance; cashierToUpdate.Cashier_TotalPayment = cashier.Cashier_TotalPayment; LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(cashier.Cashier_Name); li.Login_Password = cashier.Cashier_password; lrepo.Update(li); return(context.SaveChanges()); }
public int Update(Officer officer) { Officer officerToUpdate = context.Officers.SingleOrDefault(d => d.Officer_Id == officer.Officer_Id); officerToUpdate.Officer_Name = officer.Officer_Name; officerToUpdate.Officer_address = officer.Officer_address; officerToUpdate.Officer_Balance = officer.Officer_Balance; officerToUpdate.Officer_branch = officer.Officer_branch; officerToUpdate.Officer_LastPaymentDate = officer.Officer_LastPaymentDate; officerToUpdate.Officer_password = officer.Officer_password; officerToUpdate.Officer_Salary = officer.Officer_Salary; officerToUpdate.Officer_TotalPayment = officer.Officer_TotalPayment; officerToUpdate.Officer_mobile = officer.Officer_mobile; LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(officer.Officer_Name); li.Login_Password = officer.Officer_password; lrepo.Update(li); return(context.SaveChanges()); }