private void LoadBreeder() { var coll = BreederController.GetAllBreeders(); cboBreeder.DisplayMember = "BreederName"; cboBreeder.ValueMember = "BreederCode"; cboBreeder.DataSource = coll; }
private void Populate() { DataTable coll = BreederController.GetAllBreeders(TxtFilter.Text.Trim()); gv.DataSource = coll; gv.Columns[ConstColumns.BREEDER_CODE].HeaderText = "รหัสสายพันธุ์"; gv.Columns[ConstColumns.BREEDER_NAME].HeaderText = "ชื่อสายพันธุ์"; gv.Columns[ConstColumns.ACTIVE].HeaderText = "ใช้งาน"; gv.Columns[ConstColumns.CREATE_AT].HeaderText = "วันเวลาสร้าง"; gv.Columns[ConstColumns.CREATE_BY].HeaderText = "ผู้สร้าง"; gv.Columns[ConstColumns.MODIFIED_AT].HeaderText = "วันเวลาแก้ไข"; gv.Columns[ConstColumns.MODIFIED_BY].HeaderText = "ผู้แก้ไข"; gv.Columns[ConstColumns.BREEDER_CODE].Visible = false; gv.Columns[ConstColumns.CREATE_AT].DefaultCellStyle.Format = "dd/MM/yyyy HH:mm:ss"; gv.Columns[ConstColumns.MODIFIED_AT].DefaultCellStyle.Format = "dd/MM/yyyy HH:mm:ss"; }