Пример #1
0
        private CountryMasterListVM GetCountryListVM(CountryMasterFilter objFilter)
        {
            //Thread.Sleep(1000);
            //CountryMasterListVM userListVM = null;
            CommonBL objCommonBL = null;

            try
            {
                objCountryBL          = new CountryBL();
                objListVM             = new CountryMasterListVM();
                objCommonBL           = new CommonBL();
                objFilter.PagingRoute = new PagingRoute()
                {
                    Action = "Index", Controller = "Country"
                };
                objListVM.lstCountryMaster = objCountryBL.GetData(objFilter);
                objListVM.lstUserTypes     = objCommonBL.GetCodeDetail(new CodeDetailFilter()
                {
                    CodeTypeId = 1
                });
                objListVM.QueryBO = objListVM.objFilter = objFilter;
                return(objListVM);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                objListVM = null;
            }
        }
Пример #2
0
        public ActionResult Index(CountryMasterFilter objFilter, int?pageNumber)
        {
            CountryMasterListVM empVM = null;

            try
            {
                objCountryBL = new CountryBL();
                if (TempData["CountryFilter"] != null)
                {
                    objFilter           = (CountryMasterFilter)TempData["CountryFilter"];
                    objFilter.CountryID = 0;
                    if (pageNumber != null)
                    {
                        if (pageNumber != 0)
                        {
                            objFilter.PageNumber = pageNumber ?? objFilter.PageNumber;
                        }
                        TempData.Keep("CountryFilter");
                    }
                }
                empVM = GetCountryListVM(objFilter);
                return(View("Index", empVM));
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                empVM        = null;
                objCountryBL = null;
            }
        }
Пример #3
0
        public ActionResult Action(CountryMasterFilter objFilter, string submit)
        {
            CommonBL      objCommonBL = null;
            CountryMaster objCountry  = null;

            try
            {
                objDetailsVM = new CountryDetailsVM();
                if (submit.ToLower() == "edit")
                {
                    objCommonBL = new CommonBL();
                    TempData["CountryFilter"] = objFilter;
                    objCountryBL         = new CountryBL();
                    objDetailsVM         = new CountryDetailsVM();
                    objDetailsVM.CntMstr = objCountryBL.GetData(new CountryMasterFilter()
                    {
                        CountryID = objFilter.CountryID
                    }).FirstOrDefault();
                    // objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 });
                    return(View("Details", objDetailsVM));
                }
                else if (submit.ToLower() == "delete")
                {
                    objCountryBL          = new CountryBL();
                    objListVM             = new CountryMasterListVM();
                    objCountry            = new CountryMaster(objFilter.CountryID);
                    objCountry.ModifiedBy = 1;
                    objCountry.Remark     = "Deleted";
                    objResponse           = objCountryBL.SaveCountry(objCountry, "D");
                    objFilter.CountryID   = 0;
                    objListVM             = GetCountryListVM(objFilter);
                    objListVM.Toast       = WebCommon.SetToast(objResponse);
                    return(View("Index", objListVM));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                objCountryBL = null;
                objDetailsVM = null;
                objListVM    = null;
                objCommonBL  = null;
            }
            return(null);
        }