public bool DeleteCus(int pID) { try { profile sp = _Coffee.profiles.Where(t => t.ID.Equals(pID)).FirstOrDefault(); _Coffee.profiles.DeleteOnSubmit(sp); _Coffee.SubmitChanges(); return(true); } catch { return(false); } }
public bool EditCus(int pId, string pLName, string pFName, string pPhone, string pAddress, string pEmail, int pType_Name, int pStatus) { try { profile sp = _Coffee.profiles.Where(t => t.ID.Equals(pId)).FirstOrDefault(); sp.LAST_NAME = pLName; sp.FIRST_NAME = pFName; sp.PHONE = pPhone; sp.EMAIL = pEmail; sp.ADDRESS = pAddress; sp.STATUS = pStatus; sp.ID_TYPE_CUSTOMER = pType_Name; _Coffee.SubmitChanges(); return(true); } catch { return(false); } }
public bool AddNewProfile(string pLName, string pFName, string pPhone, string pAddress, string pEmail, int pType_Name) { try { profile p = new profile(); p.ID = MaxID() + 1; p.LAST_NAME = pLName; p.FIRST_NAME = pFName; p.PHONE = pPhone; p.ADDRESS = pAddress; p.EMAIL = pEmail; p.ID_TYPE_CUSTOMER = pType_Name; p.STATUS = 1; _Coffee.profiles.InsertOnSubmit(p); _Coffee.SubmitChanges(); return(true); } catch { return(false); } }