public static LoaiThietBiDTO GetLTBById(int id) { LoaiThietBiBUS ltbBus_gltbbi = new LoaiThietBiBUS(); LoaiThietBiDTO loaiThietBiDTO = ltbBus_gltbbi.GetById(id); return(loaiThietBiDTO); }
protected void Page_Load(object sender, EventArgs e) { DataTable tb = tbBus.GetAll(); //DataTable ltb = ltbBus.GetAll(); //DataTable kh = khBus.GetByContact(); //slcType.Items.Clear(); //foreach (DataRow ltb_row in ltb.Rows) //{ // string text = ltb_row.ItemArray[1].ToString(); // string val = ltb_row.ItemArray[0].ToString(); // slcType.Items.Add(new ListItem(text, val)); //} foreach (DataRow row in tb.Rows) { HtmlTableRow row2 = new HtmlTableRow(); string isDisable = ""; if (row.ItemArray[4].ToString() == "0") { isDisable = "disabled"; } foreach (var item in row.ItemArray) { var cell = new HtmlTableCell(); //var loai = this. cell.InnerText = item.ToString(); if (row2.Cells.Count == 0) { cell.InnerHtml = "<input type='checkbox' runat='server' ID='chkSelected' value='" + item + "' " + isDisable + " />"; } if (row2.Cells.Count == 2) { LoaiThietBiDTO loaiThietBiDTO = ltbBus.GetById(Convert.ToInt32(item)); cell.InnerText = loaiThietBiDTO.TypeName; } row2.Cells.Add(cell); } tbl_ThietBi.Controls.Add(row2); } //MaintainScrollPositionOnPostBack = false; //findKH.Attributes.Add("AutoPostback", "false"); //btnFindKH.Attributes.Add("onclick", "return false"); }
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(); } }
public void Edit(LoaiThietBiDTO loaiThietBiDTO) { a.Edit(loaiThietBiDTO); }
public void Add(LoaiThietBiDTO loaiThietBiDTO) { a.Add(loaiThietBiDTO); }