Example #1
0
 private void GetDropDownPersonal(PersonalDetail objPersonalDetail)
 {
     using (SalutationModel objSalutation = new SalutationModel())
     {
         objPersonalDetail.salutationList = objSalutation.GetSalutationList().OrderBy(o => o.Salutation).ToList();
     }
 }
Example #2
0
        /// <summary>
        /// getSalutations
        /// </summary>
        /// <returns></returns>
        public List <SalutationModel> getSalutations()
        {
            List <SalutationModel> salutationList = new List <SalutationModel>();

            try
            {
                var dbManager = new DBManager(connectionStringSettings.Name);
                var dataTable = dbManager.getDataTable("SP_GET_SALUTATIONS", CommandType.StoredProcedure);
                if (null != dataTable && dataTable.Rows.Count > 0)
                {
                    SalutationModel salutationModel = null;
                    foreach (DataRow row in dataTable.Rows)
                    {
                        salutationModel = new SalutationModel();
                        salutationModel.SalutationId = row["SALUTATION_ID"] as int? ?? 0;
                        salutationModel.Salutation   = row["SALUTATION"] as string ?? string.Empty;
                        salutationList.Add(salutationModel);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(salutationList);
        }
Example #3
0
        public ActionResult Edit(int id)
        {
            try
            {
                ViewBag.Saved = false;
                Models.SalutationModel mSalutation = new SalutationModel()
                {
                    SalutationId = 0
                };

                CLayer.Salutation staycategory = BLayer.Salutation.Get(id);

                if (staycategory != null)
                {
                    mSalutation = new SalutationModel()
                    {
                        SalutationId = staycategory.SalutationId,
                        Title        = staycategory.Title
                    }
                }
                ;

                return(PartialView("_Edit", mSalutation));
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
                return(Redirect("~/Admin/ErrorPage"));
            }
        }
        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");
            }
        }
        // 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));
        }
Example #6
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));
        }
        public PartialViewResult Personal()
        {
            PersonalDetail objPersonalDetail = new PersonalDetail();

            using (SalutationModel objSalutation = new SalutationModel())
            {
                objPersonalDetail.salutationList = objSalutation.GetSalutationList().OrderBy(o => o.Salutation).ToList();
            }
            return(PartialView("~/Views/ProfileManage/_DetailPersonal.cshtml", objPersonalDetail));
        }
        // GET: ProfileManage
        public ActionResult Index()
        {
            PersonalDetail objPersonalDetail = new PersonalDetail();

            using (SalutationModel objSalutation = new SalutationModel())
            {
                objPersonalDetail.salutationList = objSalutation.GetSalutationList().OrderBy(o => o.Salutation).ToList();
            }
            return(View(objPersonalDetail));
        }
        public ActionResult DeleteSalutation(int?Id)
        {
            if (Id != null)
            {
                SalutationModel objSalutation = new SalutationModel();
                objSalutation.DeleteSalutation(Convert.ToInt32(Id));
            }
            Sal_Dept_DesigModel objSal_Dept_Desig = new Sal_Dept_DesigModel();

            BingModelData(objSal_Dept_Desig);

            return(View("~/Views/sal_Dept_Desig/Index.cshtml", objSal_Dept_Desig));
        }
        private void BingModelData(Sal_Dept_DesigModel objAdminModel)
        {
            using (SalutationModel objSalutationModel = new SalutationModel())
            {
                objAdminModel.salutationList = objSalutationModel.GetSalutationList().OrderBy(cc => cc.Salutation).ToList();
            }

            using (DepartmentModel objDepartment = new DepartmentModel())
            {
                objAdminModel.departmentList = objDepartment.GetDepartmentList().OrderBy(cc => cc.Department).ToList();
            }

            using (DesignationModel objDesignation = new DesignationModel())
            {
                objAdminModel.designationList = objDesignation.GetDesignationList().OrderBy(cc => cc.Designation).ToList();
            }
        }
        public ActionResult EditSalutation(string Id)
        {
            Sal_Dept_DesigModel objAdminModel = new Sal_Dept_DesigModel();

            using (SalutationModel objSalutation = new SalutationModel())
            {
                objAdminModel.salutationList = objSalutation.GetSalutationList().OrderBy(cc => cc.Salutation).ToList();
            }

            using (DepartmentModel objDepartment = new DepartmentModel())
            {
                objAdminModel.departmentList = objDepartment.GetDepartmentList().OrderBy(cc => cc.Department).ToList();
            }

            using (DesignationModel objDesignation = new DesignationModel())
            {
                objAdminModel.designationList = objDesignation.GetDesignationList().OrderBy(cc => cc.Designation).ToList();
            }
            return(View("~/Views/Sal_Dept_Desig/Index.cshtml", objAdminModel));
        }
        public ActionResult EditDepartment(int?Id)
        {
            Sal_Dept_DesigModel objAdminModel = new Sal_Dept_DesigModel();

            using (DepartmentModel objDepartment = new DepartmentModel())
            {
                objAdminModel.departmentList = objDepartment.GetDepartmentList().OrderBy(cc => cc.Department).ToList();
                objAdminModel.DepartmentID   = objAdminModel.departmentList.Where(m => m.DepartmentID == Id).SingleOrDefault().DepartmentID;
                objAdminModel.Department     = objAdminModel.departmentList.Where(m => m.DepartmentID == Id).SingleOrDefault().Department;
            }

            using (DesignationModel objDesignation = new DesignationModel())
            {
                objAdminModel.designationList = objDesignation.GetDesignationList().OrderBy(cc => cc.Designation).ToList();
            }

            using (SalutationModel objSalutation = new SalutationModel())
            {
                objAdminModel.salutationList = objSalutation.GetSalutationList().OrderBy(cc => cc.Salutation).ToList();
            }
            return(View("~/Views/Sal_Dept_Desig/Index.cshtml", objAdminModel));
        }
        public ActionResult Salutation(Sal_Dept_DesigModel objSal_Dept_Desig, string submit)
        {
            if (!String.IsNullOrEmpty(submit.Trim()))
            {
                SalutationModel objSalutationModel = new SalutationModel();
                objSalutationModel.Salutation   = objSal_Dept_Desig.Salutation;
                objSalutationModel.SalutationID = objSal_Dept_Desig.SalutationID;
                switch (submit.Trim())
                {
                case "Update":
                    objSalutationModel.AddEditSalutation(objSalutationModel, clsCommon.Update);
                    BingModelData(objSal_Dept_Desig);
                    break;

                case "Add":
                    objSalutationModel.AddEditSalutation(objSalutationModel, clsCommon.Insert);
                    BingModelData(objSal_Dept_Desig);
                    break;

                case "Search":
                    BingModelData(objSal_Dept_Desig);
                    if (objSal_Dept_Desig.Salutation != null || !String.IsNullOrEmpty(objSal_Dept_Desig.Salutation))
                    {
                        objSal_Dept_Desig.salutationList = objSalutationModel.GetSalutationList(objSal_Dept_Desig.Salutation).ToList();
                    }
                    else
                    {
                        objSal_Dept_Desig.SalutationID = 0;
                    }
                    break;
                }
            }



            return(View("~/Views/sal_Dept_Desig/Index.cshtml", objSal_Dept_Desig));
        }