public async Task <IActionResult> UpdateQuanHuyen(int id, [FromBody] QuanHuyenDTO quanHuyenDTO) { var quanHuyen = quanHuyenDTO.ToEntity(); await _quanHuyenService.UpdateQuanHuyen(quanHuyen); return(Ok(quanHuyen)); }
public async Task <IActionResult> CreateQuanHuyen(QuanHuyenDTO quanHuyenDTO) { var quanHuyen = quanHuyenDTO.ToEntity(); await _quanHuyenService.CreateQuanHuyen(quanHuyen); return(Ok(quanHuyen)); }
public async Task <IActionResult> GetQuanHuyenById(int id) { var quanHuyen = await _quanHuyenService.GetQuanHuyenById(id); var result = QuanHuyenDTO.FromEntity(quanHuyen); return(Ok(result)); }
public QuanHuyenDTO createQuanHuyenFromReader(IDataReader iReader) { QuanHuyenDTO p = new QuanHuyenDTO(); p.MaQuanHuyen = Convert.ToInt32(iReader[_fileds[0]]); p.TenQuanHuyen = iReader[_fileds[1]].ToString(); return(p); }
public QuanHuyenDTO getQuanHuyenInDulieu(int id) { QuanHuyenDTO dv = new QuanHuyenDTO(); IDataReader _iReader = base.get(id); if (_iReader.Read()) { dv = createQuanHuyenFromReader(_iReader); } _iReader.Close(); return(dv); }