public void DeletePhoneCallLogs(int PhoneCallLogId) { Core_PhoneCallLogs result = ent.Core_PhoneCallLogs.Where(x => x.PhoneCallLogId == PhoneCallLogId).FirstOrDefault(); ent.DeleteObject(result); ent.SaveChanges(); }
public void EditPhoneCallLogs(AgentCallLogModel model) { Core_PhoneCallLogs result = ent.Core_PhoneCallLogs.Where(x => x.PhoneCallLogId == model.PhoneCallLogId).FirstOrDefault(); result.PhoneCallLogId = model.PhoneCallLogId; result.AgentId = (int)model.AgentId; result.Propose = model.Purpose; result.isNeedFollowup = model.Followupthisagent; result.CallDuration = (double)model.CallDuration; result.Notes = model.Note; result.ProductId = model.For_ProductId; result.ServiceProviderId = model.On_ServiceProviderId; result.LoggedBy = model.LoggedBy; result.LoggedDate = DateTime.Now; result.Category = model.CategortId; result.SubCategory = model.SubCategortId; if (model.rdbCallType == CallType.Incoming) { result.CallType = "In-Coming"; } else { result.CallType = "Out-Going"; } ent.ApplyCurrentValues(result.EntityKey.EntitySetName, result); ent.SaveChanges(); }
public void CreatePhoneCallLogs(AgentCallLogModel model) { Core_PhoneCallLogs obj = new Core_PhoneCallLogs(); obj.AgentId = (int)model.hdfAgentId; obj.Propose = model.Purpose; obj.isNeedFollowup = model.Followupthisagent; obj.CallDuration = (double)model.CallDuration; obj.Notes = model.Note; obj.ProductId = model.For_ProductId; obj.ServiceProviderId = model.On_ServiceProviderId; obj.LoggedBy = model.LoggedBy; obj.LoggedDate = DateTime.Now; obj.Category = model.CategortId; obj.SubCategory = model.SubCategortId; if (model.rdbCallType == CallType.Incoming) { obj.CallType = "In-Coming"; } else { obj.CallType = "Out-Going"; } ent.AddToCore_PhoneCallLogs(obj); ent.SaveChanges(); }
public AgentCallLogModel DetailPhoneCallLogs(int PhoneCallLogId) { Core_PhoneCallLogs result = ent.Core_PhoneCallLogs.Where(x => x.PhoneCallLogId == PhoneCallLogId).FirstOrDefault(); AgentCallLogModel model = new AgentCallLogModel(); model.AgentId = result.AgentId; model.AgentName = result.Agents.AgentName; model.Purpose = result.Propose; model.Followupthisagent = result.isNeedFollowup; model.CallDuration = result.CallDuration; model.Note = result.Notes; model.For_ProductId = result.ProductId; model.For_ProductName = result.Core_Products.ProductName; if (model.On_ServiceProviderId == null) { model.On_ServiceProviderName = ""; } else { model.On_ServiceProviderName = result.ServiceProviders.ServiceProviderName; } if (result.CallType == "In-Coming") { model.rdbCallType = CallType.Incoming; } else { model.rdbCallType = CallType.Outgoing; } model.LoggedBy = result.LoggedBy; model.LoggedByName = result.UsersDetails.FullName; model.CategortId = result.Category; model.SubCategortId = result.SubCategory; return(model); }