Exemplo n.º 1
0
        public ActionResult MonitoringPlusRegistrationDUNSDetails(string Parameters, int?DUNSDetailsPage, int?DUNSDetailsSortby, int?DUNSDetailsSortorder, int?DUNSDetailsPagevalue, string RegistrationName = "", string DnBDUNSNumber = "", string AuthToken = "")
        {
            #region  pagination
            if (!(DUNSDetailsSortby.HasValue && DUNSDetailsSortby.Value > 0))
            {
                DUNSDetailsSortby = 1;
            }

            if (!(DUNSDetailsSortorder.HasValue && DUNSDetailsSortorder.Value > 0))
            {
                DUNSDetailsSortorder = 1;
            }

            int sortParam        = int.Parse(DUNSDetailsSortby.ToString() + DUNSDetailsSortorder.ToString());
            int totalCount       = 0;
            int currentPageIndex = DUNSDetailsPage.HasValue ? DUNSDetailsPage.Value : 1;
            int pageSize         = DUNSDetailsPagevalue.HasValue ? DUNSDetailsPagevalue.Value : 10;
            #endregion
            bool isFromMainPage = false;

            if (!string.IsNullOrEmpty(Parameters))
            {
                Parameters       = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
                RegistrationName = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 0, 1);
                AuthToken        = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 1, 1);
                isFromMainPage   = Convert.ToBoolean(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 2, 1));
            }
            SettingFacade fac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);

            DataTable dt = fac.GetDPMDunsRegistrationList(RegistrationName, DnBDUNSNumber, sortParam, currentPageIndex, pageSize, out totalCount);

            #region Set Viewbag
            ViewBag.DUNSDetailsSortby          = DUNSDetailsSortby;
            ViewBag.DUNSDetailsSortorder       = DUNSDetailsSortorder;
            ViewBag.DUNSDetailsPageno          = currentPageIndex;
            ViewBag.DUNSDetailsPagevalue       = pageSize;
            SessionHelper.DUNSDetailsPagevalue = Convert.ToString(pageSize);
            ViewBag.GetDPMDunsRegistrationByRegistrationName = dt;
            ViewBag.RegistrationName = RegistrationName;
            ViewBag.AuthToken        = AuthToken;
            #endregion
            IPagedList <dynamic> pagedMonitorProfile = new StaticPagedList <dynamic>(dt.AsEnumerable().ToList(), currentPageIndex, pageSize, totalCount);

            if (isFromMainPage)
            {
                return(View("MonitoringPlusRegistrationDUNSDetails", pagedMonitorProfile));
            }
            else
            {
                return(PartialView("_MonitoringPlusRegistrationDUNSDetails", pagedMonitorProfile));
            }
        }