public Tuple <bool, string, long> Save() { try { long id = 0; using (Easycase.DataModel.EasyCaseDBEntities DB = new DataModel.EasyCaseDBEntities()) { var client = new DataModel.Contact { FirstName = this.FirstName, Email = this.Email, LastName = this.LastName, Notes = this.Notes, Prefix = this.Prefix, CreatedBy = this.CreatedBy, ContactTypeId = this.ContactTypeId, CreatedOn = DateTime.Now, Deleted = false, FaxNo = this.FaxNo, MailingAddress = this.MailingAddress, MobileNo = this.MobileNo, WorkNo = this.WorkNo, OtherNo = this.OtherNo }; DB.Contacts.Add(client); DB.SaveChanges(); id = client.ID; } return(new Tuple <bool, string, long>(true, Messages.SUCCESS, id)); } catch (Exception ex) { Logs.SaveLog(ex.Message); return(new Tuple <bool, string, long>(false, ex.Message, 0)); } }
public Tuple <bool, string> Update() { try { using (Easycase.DataModel.EasyCaseDBEntities DB = new DataModel.EasyCaseDBEntities()) { var contact = new DataModel.Contact { FirstName = this.FirstName, Email = this.Email, LastName = this.LastName, Notes = this.Notes, Prefix = this.Prefix, CreatedBy = this.CreatedBy, ContactTypeId = this.ContactTypeId, CreatedOn = DateTime.Now, Deleted = false, FaxNo = this.FaxNo, Status = this.Status, MailingAddress = this.MailingAddress, MobileNo = this.MobileNo, WorkNo = this.WorkNo, OtherNo = this.OtherNo, ID = this.ID, }; DB.Entry(contact).State = System.Data.Entity.EntityState.Modified; DB.SaveChanges(); } return(new Tuple <bool, string>(true, Messages.SUCCESS)); } catch (Exception ex) { Logs.SaveLog(ex.Message); return(new Tuple <bool, string>(false, ex.Message)); } }
public void RemovePayerFromList(DataModel.Contact payer) { PayerList.Remove(payer); }