public void AddResponse(string cId, string resp)
        {
            ComplaintsModel complainModel = new ComplaintsModel();
            int id = ValidationUtility.ToInteger(cId);

            complainModel.AddcomplaintResponse(id, resp);
        }
        public void AddComplaints(string sId,string name,string telephone,string email, string cContacted, string emailedSubway, string fRecieved, string pFixed, string comm)
        {
            ComplaintsModel complaintsModel = new ComplaintsModel();

            int storeId = ValidationUtility.ToInteger(sId);

            bool customerContacted = ValidationUtility.ToY_NBool(cContacted);
            bool feedbackRecieved = ValidationUtility.ToY_NBool(fRecieved);
            bool problemFixed = ValidationUtility.ToY_NBool(pFixed);
            bool emailSubway = ValidationUtility.ToY_NBool(emailedSubway);

            ComplaintsDTO complaintsDTO = new ComplaintsDTO();

            complaintsDTO.StoreId = storeId;
            complaintsDTO.ComplaintDate = DateTime.Now;
            complaintsDTO.CustomerContacted = customerContacted;
            complaintsDTO.FeedbackRecieved = feedbackRecieved;
            complaintsDTO.ProblemFixed = problemFixed;
            complaintsDTO.EmailedSubway = emailSubway;
            complaintsDTO.Comment = comm;
            complaintsDTO.Name = name;
            complaintsDTO.TelePhone = telephone;
            complaintsDTO.Email = email;
            complaintsDTO.CreatedDateTime = DateTime.Now;
            complaintsDTO.LastUpdateDateTime = DateTime.Now;

            complaintsModel.AddComplaints(complaintsDTO);
        }
        public JsonResult AssignStore()
        {
            ComplaintsModel complainModel = new ComplaintsModel();
            UserContext cont = (UserContext)Session["UserContext"];

            ArrayList list = null;

            if (!ValidationUtility.IsNull(cont))
            {
                list = complainModel.GetAreaMngAssignStore(cont.Id);

            }

            return Json(list, JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetComplaintListData(string sid, string date)
        {
            int storeId = ValidationUtility.ToInteger(sid);

            DateTime selectDate = DateTime.Now;

            if (!ValidationUtility.IsNull(date))
            {
                selectDate = ValidationUtility.ToDate(date);
            }

            ComplaintsModel complaintsModel = new ComplaintsModel();

            ArrayList complaintList = null;

            UserContext contex = (UserContext) Session["UserContext"];

            if (!ValidationUtility.IsNull(contex) && ValidationUtility.IsEqual("AreaManager", contex.Role))
            {
                complaintList = complaintsModel.GetComplaintsList(storeId, selectDate, contex.Id);
            }
            else if (!ValidationUtility.IsNull(contex) && ValidationUtility.IsEqual("Corporate", contex.Role))
            {
                complaintList = complaintsModel.GetComplaintsList(storeId, selectDate, contex.Id);
            }
            else if (!ValidationUtility.IsNull(contex) && ValidationUtility.IsEqual("GeneralManager", contex.Role))
            {
                complaintList = complaintsModel.GetGenManComplaintsList(storeId, selectDate, contex.Id);
            }
            else
            {
                 complaintList = complaintsModel.GetComplaintsList(storeId, selectDate, 0);
            }

            return Json(complaintList, JsonRequestBehavior.AllowGet);
        }
 public void DeleteComplaints(string id)
 {
     ComplaintsModel complaintsModel = new ComplaintsModel();
     int complaintId = ValidationUtility.ToInteger(id);
     complaintsModel.DeleteComplaintsData(complaintId);
 }
        public void UpdateComplaints(string Id, string name, string telephone, string email, string cContacted, string emailedSubway, string fRecieved, string pFixed, string comm, string resp)
        {
            ComplaintsModel complaintsModel = new ComplaintsModel();

            int id = ValidationUtility.ToInteger(Id);
            bool customerContacted = ValidationUtility.ToY_NBool(cContacted);
            bool feedbackRecieved = ValidationUtility.ToY_NBool(fRecieved);
            bool problemFixed = ValidationUtility.ToY_NBool(pFixed);

            bool emailSubway = ValidationUtility.ToY_NBool(emailedSubway);

            ComplaintsDTO complaintsDTO = new ComplaintsDTO();

            complaintsDTO.Id = id;

            complaintsDTO.CustomerContacted = customerContacted;
            complaintsDTO.FeedbackRecieved = feedbackRecieved;
            complaintsDTO.ProblemFixed = problemFixed;
            complaintsDTO.EmailedSubway = emailSubway;
            complaintsDTO.Comment = comm;
            complaintsDTO.Response = resp;
            complaintsDTO.Name = name;
            complaintsDTO.TelePhone = telephone;
            complaintsDTO.Email = email;

            complaintsDTO.LastUpdateDateTime = DateTime.Now;

            complaintsModel.UpdateComplaintsData(complaintsDTO);
        }