public static LoaiThietBiDTO GetLTBById(int id) { LoaiThietBiBUS ltbBus_gltbbi = new LoaiThietBiBUS(); LoaiThietBiDTO loaiThietBiDTO = ltbBus_gltbbi.GetById(id); return(loaiThietBiDTO); }
public List <string> getLoaiThietBi() { LoaiThietBiBUS loaiThietBiBUS = new LoaiThietBiBUS(); DataTable dtLTB = loaiThietBiBUS.GetAll(); List <string> listLoaiThietBi = new List <string>(); foreach (DataRow item in dtLTB.Rows) { listLoaiThietBi.Add(item[1].ToString()); } return(listLoaiThietBi); }
public void getProductType() { LoaiThietBiBUS loaiThietBiBUS = new LoaiThietBiBUS(); DataTable dtLTB = new DataTable(); dtLTB = loaiThietBiBUS.GetAll(); foreach (DataRow row in dtLTB.Rows) { int n = grvProductType.Rows.Add(); grvProductType.Rows[n].Cells[0].Value = row[0].ToString(); grvProductType.Rows[n].Cells[1].Value = row[1].ToString(); } }
private void addProductType(object sender, EventArgs e) { if (txtProductTypeNameInput.Text.ToString() == "") { MessageBox.Show("Không được để trống"); } else { int ProductTypeId = 0; string txtProductTypeName = txtProductTypeNameInput.Text.ToString(); LoaiThietBiDTO thietBiDTO = new LoaiThietBiDTO(ProductTypeId, txtProductTypeName); LoaiThietBiBUS loaiThietBiBUS = new LoaiThietBiBUS(); loaiThietBiBUS.Add(thietBiDTO); txtProductTypeNameInput.Text = ""; grvProductType.Rows.Clear(); getProductType(); } }
private void editProductType(object sender, EventArgs e) { if (txtEditProductType.Text.ToString() == "") { MessageBox.Show("Không được để trống"); } else { int id = Convert.ToInt32(lblProductTypeId.Text.ToString()); string typename = txtEditProductType.Text.ToString(); LoaiThietBiDTO thietBiDTO = new LoaiThietBiDTO(id, typename); LoaiThietBiBUS loaiThietBiBUS = new LoaiThietBiBUS(); loaiThietBiBUS.Edit(thietBiDTO); txtProductTypeNameInput.Text = ""; grvProductType.Rows.Clear(); getProductType(); } }