Пример #1
0
 public Client()
 {
     InitializeComponent();
     try
     {
         dgv.DataSource = data.GetData("GetAllClient", null);
         txtTotal.Text  = dgv.RowCount.ToString();
     }
     catch
     {
         return;
     }
 }
Пример #2
0
        private void BtnNew_Click(object sender, EventArgs e)
        {
            int ind = dataGridView1.Rows.Count - 1;

            bmb.AddNew();
            try
            {
                foreach (var c in groupBox1.Controls)
                {
                    if (c is TextBox)
                    {
                        var text = (TextBox)c;
                        text.Text      = "-";
                        text.ForeColor = Color.DarkGray;
                        text.TextAlign = HorizontalAlignment.Center;
                    }
                }
                txtId.ForeColor    = Color.Black;
                txtId.Text         = (Convert.ToInt32(dataGridView1.Rows[ind].Cells[0].Value) + 1).ToString();
                txtId.Text         = data.GetData("getProviderId", null).Rows[0][0].ToString();
                btn_add.Enabled    = true;
                btnNew.Enabled     = false;
                lblPos.Text        = bmb.Position + 1 + "/" + bmb.Count;
                txtNomF.Text       = "-";
                txtNomF.ForeColor  = Color.DarkGray;
                txtTele1.Text      = "-";
                txtTele1.ForeColor = Color.DarkGray;
                txtTele2.Text      = "-";
                txtTele2.ForeColor = Color.DarkGray;
                txtEmail.Text      = "-";
                txtEmail.ForeColor = Color.DarkGray;
            }
            catch
            {
                txtId.Text         = data.GetData("getProviderId", null).Rows[0][0].ToString();
                btn_add.Enabled    = true;
                btnNew.Enabled     = false;
                lblPos.Text        = bmb.Position + 1 + "/" + bmb.Count;
                txtNomF.Text       = "-";
                txtNomF.ForeColor  = Color.DarkGray;
                txtTele1.Text      = "-";
                txtTele1.ForeColor = Color.DarkGray;
                txtTele2.Text      = "-";
                txtTele2.ForeColor = Color.DarkGray;
                txtEmail.Text      = "-";
                txtEmail.ForeColor = Color.DarkGray;
                return;
            }
        }
Пример #3
0
 DataTable getSource(int numO)
 {
     SqlParameter[] param = new SqlParameter[1];
     param[0]       = new SqlParameter("@NumOS", SqlDbType.Int);
     param[0].Value = numO;
     return(data.GetData("PrintOrder", param));
 }
Пример #4
0
 public Product()
 {
     InitializeComponent();
     try
     {
         cbCat.DataSource    = prd.GetAllCat();
         cbCat.DisplayMember = "DescCat";
         cbCat.ValueMember   = "IdCat";
         txtId.Text          = data.GetData("getIDPRod", null).Rows[0][0].ToString();
     }
     catch
     {
         return;
     }
 }
Пример #5
0
 private void Btn_new_Click(object sender, EventArgs e)
 {
     btn_add.Enabled = true;
     btn_new.Enabled = false;
     //prepare for write new sale
     dt.Rows.Clear();
     dgv_detaills.DataSource = dt;
     txtSum.Text             = "0";
     txtAv.Text              = "0";
     txtRes.Text             = "0";
     txtId.Text              = clt.getId().ToString();
     btn_add.Enabled         = true;
     btn_new.Enabled         = false;
     rb_false.Checked        = true;
     comboBox1.SelectedIndex = 0;
     //get number of order
     txtNumOS.Text = GetMatricule(data.GetData("getLastIdOS", null).Rows[0][0].ToString());
 }
Пример #6
0
 public DataTable GetAllCat()
 {
     return(data.GetData("GetAllCat", null));
 }
Пример #7
0
 private void Btn_new_Click(object sender, EventArgs e)
 {
     txtNumOB.Text   = GetMatricule(data.GetData("getNumOB", null).Rows[0][0].ToString());
     btn_new.Enabled = false;
     btn_add.Enabled = true;
 }