Ejemplo n.º 1
0
        public void LoanDropDowns(int stateid, int districtid, int mandalid, int clusterid, int villageid)
        {
            List <SelectListDto> stateSelectList = _stateservice.GetStateSelectList();
            SelectList           SlstStates      = new SelectList(stateSelectList, "ID", "Text");

            ViewBag.states = SlstStates;
            if (stateid > 0)
            {
                List <SelectListDto> districtSelectList = _DistrictService.GetDistrictsByStateID(stateid);
                SelectList           lstdistrict        = new SelectList(districtSelectList, "ID", "Text");
                ViewBag.district = lstdistrict;

                if (districtid > 0)
                {
                    List <SelectListDto> mandalSelectList = _mandalService.GetMandalByDistrictID(districtid);
                    SelectList           lStmandal        = new SelectList(mandalSelectList, "ID", "Text");
                    ViewBag.mandal = lStmandal;
                    if (mandalid > 0)
                    {
                        List <SelectListDto> clusterSelectList = _clusterService.GetClusterByMandalID(mandalid);
                        SelectList           lStClusters       = new SelectList(clusterSelectList, "ID", "Text");
                        ViewBag.clusters = lStClusters;

                        if (clusterid > 0)
                        {
                            List <SelectListDto> villageSelectList = _villageService.GetVillageByClusterID(clusterid);
                            SelectList           lstvillage        = new SelectList(villageSelectList, "ID", "Text");
                            ViewBag.village = lstvillage;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public ActionResult BindDropDowns(string flag, int Id)
        {
            StringBuilder sbOptions = new StringBuilder();

            if (flag == "State")
            {
                List <SelectListDto> lstStateDto = _districtservice.GetDistrictsByStateID(Id);
                foreach (var item in lstStateDto)
                {
                    sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
                }
            }
            else if (flag == "District")
            {
                List <SelectListDto> lstMandalDto = _mandalService.GetMandalByDistrictID(Id);
                foreach (var item in lstMandalDto)
                {
                    sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
                }
            }


            else if (flag == "Mandal")
            {
                List <SelectListDto> lstClusterDto = _clusterService.GetClusterByMandalID(Id);
                foreach (var item in lstClusterDto)
                {
                    sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
                }
                List <EmployeeDto> lstemp = new List <EmployeeDto>();
            }
            else if (flag == "Cluster")
            {
                List <SelectListDto> lstvillageDto = _villageService.GetVillageByClusterID(Id);
                foreach (var item in lstvillageDto)
                {
                    sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
                }
            }
            return(Content(sbOptions.ToString()));
        }
Ejemplo n.º 3
0
        public ActionResult BindDropDowns(string flag, int Id)
        {
            StringBuilder sbOptions = new StringBuilder();

            if (flag == "Cluster")
            {
                List <SelectListDto> lstvillageDto = _villageService.GetVillageByClusterID(Id);
                foreach (var item in lstvillageDto)
                {
                    sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
                }
            }
            else if (flag == "Village")
            {
                List <SelectListDto> lstGroups = _groupService.GetGroupByVillageID(Id);
                foreach (var item in lstGroups)
                {
                    sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
                }
            }
            return(Content(sbOptions.ToString()));
        }