Ejemplo n.º 1
0
        public ActionResult Get_Complaint_Pre_Login(int customer_Id)
        {
            ComplaintViewModel cViewModel = new ComplaintViewModel();

            CustomerManager cMan = new CustomerManager();

            ComplaintManager _complaintMan = new ComplaintManager();

            PaginationInfo pager = new PaginationInfo();

            pager.IsPagingRequired = false;

            try
            {
                cViewModel.Complaint.Customer_Id = customer_Id;

                cViewModel.Complaint.Customer_Name = cMan.Get_Customer_By_Id(customer_Id).Customer_Name;

                cViewModel.Complaints = _complaintMan.Get_Complaints_By_Cust_Id(customer_Id, ref pager);

                if (TempData["cViewModel"] != null)
                {
                    cViewModel = (ComplaintViewModel)TempData["cViewModel"];

                    int Customer_Id = cViewModel.Complaint.Customer_Id;

                    string Customer_Name = cViewModel.Complaint.Customer_Name;

                    cViewModel.Complaint = new ComplaintInfo();

                    cViewModel.Complaint.Customer_Id = Customer_Id;

                    cViewModel.Complaint.Customer_Name = Customer_Name;
                }
            }
            catch (Exception ex)
            {
                cViewModel.Friendly_Message.Add(MessageStore.Get("SYS01"));
            }

            return(View("PreLoginComplaint", cViewModel));
        }
Ejemplo n.º 2
0
        public JsonResult Get_Complaints(ComplaintViewModel cViewModel)
        {
            PaginationInfo pager = new PaginationInfo();

            pager = cViewModel.Pager;
            try
            {
                if (cViewModel.Filter.Customer_Id != 0)
                {
                    cViewModel.Complaints = _complaintMan.Get_Complaints_By_Cust_Id(cViewModel.Filter.Customer_Id, ref pager);
                }
                else
                {
                    cViewModel.Complaints = _complaintMan.Get_Complaints(ref pager);
                }
                cViewModel.Pager.PageHtmlString = PageHelper.NumericPager("javascript:PageMore({0})", cViewModel.Pager.TotalRecords, cViewModel.Pager.CurrentPage + 1, cViewModel.Pager.PageSize, 10, true);
            }
            catch (Exception ex)
            {
                cViewModel.Friendly_Message.Add(MessageStore.Get("SYS01"));
            }
            return(Json(cViewModel, JsonRequestBehavior.AllowGet));
        }