public FRM_ProductUpdateDet(string s) { ProductId = int.Parse(s); InitializeComponent(); DataTable dtCat = ClassSetting.sp_allCategory(); cmbCategory.DataSource = dtCat; cmbCategory.DisplayMember = "catogary_name"; cmbCategory.ValueMember = "catogary_id"; DataTable dttype = ClassSetting.sp_allTypys(); cmbType.DataSource = dttype; cmbType.DisplayMember = "typePro_name"; cmbType.ValueMember = "typePro_id"; DataTable dtcolor = ClassSetting.sp_allColors(); cmbColor.DataSource = dtcolor; cmbColor.DisplayMember = "colorPro_name"; cmbColor.ValueMember = "colorPro_id"; DataTable ProductDet = ClassManagment.selectOneProduct(ProductId); cmbCategory.Text = ProductDet.Rows[0][0].ToString(); txtname.Text = ProductDet.Rows[0][1].ToString(); txtBarcode.Text = ProductDet.Rows[0][2].ToString(); cmbType.Text = ProductDet.Rows[0][3].ToString(); cmbColor.Text = ProductDet.Rows[0][4].ToString(); }
public FRM_AddProduct() { InitializeComponent(); DataTable dtCat = ClassSetting.sp_allCategory(); cmbCategory.DataSource = dtCat; cmbCategory.DisplayMember = "catogary_name"; cmbCategory.ValueMember = "catogary_id"; DataTable dttype = ClassSetting.sp_allTypys(); cmbType.DataSource = dttype; cmbType.DisplayMember = "typePro_name"; cmbType.ValueMember = "typePro_id"; DataTable dtcolor = ClassSetting.sp_allColors(); cmbColor.DataSource = dtcolor; cmbColor.DisplayMember = "colorPro_name"; cmbColor.ValueMember = "colorPro_id"; }
void display() { dgvCategory.DataSource = ClassSetting.sp_allCategory(); }