public JsonResult GetCallLogById(string id = "MA==") { int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); AbstractCallLog model = new CallLog(); if (Id > 0) { model = abstractCallLogServices.CallLogSelectById(Id).Item; } return(Json(model, JsonRequestBehavior.AllowGet)); }
public ActionResult Manage(string id = "MA==") { if (TempData["openPopup"] != null) { ViewBag.openPopup = TempData["openPopup"]; } int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); ViewBag.Company = BindCompanyDropdown(); if (Id > 0) { var model = abstractCompanyContactsServices.CompanyContactsSelectById(Id).Item; return(View(model)); } return(View()); }
public ActionResult Manage(string id = "MA==") { if (TempData["openPopup"] != null) { ViewBag.openPopup = TempData["openPopup"]; } int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); ViewBag.Project = BindProjectDropdown(); ViewBag.Users = BindUserDropdown(); if (Id > 0) { var model = abstractProjectsTimeTrackingServices.ProjectTimeTrackingSelectById(Id).Item; return(View(model)); } return(View()); }
public ActionResult Manage(string id = "MA==") { if (TempData["openPopup"] != null) { ViewBag.openPopup = TempData["openPopup"]; } int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); ViewBag.User = BindUserDropdown(); ViewBag.Opportunities = BindOpportunitiesDropdown(); ViewBag.Status = BindStatusDropdown(); if (Id > 0) { var model = abstractOpportunities_TasksServices.Opportunities_TasksSelectById(Id).Item; return(View(model)); } return(View()); }
public ActionResult SendEmail(string id = "MA==") { if (TempData["openPopup"] != null) { ViewBag.openPopup = TempData["openPopup"]; } int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); if (Id > 0) { var model = abstractOpportunitiesServices.OpportunitiesSelectById(Id).Item; string Email = ProjectSession.Email; if (Email != "" && model != null) { string Emailtext = "<p style='margin-left: 70px;'>You can see #TASK# Details Below.</p><h5 style='margin-left: 70px;'> Opportunity Name :- <span style='font-weight:bold'>#OPNAME#</span></h5><h5 style='margin-left: 70px;'> Assigned User Name :- <span style='font-weight:bold'>#ASSIGNUSRNAME#</span></h5><h5 style='margin-left: 70px;'> Company Contact Name :- <span style='font-weight:bold'>#COMCONTNAME#</span></h5><h5 style='margin-left: 70px;'> Description :- <span style='font-weight:bold'>#Description#</span></h5><h5 style='margin-left: 70px;'> Status :- <span style='font-weight:bold'>#Status#</span></h5><h5 style='margin-left: 70px;'> Start Date :- <span style='font-weight:bold'>#StartDate#</span></h5><h5 style='margin-left: 70px;'> End Date :- <span style='font-weight:bold'>#EndDate#</span></h5><h5 style='margin-left: 70px;'> Success Rate Percent :- <span style='font-weight:bold'>#SuccessRatePercent#</span></h5>"; string body = string.Empty; using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailTemplate/index.html"))) { body = reader.ReadToEnd(); } Emailtext = Emailtext.Replace("#TASK#", "Opportunity"); Emailtext = Emailtext.Replace("#OPNAME#", model.Name); Emailtext = Emailtext.Replace("#ASSIGNUSRNAME#", model.AssignedUserName); Emailtext = Emailtext.Replace("#COMCONTNAME#", model.CompanyContactName); Emailtext = Emailtext.Replace("#Description#", model.Description); Emailtext = Emailtext.Replace("#Status#", model.StatusName); Emailtext = Emailtext.Replace("#StartDate#", model.StartDate); Emailtext = Emailtext.Replace("#EndDate#", model.EndDate); Emailtext = Emailtext.Replace("#SuccessRatePercent#", Convert.ToString(model.SuccessRatePercent)); body = body.Replace("#TASK#", "Opportunity"); body = body.Replace("#USERNAME#", ProjectSession.UserName); body = body.Replace("#MAINMESSAGE#", Emailtext); //EmailHelper.Send(Email, "", "", "CRM Opportunity: " + model.Name, body); System.Net.Mail.Attachment Attachment1 = EmailHelper.AddAttachment("CRM Opportunity: " + model.Name, Emailtext, model.StartDate, model.EndDate); EmailHelper.Send1(Email, "", "", "CRM Opportunity: " + model.Name, body, Attachment1); } } return(RedirectToAction(Actions.Index, Pages.Controllers.Opportunities)); }
public ActionResult SendEmail(string id = "MA==") { if (TempData["openPopup"] != null) { ViewBag.openPopup = TempData["openPopup"]; } int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); if (Id > 0) { var model = abstractProjectsTimeTrackingServices.ProjectTimeTrackingSelectById(Id).Item; string Email = ProjectSession.Email; if (Email != "" && model != null) { string Emailtext = "<p style='margin-left: 70px;'>You can see #TASK# Details Below.</p><h5 style='margin-left: 70px;'> Project Name :- <span style='font-weight:bold'>#PRONAME#</span></h5><h5 style='margin-left: 70px;'> UserName :- <span style='font-weight:bold'>#UserName#</span></h5><h5 style='margin-left: 70px;'> Work Description :- <span style='font-weight:bold'>#WorkDescription#</span></h5><h5 style='margin-left: 70px;'> Work Done :- <span style='font-weight:bold'>#WorkDone#</span></h5><h5 style='margin-left: 70px;'> Start Date :- <span style='font-weight:bold'>#StartDate#</span></h5><h5 style='margin-left: 70px;'> End Date :- <span style='font-weight:bold'>#EndDate#</span></h5><h5 style='margin-left: 70px;'> Total Hrs :- <span style='font-weight:bold'>#TotalHrs#</span></h5>"; string body = string.Empty; using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailTemplate/index.html"))) { body = reader.ReadToEnd(); } Emailtext = Emailtext.Replace("#TASK#", "Project Time Tracking"); Emailtext = Emailtext.Replace("#PRONAME#", model.ProjectName); Emailtext = Emailtext.Replace("#UserName#", model.UserName); Emailtext = Emailtext.Replace("#WorkDescription#", model.WorkDescription); Emailtext = Emailtext.Replace("#WorkDone#", model.WorkDone); Emailtext = Emailtext.Replace("#StartDate#", model.StartDate); Emailtext = Emailtext.Replace("#EndDate#", model.EndDate); Emailtext = Emailtext.Replace("#TotalHrs#", model.TotalHrs.ToString()); body = body.Replace("#TASK#", "Project Time Tracking"); body = body.Replace("#USERNAME#", ProjectSession.UserName); body = body.Replace("#MAINMESSAGE#", Emailtext); EmailHelper.Send(Email, "", "", "Project Time Tracking Details", body); } } return(RedirectToAction(Actions.Index, Pages.Controllers.ProjectsTimeTracking)); }
public ActionResult SendEmail(string id = "MA==") { if (TempData["openPopup"] != null) { ViewBag.openPopup = TempData["openPopup"]; } int Id = Convert.ToInt32(ConvertTo.Base64Decode(id)); if (Id > 0) { var model = abstractCompanyServices.CompanySelectById(Id).Item; string Email = ProjectSession.Email; if (Email != "" && model != null) { string Emailtext = "<p style='margin-left: 70px;'>You can see #TASK# Details Below.</p><h5 style='margin-left: 70px;'> Company Name :- <span style='font-weight:bold'>#COMNAME#</span></h5><h5 style='margin-left: 70px;'> Address1 :- <span style='font-weight:bold'>#Address1#</span></h5><h5 style='margin-left: 70px;'> Address2 :- <span style='font-weight:bold'>#Address2#</span></h5><h5 style='margin-left: 70px;'> Address3 :- <span style='font-weight:bold'>#Address3#</span></h5><h5 style='margin-left: 70px;'> Phone :- <span style='font-weight:bold'>#Phone#</span></h5><h5 style='margin-left: 70px;'> Fax :- <span style='font-weight:bold'>#Fax#</span></h5>"; string body = string.Empty; using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailTemplate/index.html"))) { body = reader.ReadToEnd(); } Emailtext = Emailtext.Replace("#TASK#", "Company"); Emailtext = Emailtext.Replace("#COMNAME#", model.Name); Emailtext = Emailtext.Replace("#Address1#", model.Address1); Emailtext = Emailtext.Replace("#Address2#", model.Address2); Emailtext = Emailtext.Replace("#Address3#", model.Address3); Emailtext = Emailtext.Replace("#Phone#", model.Phone); Emailtext = Emailtext.Replace("#Fax#", model.Fax); body = body.Replace("#TASK#", "Company"); body = body.Replace("#USERNAME#", ProjectSession.UserName); body = body.Replace("#MAINMESSAGE#", Emailtext); EmailHelper.Send(Email, "", "", "Company Details", body); } } return(RedirectToAction(Actions.Index, Pages.Controllers.Company)); }
public JsonResult BindCallLog([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string TaskId = "MA==", string StartDate = "", string EndDate = "", int DateType = 0) { try { int totalRecord = 0; int filteredRecord = 0; ProjectSession.CallLogDateType = DateType; ProjectSession.CallLogStartDate = StartDate; ProjectSession.CallLogEndDate = EndDate; PageParam pageParam = new PageParam(); pageParam.Offset = requestModel.Start; pageParam.Limit = requestModel.Length; string Search = requestModel.Search.Value; if (requestModel.Draw == 1) { pageParam.SortBy = requestModel.Columns.ElementAt(5).Data; pageParam.SortDirection = "Descending"; } else { pageParam.SortBy = requestModel.Columns.ElementAt(requestModel.OrderColumn).Data; pageParam.SortDirection = requestModel.OrderDir.ToUpper() == "DESC" ? "Descending" : "Ascending"; } var model = abstractCallLogServices.CallLogSelectAll(pageParam, Search, Convert.ToInt32(ConvertTo.Base64Decode(TaskId)), StartDate, EndDate, DateType); totalRecord = (int)model.TotalRecords; filteredRecord = (int)model.TotalRecords; return(Json(new DataTablesResponse(requestModel.Draw, model.Values, filteredRecord, totalRecord), JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new object[] { Enums.MessageType.danger.GetHashCode(), Enums.MessageType.danger.ToString(), "Something Went Wrong" }, JsonRequestBehavior.AllowGet)); } }