public ActionResult RenewActiveFeedbackModule(string jsonData) { bool status = false; var userDetails = (CustomerLoginDetail)Session["UserSession"]; JavaScriptSerializer json_serializer = new JavaScriptSerializer(); json_serializer.MaxJsonLength = int.MaxValue; object[] objData = (object[])json_serializer.DeserializeObject(jsonData); foreach (Dictionary <string, object> item in objData) { string GroupId = Convert.ToString(item["GroupId"]); string Fees = Convert.ToString(item["Fees"]); //string StartDate = Convert.ToString(item["StartDate"]); string PaymentMode = Convert.ToString(item["PaymentMode"]); Feedback_FeedbackConfig objFeedback = new Feedback_FeedbackConfig(); objFeedback = FMR.GetFeedbackByGroupId(GroupId); objFeedback.Fees = Fees; objFeedback.PaymentMode = PaymentMode; objFeedback.EndDate = objFeedback.EndDate.Value.AddDays(364).Date; objFeedback.RenewDate = DateTime.Now; objFeedback.Status = "Renew"; status = FMR.EnableFeedbackModule(objFeedback, null); } return(new JsonResult() { Data = status, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public ActionResult EnableFeedbackModule(string jsonData) { bool status = false; var userDetails = (CustomerLoginDetail)Session["UserSession"]; JavaScriptSerializer json_serializer = new JavaScriptSerializer(); json_serializer.MaxJsonLength = int.MaxValue; object[] objData = (object[])json_serializer.DeserializeObject(jsonData); foreach (Dictionary <string, object> item in objData) { string GroupId = Convert.ToString(item["GroupId"]); string Fees = Convert.ToString(item["Fees"]); string StartDate = Convert.ToString(item["StartDate"]); string PaymentMode = Convert.ToString(item["PaymentMode"]); Feedback_FeedbackConfig objFeedback = new Feedback_FeedbackConfig(); objFeedback.GroupId = Convert.ToInt32(GroupId); objFeedback.Fees = Fees; objFeedback.PaymentMode = PaymentMode; objFeedback.StartDate = Convert.ToDateTime(StartDate).Date; objFeedback.EndDate = Convert.ToDateTime(StartDate).AddDays(364).Date; objFeedback.AddedBy = userDetails.LoginId; objFeedback.AddedDate = DateTime.Now; objFeedback.Status = "Active"; //Get XML File and send all content with this call to insert var masterData = FMR.GetFeedbackMasterData(); List <Feedback_Content> lstData = new List <Feedback_Content>(); foreach (var newItem in masterData) { Feedback_Content objNew = new Feedback_Content(); objNew.GroupId = GroupId; objNew.Section = newItem.Section; objNew.Type = newItem.Type; objNew.TypeId = newItem.TypeId; objNew.Text = newItem.Text; objNew.IsDisplay = newItem.IsDisplay; objNew.IsMandatory = Convert.ToString(newItem.IsMandatory); objNew.AddedDate = DateTime.Now; objNew.AddedBy = userDetails.LoginId; lstData.Add(objNew); } status = FMR.EnableFeedbackModule(objFeedback, lstData); } return(new JsonResult() { Data = status, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public ActionResult StopFeedbackModule(string GroupId, string Reason) { bool status = false; var userDetails = (CustomerLoginDetail)Session["UserSession"]; Feedback_FeedbackConfig objFeedback = new Feedback_FeedbackConfig(); objFeedback = FMR.GetFeedbackByGroupId(GroupId); objFeedback.GroupId = Convert.ToInt32(GroupId); objFeedback.StoppedReason = Reason; objFeedback.EndDate = DateTime.Today.Date; objFeedback.AddedBy = userDetails.LoginId; objFeedback.StoppedDate = DateTime.Now; objFeedback.Status = "Stop"; status = FMR.EnableFeedbackModule(objFeedback, null); return(new JsonResult() { Data = status, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }