public static bool DeleteVisit(int visit_Id) { try { DbEntry.UsingTransaction(delegate { Visit st = Visit.FindById(visit_Id); st.IsDelete = true; st.Save(); }); } catch { return(false); } return(true); }
public static bool UpdateVisit(int visit_Id, string name, string relationship, DateTime arriveTime, DateTime leaveTime, string address, string phone) { try { DbEntry.UsingTransaction(delegate { Visit st = Visit.FindById(visit_Id); st.Name = name; st.Relationship = relationship; st.ArriveTime = arriveTime; st.LeaveTime = leaveTime; st.Address = address; st.Phone = phone; st.Save(); }); } catch { return(false); } return(true); }