Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //for division dropdown box under District save Button
                ddlDivisionId.DataTextField  = "DivisionName";
                ddlDivisionId.DataValueField = "DivisionId";
                ddlDivisionId.DataSource     = divisionManager.GetAllDivisions();
                ddlDivisionId.DataBind();

                //for district dropdown box under FromUpazila Save Button
                ddlDistrictId.DataTextField  = "DistrictName";
                ddlDistrictId.DataValueField = "DistrictId";
                ddlDistrictId.DataSource     = districtManager.GetAllDistricts();
                ddlDistrictId.DataBind();

                //for district dropdown box under DestinationUpazila Save Button
                ddlDistrictId2.DataTextField  = "DistrictName";
                ddlDistrictId2.DataValueField = "DistrictId";
                ddlDistrictId2.DataSource     = districtManager.GetAllDistricts();
                ddlDistrictId2.DataBind();

                //for touristSpot dropdown under Resort Save Button
                ddlTouristSpotId.DataTextField  = "TouristSpotName";
                ddlTouristSpotId.DataValueField = "TouristSpotId";
                ddlTouristSpotId.DataSource     = touristSpotManager.GetAllTouristSpot();
                ddlTouristSpotId.DataBind();

                //for touristSpot dropdown under Restaurant Save Button
                ddlTouristSpotWithRestaurant.DataTextField  = "TouristSpotName";
                ddlTouristSpotWithRestaurant.DataValueField = "TouristSpotId";
                ddlTouristSpotWithRestaurant.DataSource     = touristSpotManager.GetAllTouristSpot();
                ddlTouristSpotWithRestaurant.DataBind();

                //for touristSpot dropdown under Hospital Save Button
                ddlTouristSpotWithHospital.DataTextField  = "TouristSpotName";
                ddlTouristSpotWithHospital.DataValueField = "TouristSpotId";
                ddlTouristSpotWithHospital.DataSource     = touristSpotManager.GetAllTouristSpot();
                ddlTouristSpotWithHospital.DataBind();

                //for touristSpot dropdown under Police Station Save Button
                ddlTouristSpotWithPoliceStation.DataTextField  = "TouristSpotName";
                ddlTouristSpotWithPoliceStation.DataValueField = "TouristSpotId";
                ddlTouristSpotWithPoliceStation.DataSource     = touristSpotManager.GetAllTouristSpot();
                ddlTouristSpotWithPoliceStation.DataBind();
            }
        }
Пример #2
0
        public ActionResult Add()
        {
            EmployeeViewModel employeeViewModel = new EmployeeViewModel();

            employeeViewModel.DepartmentSelectList = _departmentManager.GetAllDepartments()
                                                     .Select(c => new SelectListItem
            {
                Value = c.Id.ToString(),
                Text  = c.Name
            }).ToList();

            employeeViewModel.DistrictSelectList = _districtManager.GetAllDistricts()
                                                   .Select(c => new SelectListItem
            {
                Value = c.Id.ToString(),
                Text  = c.DistrictName
            }).ToList();

            employeeViewModel.Employees = _employeeManager.GetAllEmployees();
            employeeViewModel.Employees = _employeeManager.GetAllEmployees2();
            return(View(employeeViewModel));
        }