Пример #1
0
        // GET: Country
        public ActionResult Index()
        {
            CountryModel objCountryModel = new CountryModel();

            objCountryModel.countryList = objCountryModel.GetCountryList().OrderBy(o => o.Country).ToList();
            return(View(objCountryModel));
        }
Пример #2
0
        public ActionResult Edit(int?Id)
        {
            CountryModel objCountryModel = new CountryModel();

            objCountryModel = objCountryModel.GetCountryList().Single(m => m.CountryID == Id);
            return(View(objCountryModel));
        }
Пример #3
0
        // GET: Profile
        public ActionResult Index()
        {
            //PersonalDetail objPersonalDetail = new PersonalDetail();
            //AddressDetail objAddressDetail = new AddressDetail();
            //ContactDetail objContactDetail = new ContactDetail();

            //return View(new object[] { objPersonalDetail, objAddressDetail, objContactDetail });
            ProfileModel objProfileModel = new ProfileModel();

            using (SalutationModel objSalutation = new SalutationModel())
            {
                objProfileModel.personalDetail.salutationList = objSalutation.GetSalutationList().OrderBy(o => o.Salutation).ToList();
            }

            using (CityModel objCity = new CityModel())
            {
                objProfileModel.addressDetail.cityList = objCity.GetCityList().OrderBy(o => o.CityName).ToList();
            }

            using (StateModel objState = new StateModel())
            {
                objProfileModel.addressDetail.stateList = objState.GetStateList().OrderBy(s => s.StateName).ToList();
            }

            using (CountryModel objCountry = new CountryModel())
            {
                objProfileModel.addressDetail.countryList = objCountry.GetCountryList().OrderBy(o => o.Country).ToList();
            }

            return(View(objProfileModel));
        }
        public PartialViewResult AjaxPost(string postType, string Command, string SaveAddress, PersonalDetail objPersonalDetail, AddressDetail objAddressDetail)
        {
            switch (postType)
            {
            case "Address":
                using (CityModel objCity = new CityModel())
                {
                    objAddressDetail.cityList = objCity.GetCityList().OrderBy(o => o.CityName).ToList();
                }

                using (StateModel objState = new StateModel())
                {
                    objAddressDetail.stateList = objState.GetStateList().OrderBy(s => s.StateName).ToList();
                }

                using (CountryModel objCountry = new CountryModel())
                {
                    objAddressDetail.countryList = objCountry.GetCountryList().OrderBy(o => o.Country).ToList();
                }

                return(PartialView("~/Views/ProfileManage/_DetailAddress.cshtml", objAddressDetail));

            default:    //Personal
                using (SalutationModel objSalutation = new SalutationModel())
                {
                    objPersonalDetail.salutationList = objSalutation.GetSalutationList().OrderBy(o => o.Salutation).ToList();
                }
                return(PartialView("~/Views/ProfileManage/_DetailPersonal.cshtml", objPersonalDetail));
                //return RedirectToAction("Index", "ProfileManage");
            }
        }
Пример #5
0
        public ActionResult Index()
        {
            AdminModel adminModel = new AdminModel();
            //List<CityModel> objCityModel = new List<CityModel>();
            Random rnd = new Random();

            using (CityModel objCityModel = new CityModel())
            {
                adminModel.cityList = objCityModel.GetCityList().OrderBy(o => rnd.Next()).Take(10).OrderBy(s => s.CityName).ToList();
            }

            // = objCityModel.OrderBy(u => rnd.Next(objCityModel.Count)).Take(10).ToList().OrderBy(m=>m.CityName).ToList();
            #region commented code Usefull do not delete
            //adminModel.stateList = objCityModel.OrderBy(k => k.StateName)
            //    .GroupBy(item => item.RefStateID, (key, items) => new StateModel
            //    {
            //        StateID = items.First().RefStateID,
            //        StateName = items.First().StateName,
            //        CountryName = items.First().Country,
            //        RefCountryID = items.First().RefCountryID
            //    }).ToList();

            //adminModel.countryList = objCityModel.OrderBy(c => c.Country)
            //    .GroupBy(item => item.RefCountryID, (key, items) => new CountryModel
            //    {
            //        CountryID = items.First().RefCountryID,
            //        Country = items.First().Country
            //    }).ToList();
            #endregion

            using (StateModel objState = new StateModel())
            {
                adminModel.stateList = objState.GetStateList().OrderBy(o => rnd.Next()).Take(10).OrderBy(s => s.StateName).ToList();
            }

            using (CountryModel objCountry = new CountryModel())
            {
                adminModel.countryList = objCountry.GetCountryList().OrderBy(o => rnd.Next()).Take(10).OrderBy(o => o.Country).ToList();
            }

            using (SalutationModel objSalutation = new SalutationModel())
            {
                adminModel.salutationList = objSalutation.GetSalutationList().OrderBy(o => rnd.Next()).Take(10).OrderBy(cc => cc.Salutation).ToList();
            }

            using (DepartmentModel objDepartment = new DepartmentModel())
            {
                adminModel.departmentList = objDepartment.GetDepartmentList().OrderBy(o => rnd.Next()).Take(10).OrderBy(cc => cc.Department).ToList();
            }

            using (DesignationModel objDesignation = new DesignationModel())
            {
                adminModel.designationList = objDesignation.GetDesignationList().OrderBy(o => rnd.Next()).Take(10).OrderBy(cc => cc.Designation).ToList();
            }

            return(View(adminModel));
        }
