public IEnumerable <DIC_DICHVU> GetAllDichVu2(PhanLoaiDichVu phanloai) { if (!string.IsNullOrEmpty(this.StoreGetAll) && !string.IsNullOrWhiteSpace(this.StoreGetAll)) { this.CreateConnection(); try { using (IDbConnection dbConnection = new SqlConnection(this.sqlHelper.ConnectionString)) { DynamicParameters parameter = new DynamicParameters(); parameter.Add("@LoaiDichVu", (int)phanloai, DbType.Int32, ParameterDirection.Input); IEnumerable <DIC_DICHVU> dichvus = dbConnection.Query <DIC_DICHVU>(this.StoreGetAll, parameter, null, true, null, CommandType.StoredProcedure).ToList(); return(dichvus); } } catch (Exception e) { this.sqlHelper.Close(); log.Error(string.Format("GetAll DICH VU(phanloai:{0})", (int)phanloai), e); return(null); } } else { return(null); } }
public IEnumerable <DIC_DICHVU> GetAllDichVu(PhanLoaiDichVu phanloai) { if (!string.IsNullOrEmpty(this.StoreGetAll) && !string.IsNullOrWhiteSpace(this.StoreGetAll)) { try { this.CreateConnection(); this.sqlHelper.CommandType = CommandType.StoredProcedure; SqlDataReader dt = this.sqlHelper.ExecuteReader(this.StoreGetAll, new string[] { "@LoaiDichVu" }, new object[] { (int)phanloai }); return(this.DataReaderToList(dt)); } catch (Exception e) { this.sqlHelper.Close(); log.Error(string.Format("GetAll DICH VU(phanloai:{0})", (int)phanloai), e); return(null); } } else { return(null); } }
public TrongDanhMuc(PhanLoaiDichVu _loai) { loaiDichVu = _loai; }
public TrongDanhMuc() { loaiDichVu = PhanLoaiDichVu.DichVu; }