private void frmProduct_Load(object sender, EventArgs e) { try { txtBarcode.MaxLength = 11; //pro.FillAutonumber(1, lblProductId); pro.sql = "Select CategoryId, Category + '[' + CategoryType + ']' as 'CategType' From tblcategory"; pro.FillComboBox(pro.sql, "CategoryId", "CategType", cboCategory); string categoryid = cboCategory.SelectedValue.ToString(); int id = Int32.Parse(categoryid); pro.PassingAutonumberLbl(id, lblProductId); pro.sqlselect = "SELECT ProductId,p.Barcode,ProductName,Description,Category + '[' + CategoryType + ']' as 'Category' ,p.OriginalPrice,MarkupPrice,ProductQty,Unit FROM tblcategory c, tblproduct p WHERE p.CategoryId=c.CategoryId"; pro.LoadData(pro.sqlselect, dtglist); pro.dtgcolor(dtglist, 7); useFunc.clearTxt(this); } catch { } }
private void frmListProducts_Load(object sender, EventArgs e) { prolist.sqlselect = "SELECT p.Barcode,ProductName,Description,Category,p.OriginalPrice,ProductQty,Unit FROM tblcategory c, tblproduct p WHERE p.CategoryId=c.CategoryId"; prolist.LoadData(prolist.sqlselect, dtgList); prolist.dtgcolor(dtgList, 5); }