public ActionResult CreateMandal(MandalModel objMandal)
        {
            var resultDto = new ResultDto();
            if (ModelState.IsValid)
            {
                var mandalDto = Mapper.Map<MandalModel, MandalDto>(objMandal);
                mandalDto.UserID = UserInfo.UserID;
                if (mandalDto.MandalID == 0)
                    resultDto = _mandalService.Insert(mandalDto);
                else
                    resultDto = _mandalService.Update(mandalDto);
                if (resultDto.ObjectId > 0)
                {
                    mandalDto = _mandalService.GetByID(resultDto.ObjectId);
                    objMandal = Mapper.Map<MandalDto, MandalModel>(mandalDto);
                    resultDto.ObjectCode = mandalDto.MandalCode;
                }
            }
            var stateSelectListDto = _stateService.GetStateSelectList();
            var stateSelectList = new SelectList(stateSelectListDto, "ID", "Text");
            ViewBag.States = stateSelectList;

            var districtSelectListDto = _districtService.GetDistrictSelectList();
            var districtSelectList = new SelectList(districtSelectListDto, "ID", "Text");
            ViewBag.Districts = districtSelectList;

            ViewBag.Result = resultDto;

            return View(objMandal);
        }
        public ActionResult CreateMandal(string id)
        {
            //int mandalId = DecryptQueryString(id);
            int mandalId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString());

            var mandalDto = new MandalDto();
            var mandalModel = new MandalModel();

            var stateSelectListDto = _stateService.GetStateSelectList();
            var stateSelectList = new SelectList(stateSelectListDto, "ID", "Text");
            ViewBag.States = stateSelectList;

            var districtSelectListDto = _districtService.GetDistrictSelectList();
            var districtSelectList = new SelectList(districtSelectListDto, "ID", "Text");
            ViewBag.Districts = districtSelectList;

            if (mandalId > 0)
            {
                mandalDto = _mandalService.GetByID(mandalId);
                mandalModel = Mapper.Map<MandalDto, MandalModel>(mandalDto);
            }

            ViewBag.Result = new ResultDto();
            return View(mandalModel);
        }