public ActionResult ChangeStatus(string status, int cid, string message) { try { dashrdku_database db = new dashrdku_database(); FollowUpMaster model = new FollowUpMaster(); UserInfoModel user = Session["userInfo"] as UserInfoModel; model.RefCandidateId = cid; model.FollowUpBy = user.UserRocketName; model.FollowUpDate = DateTime.Now.Date; model.FollowUpTime = DateTime.Now.TimeOfDay; model.FollowUpMessage = message; model.FollowUpStatus = status; db.FollowUpMasters.Add(model); db.SaveChanges(); TempData["alert"] = new AlertBoxModel() { Type = "Success", Message = "Follow Up Message Saved!" }; } catch (Exception ex) { TempData["alert"] = new AlertBoxModel() { Type = "Error", Message = ex.Message }; } return(RedirectToAction("GetTimeLine2")); }
public ActionResult ChangeStatus(int id, string status) { var data = db.CandidateMasters.Find(id); data.CandidateStatus = status; db.SaveChanges(); string toEmail = data.UserAccountDetail.EmailId + ",[email protected]"; string ccEmail = data.UserAccountDetail.RefLocationId == 1 ? "[email protected],[email protected],prabhuk @dashtechinc.com,[email protected],[email protected],[email protected]" : "[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]"; string body = string.Format(@"Hi Team, <br>Current Candidate Status is,<br><br> <table border='1'> <tr> <td>CandidateName</td><td>{0}</td> </tr> <tr> <td>Registration Date</td><td>{1}</td> </tr> <tr> <td>Total Paid</td><td>$ {2}</td> </tr> <tr> <td>Total Days</td><td>{3}</td> </tr> <tr> <td>Status</td><td>{4}</td> </tr> </table> ", data.CandidateName, data.Date.ToString("MM/dd/yyyy"), data.PaidAmount, DateTime.Now.Date.Subtract(data.Date), status); SMTPEmailSendingModel.Send(toEmail, body, "(" + data.CandidateName + ") Changed:" + status, ccEmail, "*****@*****.**"); var timeline = new CandidateTimeLine(); timeline.ChangedBy = (Session["userInfo"] as DashTechCMS.Models.User.UserInfoModel).UserId; timeline.Date = DateTime.Now.Date; timeline.RefCandidateId = id; timeline.Status = status; db.CandidateTimeLines.Add(timeline); db.SaveChanges(); return(RedirectToAction("Index")); }