public ActionResult popupUserFilter(UserSessionFilterEntity model)
        {
            // Save data to database for Session Filter.
            UserSessionFacade fac = new UserSessionFacade(this.CurrentClient.ApplicationDBConnectionString);

            int id = model.UserId;

            model.UserId = Helper.oUser.UserId;
            fac.InsertOrUpdateUserSessionFilter(model);
            ViewBag.Message    = id > 0 ? "Data created successfully." : "Data updated successfully.";
            ViewBag.CloseAlert = "<script type='text/javascript'>$(document).ready(function(){parent.backToparent2();});</script>";
            TempData.Keep();
            return(PartialView("_popupUserFilter", model));
        }
 public ActionResult SaveImportFiler(string ImportProcess, string From)
 {
     if (!string.IsNullOrEmpty(ImportProcess))
     {
         ImportProcess = StringCipher.Decrypt(ImportProcess, General.passPhrase);
         UserSessionFacade fac = new UserSessionFacade(this.CurrentClient.ApplicationDBConnectionString);
         model = fac.GetUserSessionFilterByUserId(Helper.oUser.UserId);
         if (model.ImportProcess != ImportProcess)
         {
             model.ImportProcess = ImportProcess;
             fac.InsertOrUpdateUserSessionFilter(model);
         }
     }
     if (From == "MatchData")
     {
         return(RedirectToAction("Index", "StewardshipPortal"));
     }
     else
     {
         return(RedirectToAction("Index", "BadInputData"));
     }
 }
示例#3
0
        public ActionResult FilterCleanData(List <FilterData> filters)
        {
            UserSessionFilterEntity filtermodel = new UserSessionFilterEntity();

            foreach (var item in filters)
            {
                if (item.FieldName == "SrcRecordId")
                {
                    filtermodel.SrcRecordId = item.FilterValue;
                }
                else if (item.FieldName == "CompanyName")
                {
                    filtermodel.CompanyName = item.FilterValue;
                }
                else if (item.FieldName == "City")
                {
                    filtermodel.City = item.FilterValue;
                }
                else if (item.FieldName == "State")
                {
                    filtermodel.State = item.FilterValue;
                }
                else if (item.FieldName == "Country")
                {
                    filtermodel.CountryISOAlpha2Code = item.FilterValue;
                }
                else if (item.FieldName == "ImportProcess")
                {
                    filtermodel.ImportProcess = item.FilterValue;
                }
                else if (item.FieldName == "CountryGroup")
                {
                    filtermodel.CountryGroupId = Convert.ToInt32(item.FilterValue);
                }
                else if (item.FieldName == "Tag")
                {
                    filtermodel.Tag = item.FilterValue;
                }
                else if (item.FieldName == "OrderByColumn")
                {
                    filtermodel.OrderByColumn = item.FilterValue;
                }
                else if (item.FieldName == "ErrorCode")
                {
                    filtermodel.ErrorCode = item.FilterValue;
                }
            }
            filtermodel.UserId = Helper.oUser.UserId;
            int pagenumber = 0;

            if (string.IsNullOrEmpty(Convert.ToString(SessionHelper.BadInputData_IsFirstTimeFilter)) || !SessionHelper.BadInputData_IsFirstTimeFilter)
            {
                UserSessionFacade fac = new UserSessionFacade(this.CurrentClient.ApplicationDBConnectionString);
                fac.InsertOrUpdateUserSessionFilter(filtermodel);
                pagenumber = 1;
            }
            else
            {
                if (SessionHelper.BadInputData_IsFirstTimeFilter)
                {
                    pagenumber = 1;
                }
                else
                {
                    if (!string.IsNullOrEmpty(SessionHelper.CleanMatchPage))
                    {
                        pagenumber = Convert.ToInt32(SessionHelper.CleanMatchPage);
                    }
                    else
                    {
                        pagenumber = 1;
                    }
                }
            }
            SessionHelper.BadInputData_IsFirstTimeFilter = false;

            int totalCount = 0;
            int pagevalue  = 0;

            if (!string.IsNullOrEmpty(SessionHelper.CleanMatchPageNo))
            {
                pagevalue = Convert.ToInt32(SessionHelper.CleanMatchPageNo);
            }
            if (pagevalue == null || pagevalue == 0)
            {
                SettingFacade sfac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
                pagevalue = Convert.ToInt32(sfac.GetDefaultPageSize(Helper.oUser.UserId, "BadInputData"));
                pagevalue = pagevalue == 0 ? 10 : pagevalue;
            }
            pagevalue = pagevalue < 5 ? 5 : pagevalue;

            BadInputDataModel model = new BadInputDataModel();
            CompanyFacade     cfac  = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
            Tuple <List <CompanyEntity>, string> tuplecompany = cfac.GetBIDCompany(Helper.oUser.UserId, 1, pagevalue, out totalCount);

            model.Companies = tuplecompany.Item1;
            SessionHelper.CleanQueueMessage = tuplecompany.Item2;

            SessionHelper.CleanMatchPage      = pagenumber.ToString();
            SessionHelper.CleanMatchPageNo    = Convert.ToString(pagevalue);
            SessionHelper.CleanTotalCount     = Convert.ToString(totalCount);
            SessionHelper.CleanMatchedCompany = JsonConvert.SerializeObject(model.Companies);
            IPagedList <CompanyEntity> pagedCompany = new StaticPagedList <CompanyEntity>(model.Companies.ToList(), pagenumber, pagevalue, totalCount);// Set model of Company entity to pass this model to view.

            return(PartialView("_Index", pagedCompany));
        }