Пример #6
0
        public ActionResult Create()
        {
            StateModel   objStateModel = new StateModel();
            CountryModel objCountry    = new CountryModel();

            objStateModel.countryList = objCountry.GetCountryList().ToList();

            objStateModel.stateList = objStateModel.GetStateList().ToList();

            return(View(objStateModel));
        }
Пример #7
0
        public ActionResult Edit(int?Id)
        {
            StateModel objStateModel = new StateModel();

            objStateModel = objStateModel.GetStateList().Single(m => m.StateID == Id);

            CountryModel objCountry = new CountryModel();

            objStateModel.countryList = objCountry.GetCountryList().ToList();

            return(View(objStateModel));
        }
Пример #8
0
        private void GetDropDownAddress(AddressDetail objAddressDetail)
        {
            using (CityModel objCity = new CityModel())
            {
                objAddressDetail.cityList = objCity.GetCityList().OrderBy(o => o.CityName).ToList();
            }

            using (StateModel objState = new StateModel())
            {
                objAddressDetail.stateList = objState.GetStateList().OrderBy(s => s.StateName).ToList();
            }

            using (CountryModel objCountry = new CountryModel())
            {
                objAddressDetail.countryList = objCountry.GetCountryList().OrderBy(o => o.Country).ToList();
            }
        }
Пример #9
0
        public ActionResult Create(StateModel objStateModel)
        {
            if (ModelState.IsValid)
            {
                //clsState objState = new clsState();
                TryUpdateModel <StateModel>(objStateModel);
                objStateModel.AddEditState(objStateModel, clsCommon.Insert);
                return(RedirectToAction("Index"));
            }
            else
            {
                CountryModel objCountry = new CountryModel();
                objStateModel.countryList = objCountry.GetCountryList().ToList();

                objStateModel.stateList = objStateModel.GetStateList().ToList();

                return(View(objStateModel));
            }
        }
Пример #10
0
        public ActionResult Create_Post()
        {
            CityModel objCityModel = new CityModel();

            if (ModelState.IsValid)
            {
                TryUpdateModel <CityModel>(objCityModel);
                objCityModel.AddEditCity(objCityModel, clsCommon.Insert);
                return(RedirectToAction("Index"));
            }
            else
            {
                CountryModel objCountry = new CountryModel();
                objCityModel.countryList = objCountry.GetCountryList().ToList();

                StateModel objStateModel = new StateModel();
                objCityModel.stateList = objStateModel.GetStateList().ToList();

                return(View(objCityModel));
            }
        }
Пример #11
0
        public PartialViewResult Address()
        {
            AddressDetail objAddressDetail = new AddressDetail();

            using (CityModel objCity = new CityModel())
            {
                objAddressDetail.cityList = objCity.GetCityList().OrderBy(o => o.CityName).ToList();
            }

            using (StateModel objState = new StateModel())
            {
                objAddressDetail.stateList = objState.GetStateList().OrderBy(s => s.StateName).ToList();
            }

            using (CountryModel objCountry = new CountryModel())
            {
                objAddressDetail.countryList = objCountry.GetCountryList().OrderBy(o => o.Country).ToList();
            }

            return(PartialView("~/Views/ProfileManage/_DetailAddress.cshtml", objAddressDetail));
        }
Пример #12
0
 public ActionResult Search(CountryModel objCountryModel)
 {
     objCountryModel.countryList = objCountryModel.GetCountryList(Convert.ToString(objCountryModel.Country)).OrderBy(x => x.Country).ToList();
     return(View("~/Views/Country/Index.cshtml", objCountryModel));
 }