public ActionResult Display_PaymentAdvice(int MenuId)
        {
            Menu Menu = new MenuService(_unitOfWork).Find(MenuId);

            Display_PaymentAdviceViewModel vm = new Display_PaymentAdviceViewModel();

            //vm.ReportType = Menu.MenuName;

            System.Web.HttpContext.Current.Session["SettingList"]    = new List <DisplayFilterPaymentAdviceSettings>();
            System.Web.HttpContext.Current.Session["CurrentSetting"] = new DisplayFilterPaymentAdviceSettings();
            int SiteId     = (int)System.Web.HttpContext.Current.Session["SiteId"];
            int DivisionId = (int)System.Web.HttpContext.Current.Session["DivisionId"];

            DateTime now = DateTime.Now;

            vm.FromDate = new DateTime(now.Year, now.Month, 1).ToString("dd/MMM/yyyy");// "01/Apr/" + DateTime.Now.Date.Year.ToString();
            vm.ToDate   = DateTime.Now.Date.ToString("dd/MMM/yyyy");

            vm.Format      = ReportFormat.ProcessWise;
            vm.SiteIds     = SiteId.ToString();
            vm.DivisionIds = DivisionId.ToString();

            //DisplayFilterPaymentAdviceSettings SettingParameter = GetParameterSettings(vm);

            return(View("Display_PaymentAdvice", vm));
        }
        public JsonResult DisplayPaymentAdviceFill(Display_PaymentAdviceViewModel vm)
        {
            DisplayFilterPaymentAdviceSettings   SettingParameter       = SetCurrentParameterSettings(vm);
            IEnumerable <PaymentAdivceViewModel> FinishingPaymentAdvice = _PaymentAdivceService.FinishingPaymentAdvice(SettingParameter);

            if (FinishingPaymentAdvice != null)
            {
                JsonResult json = Json(new { Success = true, Data = FinishingPaymentAdvice.ToList() }, JsonRequestBehavior.AllowGet);
                json.MaxJsonLength = int.MaxValue;
                return(json);
            }
            return(Json(new { Success = true }, JsonRequestBehavior.AllowGet));
        }
        public DisplayFilterPaymentAdviceSettings SetCurrentParameterSettings(Display_PaymentAdviceViewModel vm)
        {
            DisplayFilterPaymentAdviceSettings DisplayFilterPaymentAdviceSettings = new DisplayFilterPaymentAdviceSettings();

            DisplayFilterPaymentAdviceSettings.Format = vm.Format;

            DisplayFilterPaymentAdviceParameters FromDateParameter = new DisplayFilterPaymentAdviceParameters();

            FromDateParameter.ParameterName = "FromDate";
            FromDateParameter.Value         = vm.FromDate;
            FromDateParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters ToDateParameter = new DisplayFilterPaymentAdviceParameters();

            ToDateParameter.ParameterName = "ToDate";
            ToDateParameter.Value         = vm.ToDate;
            ToDateParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters JobWorkerParameter = new DisplayFilterPaymentAdviceParameters();

            JobWorkerParameter.ParameterName = "JobWorker";
            JobWorkerParameter.Value         = vm.JobWorker;
            JobWorkerParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters FormatParameter = new DisplayFilterPaymentAdviceParameters();

            FormatParameter.ParameterName = "Format";
            FormatParameter.Value         = vm.Format;
            FormatParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters SiteParameter = new DisplayFilterPaymentAdviceParameters();

            SiteParameter.ParameterName = "Site";
            SiteParameter.Value         = vm.SiteIds;
            SiteParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters DivisionParameter = new DisplayFilterPaymentAdviceParameters();

            DivisionParameter.ParameterName = "Division";
            DivisionParameter.Value         = vm.DivisionIds;
            DivisionParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters ProcessParameter = new DisplayFilterPaymentAdviceParameters();

            ProcessParameter.ParameterName = "Process";
            ProcessParameter.Value         = vm.Process;
            ProcessParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceParameters TextHiddenParameter = new DisplayFilterPaymentAdviceParameters();

            TextHiddenParameter.ParameterName = "TextHidden";
            TextHiddenParameter.Value         = vm.TextHidden;
            TextHiddenParameter.IsApplicable  = true;

            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters = new List <DisplayFilterPaymentAdviceParameters>();
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(FromDateParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(ToDateParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(JobWorkerParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(FormatParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(SiteParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(DivisionParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(ProcessParameter);
            DisplayFilterPaymentAdviceSettings.DisplayFilterPaymentAdviceParameters.Add(TextHiddenParameter);
            System.Web.HttpContext.Current.Session["CurrentSetting"] = DisplayFilterPaymentAdviceSettings;
            return(DisplayFilterPaymentAdviceSettings);
        }