Example #1
0
        private void Open_Customer_Load(object sender, EventArgs e)
        {
            con.Open();
            dataGridView1.Rows.Clear();
            Dt             = new DataTable();
            com            = new SqlCommand("select company_name,contact_person,phone_puplic,sales_person,custmer_group,blance from customer");
            com.Connection = con;
            adapt          = new SqlDataAdapter(com);
            adapt.Fill(Dt);

            // dataGridView1.DataSource = Dt;

            for (int i = 0; i < Dt.Rows.Count; i++)
            {
                dataGridView1.Rows.Add(Dt.Rows[i][0], Dt.Rows[i][1], Dt.Rows[i][2], Dt.Rows[i][3], Dt.Rows[i][4], Dt.Rows[i][5]);
            }
            con.Close();


            ado_project f = new ado_project();

            dt = f.combo_opencust();

            dr    = dt.NewRow();
            dr[0] = "All";
            dt.Rows.Add(dr);

            comboBox1.DataSource    = dt;
            comboBox1.DisplayMember = dt.Columns[0].ToString();

            Open_Customer op = new Open_Customer();

            op.Refresh();
        }
Example #2
0
        private void update_customer_Load(object sender, EventArgs e)
        {
            ado_project f  = new ado_project();
            DataTable   dt = f.combo_opencust();

            comboBox6.DataSource    = dt;
            comboBox6.DisplayMember = dt.Columns[0].ToString();


            con.Open();
            SqlCommand    com = new SqlCommand("select company_name,contact_person,address,phone_primary,phone_puplic,e_mail,card_num,card_verification_num,card_type,expiration_month,expiration_year,cardholder_name,shipping_address,sales_person,customer_notes,custmer_group,blance from customer where customer_id='" + value + "'", con);
            SqlDataReader dr  = com.ExecuteReader();

            if (dr.Read())
            {
                textBox1.Text       = dr[0].ToString();
                textBox2.Text       = dr[1].ToString();
                textBox3.Text       = dr[2].ToString();
                maskedTextBox1.Text = dr[3].ToString();
                maskedTextBox2.Text = dr[4].ToString();
                textBox4.Text       = dr[5].ToString();
                maskedTextBox3.Text = dr[6].ToString();
                maskedTextBox4.Text = dr[7].ToString();
                comboBox1.Text      = dr[8].ToString();
                comboBox2.Text      = dr[9].ToString();
                comboBox3.Text      = dr[10].ToString();
                textBox5.Text       = dr[11].ToString();

                textBox6.Text       = dr[12].ToString();
                textBox7.Text       = dr[13].ToString();
                textBox8.Text       = dr[14].ToString();
                comboBox6.Text      = dr[15].ToString();
                maskedTextBox5.Text = dr[16].ToString();
            }
            dr.Close();
            con.Close();
        }
Example #3
0
        private void Customer_Load(object sender, EventArgs e)
        {
            ado_project f  = new ado_project();
            DataTable   dt = f.combo_opencust();

            comboBox6.DataSource    = dt;
            comboBox6.DisplayMember = dt.Columns[0].ToString();
            //if (checkBox1.Checked == true)
            //{
            //    maskedTextBox3.Text = "";
            //    maskedTextBox4.Text = "";
            //    comboBox1.Text = "";
            //    comboBox2.Text = "";
            //    comboBox3.Text = "";
            //    textBox5.Text = "";
            //    maskedTextBox3.Enabled = false;
            //    maskedTextBox4.Enabled = false;
            //    comboBox1.Enabled = false;
            //    comboBox2.Enabled = false;
            //    comboBox3.Enabled = false;
            //    textBox5.Enabled = false;

            //}
        }