public void EditAdmin(Admin admin) { using (MSMSDBEntities db = new MSMSDBEntities()) { db.Entry(admin).State = EntityState.Modified; db.SaveChanges(); } }
//2.11)This method is used to edit owner in database public int EditOwner(Owner_Registration adm) { int i = 0; using (MSMSDBEntities db = new MSMSDBEntities()) { db.Entry(adm).State = EntityState.Modified; i += db.SaveChanges(); } return(i); }
//2.9)This method is used to change Owner password in database public int OwnerChangePassword(string ownerID, string pwd) { int i = 0; using (MSMSDBEntities db = new MSMSDBEntities()) { var owner = db.Owner_Registration.Find(ownerID); owner.Password = pwd; db.Owner_Registration.Attach(owner); db.Entry(owner).Property(a => a.Password).IsModified = true; i += db.SaveChanges(); } return(i); }
public int ChangePassword(string AdminID, string Pwd) { int i = 0; using (MSMSDBEntities db = new MSMSDBEntities()) { var admin = db.Admins.Find(AdminID); admin.Password = Pwd; db.Admins.Attach(admin); db.Entry(admin).Property(a => a.Password).IsModified = true; i += db.SaveChanges(); } return(i); }