public bool DeleteUserDetails(phong useInfo) { phongban dt = db.phongbans.Single(s => s.ma.Equals(useInfo.Ma)); db.phongbans.Remove(dt); db.SaveChanges(); return(true); }
public void Updatephongban(phong useInfo) { phongban dt = db.phongbans.Single(s => s.ma.Equals(useInfo.Ma));; // dt.ma = useInfo.Ma; dt.ten = useInfo.Ten; dt.sdt = useInfo.SDT; dt.email = useInfo.Email; // db.phongbans.Add(dt); db.SaveChanges(); }
public string InsertUserDetails(phong useInfo) { string Message; try { phongban dt = new phongban(); dt.ma = useInfo.Ma; dt.ten = useInfo.Ten; dt.sdt = useInfo.SDT; dt.email = useInfo.Email; db.phongbans.Add(dt); db.SaveChanges(); Message = useInfo.Ten + "Success"; } catch { Message = useInfo.Ten + "Thêm Thất bại!!"; } return(Message); }