// GET: Gasstation public ActionResult Add() { ViewBag.listDistrist = _districtRepository.GetAll().OrderBy(x => x.DistrictName); ViewBag.listGasType = _mTpyeRepository.GetAll().Where(x => x.TypeType == 3).ToList(); ViewBag.ratingList = _mTpyeRepository.GetAll().Where(x => x.TypeType == 4).ToList(); return(View()); }
// GET: Admin/Client/Create public ActionResult Create() { var _list = _districtRepository.GetAll(); ViewBag.DistrictId = new SelectList(_list, "DistrictId", "Name"); return(View()); }
public ActionResult Index() { ViewBag.listDistrist = _districtRepository.GetAll().OrderBy(x => x.DistrictName); ViewBag.listGasType = _mTypeRepository.GetAll().Where(x => x.TypeType == 3).ToList(); ViewBag.pageCount = _gasStationRepository.GetAll().Count(); return(View()); }
public bool ContainWith(District entity, bool isDelete = false) { var result = _repo.GetAll().Where(d => d.Name.ToUpper() == entity.Name.ToUpper() && d.CityID == entity.CityID && d.IsDelete == isDelete); return(result.SingleOrDefault() != null); }
// GET: Admin/Jobs/Create public ActionResult Create() { var _districts = _districtRepository.GetAll(); ViewBag.DistrictId = new SelectList(_districts, "DistrictId", "Name"); var _clients = _clientRepository.GetAll(); ViewBag.ClientId = new SelectList(_clients, "CLientId", "Name"); return(View()); }
public ActionResult NewRegistration(int districtId = 0) { var _list = _districtRepository.GetAll(); ViewBag.DistrictId = new SelectList(_list, "DistrictId", "Name"); ViewBag.DistrictId1 = new SelectList(_list, "DistrictId", "Name"); ViewBag.DistrictId2 = new SelectList(_list, "DistrictId", "Name"); ViewBag.DistrictId3 = new SelectList(_list, "DistrictId", "Name"); ViewBag.DistrictId4 = new SelectList(_list, "DistrictId", "Name"); ViewBag.DistrictId5 = new SelectList(_list, "DistrictId", "Name"); var _blocks = _blockRepository.GetAll(); if (districtId == 0) { ViewBag.BlockId = new SelectList(_blocks, "BlockId", "Name"); } else { ViewBag.BlockId = new SelectList(_blocks.Where(b => b.DistrictId == districtId), "BlockId", "Name"); } var _posts = _postRepository.GetAll().OrderBy(c => c.Code).ThenBy(c => c.Name); ViewBag.PostId = new SelectList(_posts, "PostId", "Name"); var model = new Registration(); model.ViiiMm = 0; model.ViiiMo = 0; model.ViiiYear = "N/A"; model.Hsmm = 0; model.Hsmo = 0; model.Hsyear = "N/A"; model.Immm = 0; model.Immo = 0; model.ImYear = "N/A"; model.GrMm = 0; model.GrMo = 0; model.GrYear = "N/A"; model.GrSubject = "N/A"; model.PgMm = 0; model.PgMo = 0; model.PgYear = "N/A"; model.PgSubject = "N/A"; model.OtherSubject = "N/A"; model.OtherMm = 0; model.OtherMo = 0; model.OtherYear = "N/A"; return(View(model)); }
// GET: Admin/Block public ActionResult Index(int?districtId) { var _list = _districtRepository.GetAll(); ViewBag.DistrictId = new SelectList(_list, "DistrictId", "Name"); IEnumerable <Block> blocks; if (districtId == null) { districtId = _list.FirstOrDefault().DistrictId; } blocks = _blockRepository.GetAll().Where(b => b.DistrictId == districtId); return(View(blocks)); }
public ActionResult Index(int?page) { int pageSize = 10; int pageNumber = (page ?? 1); return(View(_districtRep.GetAll().OrderBy(x => x.Name).ToPagedList(pageNumber, pageSize))); }
private void btnGetDistrict_Click(object sender, EventArgs e) { var districtList = _districtRepository.GetAll(); var search = txtSearchDistrict.Text; if (string.IsNullOrEmpty(search)) { grdDistrict.DataSource = districtList; } else { search = search.ToLower(); //grdDistrict.DataSource = districtList.Where(x => x.Name.ToLower().Contains(search)|| x.Code.Contains(search)).ToList(); grdDistrict.DataSource = districtList.Where(x => x.Name.ContainsByStringComparison(search, StringComparison.OrdinalIgnoreCase) || x.Code.Contains(search)).ToList(); } //districtList.Select(x => x.CityCode).Count(); }
public List <DistrictViewModel> GetDistrictInformations(string keyword, string cityCode) { var allDistricts = _districtRepository.GetAll(); var allCities = _cityRepository.GetAll(); var query = from d in allDistricts join c in allCities on d.CityCode equals c.Code select new DistrictViewModel { DistrictCode = d.Code, DistrictName = d.Name, CityCode = c.Code, CityName = c.Name }; if (!string.IsNullOrEmpty(keyword)) { keyword = keyword.ToLower(); query = query.Where(a => a.DistrictCode.ToLower().Contains(keyword) || a.DistrictName.ToLower().Contains(keyword)); } if (!string.IsNullOrEmpty(cityCode)) { query = query.Where(a => a.CityCode.Contains(cityCode)); } return(query.ToList()); }
public IEnumerable <District> GetAllDistrict() { List <District> lstdistrict = new List <District>(); try { lstdistrict = _districtRepository.GetAll().ToList(); } catch (Exception ex) { string FunctionName = string.Format("GetAllDistrict('{0}')"); Common.Logs.LogCommon.WriteError(ex.ToString(), FunctionName); return(null); } return(lstdistrict); }
// GET: Rents/Create public ActionResult Create(int?id) { if (id == null) { var nullCar = new Car() { Car_ID = 0, Model = "Select Car" }; ViewBag.CurentCar = nullCar; } else { ViewBag.CurentCar = _carRep.GetAll().Where(i => i.Car_ID == id).FirstOrDefault(); ViewBag.CarInfo = _carRep.GetById((int)id); } var c = _districtRep.GetAll(); ViewBag.Car = _carRep.GetAll(); ViewBag.District = c; return(View()); }
public async Task <BaseResponse <IEnumerable <DistrictDto> > > GetAll() { BaseResponse <IEnumerable <DistrictDto> > baseResponse = new BaseResponse <IEnumerable <DistrictDto> >(); string key = RedisConsts.District + DateTime.Now.ToString("yyyyMMdd_hh"); var keyExists = await _redisCacheService.Contains(key); if (keyExists) { var recordsInCache = _redisCacheService.Get <IEnumerable <DistrictDto> >(key); baseResponse.IsSuccess = true; baseResponse.TimeStamp = DateTime.Now; baseResponse.Result = recordsInCache; } else { var result = await _districtRepository.GetAll(); var mappedResult = _mapper.Map <IEnumerable <DistrictDto> >(result); baseResponse.Result = mappedResult; _redisCacheService.SetAsync <IEnumerable <DistrictDto> >(key, mappedResult); } //await _redisCacheService.Clear(); return(baseResponse); }
public IEnumerable <District> GetAll() { var entities = repository.GetAll(); return(entities); }
// GET: District public async Task <ActionResult> Index() { var Districts = await _District.GetAll(); return(View(Districts)); }
public IEnumerable <District> GetAll() => _districtRepository.GetAll();
public IEnumerable <District> getalldistricts() { var districts = _districtrepository.GetAll(); return(districts); }
// GET: Admin/District public ActionResult Index() { var districts = _districtRepo.GetAll(); return(View(districts)); }
public IEnumerable <District> GetAllDistrict() { return(districtRepository.GetAll()); }
public ActionResult Create() { ViewBag.District = _districtRep.GetAll().ToList(); return(View()); }