コード例 #1
0
        // GET: Education
        public ActionResult Index()
        {
            var educationLevels = educationService.GetAllT();

            if (educationLevels == null)
            {
                return(View());
            }

            return(View(@"~\Views\Configuration\Education\Index.cshtml", educationLevels));
        }
コード例 #2
0
        // GET: Designation
        public ActionResult Index()
        {
            var designations = designService.GetAllT();

            if (designations == null)
            {
                return(View());
            }

            return(View(@"~\Views\Configuration\Designation\Index.cshtml", designations));
        }
コード例 #3
0
        // GET: OfficeType
        public ActionResult Index()
        {
            var offficeType = officeTypeService.GetAllT();

            if (offficeType == null)
            {
                return(View());
            }

            return(View(@"~\Views\Configuration\OfficeType\Index.cshtml", offficeType));
        }
コード例 #4
0
        // GET: Religionoller
        public ActionResult Index()
        {
            var religions = religionService.GetAllT();

            if (religions == null)
            {
                return(View());
            }

            return(View(@"~\Views\Configuration\Religion\Index.cshtml", religions));
        }
コード例 #5
0
        // GET: Colour
        public ActionResult Index()
        {
            var colours = colourService.GetAllT()
                          .OrderBy(x => x.ColourName)
                          .ToList();

            if (colours == null)
            {
                return(View());
            }


            return(View(@"~\Views\Configuration\Colour\Index.cshtml", colours));
        }
コード例 #6
0
        public ActionResult Edit(int?id)
        {
            try
            {
                if (id == null)
                {
                    return(HttpNotFound());
                }

                var missingModel = missingService.GetOneMissingModel(id);

                var missingViewModel = new MissingUnApproveViewModel
                {
                    MissingModel = missingModel,

                    PhotoList = photoService.GetAllT().Where(x => x.MissingId == id) ?? new List <PhotoModel>(),

                    GenderList = StaticSelectList.GenderList(),

                    FiscalYearList = dynamicSelectList.GetFiscalYearList(),

                    OfficeList = dynamicSelectList.GetOfficeList(Convert.ToInt32(missingModel.OfficeId)),

                    ColourList = dynamicSelectList.GetColorList(),

                    EducationList = dynamicSelectList.GetColorList(),

                    ReligionList = dynamicSelectList.GetReligionList(),

                    CountryList = dynamicSelectList.GetCountryList(),

                    StateList = dynamicSelectList.GetStateList(),

                    IdTypeList = dynamicSelectList.GetIdTypeList(),

                    EthnicityList = dynamicSelectList.GetEthnicities(),

                    MartialStatusList = StaticSelectList.MartialList(),

                    PersonTypeList = StaticSelectList.PersonTypeList(),

                    HeightUnitList = StaticSelectList.HeightUnitList(),

                    MDistrictList = dynamicSelectList.GetDistrictListByStateId(missingModel.MStateId),

                    PDistrictList = dynamicSelectList.GetDistrictListByStateId(missingModel.PStateId),

                    TDistrictList = dynamicSelectList.GetDistrictListByStateId(missingModel.TStateId),

                    PMunicipalityList = dynamicSelectList.GetDistrictListByStateId(missingModel.PDistrictId),

                    MMunicipalityList = dynamicSelectList.GetDistrictListByStateId(missingModel.MDistrictId),

                    TMunicipalityList = dynamicSelectList.GetMunicipalityListByDistrictId(missingModel.TDistrictId),
                };

                return(View(missingViewModel));
            }
            catch (DbEntityValidationException e)
            {
                TempData["Danger"] = $"Opps something went wrong {string.Join(";",e.EntityValidationErrors.SelectMany(x=>x.ValidationErrors).Select(x=>x.ErrorMessage))}";
                throw;
            }
        }