public DataReturn SaveCustomermessegingData(RCSMessegeClass obj) { DataReturn model = new DataReturn(); try { CustomerContactMesseging cust = new CustomerContactMesseging(); cust.PKey = Guid.NewGuid(); cust.JobKey = obj.mainObj.JobKey; cust.AddedBy = GlobalClass.LoginUser.ContactKey; cust.AddedOn = obj.mainObj.AddedOn; cust.Comment = obj.mainObj.Comment; cust.Title = "Update for Job: " + obj.Job.JobName; cust.IsDelete = false; cust.Remarks = ""; cust.CustomerKey = obj.VendorKey; cust.IsMessegeNew = true; db.CustomerContactMesseging.Add(cust); db.SaveChanges(); model.flag = 1; model.mess = "Data has been saved successfully."; model.key = cust.PKey; } catch (Exception ex) { model.flag = 0; model.mess = ex.Message.ToString(); } return(model); }
public DataReturn UpdateCustomermessegingData(RCSMessegeClass obj) { DataReturn model = new DataReturn(); try { CustomerContactMesseging cust = db.CustomerContactMesseging.Find(obj.mainObj.PKey); cust.AddedOn = obj.mainObj.AddedOn; cust.Comment = obj.mainObj.Comment; cust.IsMessegeNew = true; cust.Remarks = "Updated on " + System.DateTime.Now.ToString() + " by " + GlobalClass.LoginUser.Cname; db.SaveChanges(); model.flag = 1; model.mess = "Data has been saved successfully."; model.key = cust.PKey; } catch (Exception ex) { model.flag = 0; model.mess = ex.Message.ToString(); } return(model); }
public CustomerNoteClass FillCustomer_sNotes(Guid id) { CustomerNoteClass obj = new CustomerNoteClass(); CustomerContactMesseging cust = db.CustomerContactMesseging.Find(id); obj.NoteKey = cust.PKey; obj.Comment = cust.Comment; obj.AddedBy = cust.AddedBy; obj.AddedOn = cust.AddedOn; obj.Title = cust.AddedOn.ToString(); obj.IsDelete = cust.IsDelete; return(obj); }