private void RefreshList() { List <ProductColorEntity> productColorList = new ProductColorGetService(new ProductColor()).GetsColorEntityData(); txtSearch.Text = string.Empty; int totalRow = productColorList.Count; if (totalRow > 0) { lblTotalRecord.Text = "Total :: " + totalRow; lblTotalRecord.BackColor = System.Drawing.Color.AliceBlue; btnView.Enabled = (totalRow > 0); btnEdit.Enabled = (totalRow > 0); btnDelete.Enabled = (totalRow > 0); } else { lblTotalRecord.Text = "Total :: "; btnView.Enabled = false; btnEdit.Enabled = false; btnDelete.Enabled = false; } RefreshGrid(productColorList); }
private void btnSearch_Click(object sender, EventArgs e) { ProductColor oColor = new ProductColor(); oColor.ColorName = txtSearch.Text; List <ProductColor> colorList = new ProductColorGetService(oColor).GetsColorByColorName(); List <ProductColorEntity> colorEntityList = new ProductColorGetService(oColor).FillColorEntity(colorList); RefreshGrid(colorEntityList); }