public bool DeleteStaff(int pMa) { try { profile_staff p = _Coffee.profile_staffs.Where(t => t.ID.Equals(pMa)).FirstOrDefault(); _Coffee.profile_staffs.DeleteOnSubmit(p); _Coffee.SubmitChanges(); return(true); } catch { return(false); } }
public bool EditStaff(int pMa, string pName, string pCa, int pStatus) { try { profile_staff p = _Coffee.profile_staffs.Where(t => t.ID.Equals(pMa)).FirstOrDefault(); p.NAME_STAFF = pName; p.STATUS = 1; p.SHIFT = pCa; p.STATUS = pStatus; _Coffee.SubmitChanges(); return(true); } catch { return(false); } }
public bool AddNewStaff(string pName, int pCa) { try { profile_staff p = new profile_staff(); p.ID = MaxID() + 1; p.NAME_STAFF = pName; p.STATUS = 1; p.ID_TIMEKEEPING = pCa; _Coffee.profile_staffs.InsertOnSubmit(p); _Coffee.SubmitChanges(); return(true); } catch { return(false); } }