private void Form2_Load(object sender, EventArgs e) { Mpanel.Hide(); Hided = true; setDataGride(); setDataGride2(); }
private void frm_purchase_Load(object sender, EventArgs e) { Mpanel.Hide(); Hided = true; try { DateTime dta = DateTime.Today; txt_Date.Text = dta.ToString(); ld(); } catch (Exception) { } }
private void frm_product_Load(object sender, EventArgs e) { Mpanel.Hide(); Hided = true; try { DateTime dt = DateTime.Today; txt_date.Text = dt.ToString(); cmd = new SqlCommand(); conDB.con.Open(); int cid = 0; cmd.Connection = conDB.con; cmd.CommandText = "SELECT OrderID FROM tbl_Orders "; SqlDataReader dr; dr = cmd.ExecuteReader(); while (dr.Read()) { cid = Convert.ToInt32(dr.GetValue(0)); cmb_oid.Items.Add(cid); cmb_ioid.Items.Add(cid); } dr.Close(); cmd.Dispose(); conDB.con.Close(); load(); load_pid(); } catch (SqlException) { MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception) { MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frm_sales_order_Load(object sender, EventArgs e) { Mpanel.Hide(); Hided = true; load(); try { DateTime dta = DateTime.Today; textBox1.Text = dta.ToString(); cmd = new SqlCommand(); conDB.con.Open(); String cfname; cmd.Connection = conDB.con; cmd.CommandText = "SELECT cfname FROM tbl_customer "; SqlDataReader dr; dr = cmd.ExecuteReader(); while (dr.Read()) { cfname = (dr.GetString(0)); cmb_fnme.Items.Add(cfname); } dr.Close(); cmd.Dispose(); conDB.con.Close(); } catch (SqlException) { MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception) { MessageBox.Show(this, "Error ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }