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 clearProduct() { txtProduct.Clear(); txtDescription.Clear(); txtPrice.Clear(); txtMarkupPrice.Clear(); pro.sql = "Select CategoryId,Category + '[' + CategoryType + ']' as 'Category' From tblcategory"; pro.FillComboBox(pro.sql, "CategoryId", "Category", cboCategory); string categoryid = cboCategory.SelectedValue.ToString(); int id = Int32.Parse(categoryid); pro.PassingAutonumberLbl(id, lblProductId); }