private void chkActBat_CheckedChanged(object sender, EventArgs e)
 {
     if (chkActBat.Checked)
     {
         cmbBattalion.Enabled = true;
         if (code == "B")
         {
             DataTable dt = ClassQuotation.sp_fillBattQout((int)cmbBrigade.SelectedValue);
             cmbBattalion.DataSource    = dt;
             cmbBattalion.DisplayMember = "Battalions_name";
             cmbBattalion.ValueMember   = "Battalions_id";
         }
         if (code == "R")
         {
             DataTable dt = ClassRegiments.sp_FillSecondLRegQ((int)cmbBrigade.SelectedValue);
             cmbBattalion.DataSource    = dt;
             cmbBattalion.DisplayMember = "Name";
             cmbBattalion.ValueMember   = "ID";
         }
     }
     else
     {
         cmbBattalion.Enabled = false;
     }
 }
Exemplo n.º 2
0
        void fillcombo()
        {
            DataTable dt = ClassRegiments.sp_allRegiment();

            cmbRegiment.DataSource    = dt;
            cmbRegiment.ValueMember   = "ID";
            cmbRegiment.DisplayMember = "Name";
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtNameR.Text.Equals(""))
     {
         MessageBox.Show("Please Fill Fields");
     }
     else
     {
         int i = ClassRegiments.sp_addnewRegiment(txtNameR.Text, rtxtDesc.Text);
         MessageBox.Show("Done");
         txtNameR.Text = rtxtDesc.Text = "";
     }
 }
Exemplo n.º 4
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Equals(""))
     {
         MessageBox.Show("Please Fill Fields.");
     }
     else
     {
         int i = ClassRegiments.sp_newSarayaR(txtName.Text, rtxtDescrip.Text, (int)cmbRegiment.SelectedValue);
         MessageBox.Show("Done");
         txtName.Text = rtxtDescrip.Text = "";
     }
 }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (txtid.Text.Equals(""))
     {
         MessageBox.Show("Select One Please.");
     }
     else
     {
         int i = ClassRegiments.sp_deleteSarayaR(int.Parse(txtid.Text));
         MessageBox.Show("Done");
         txtid.Text = txtname.Text = txtRegName.Text = rtxtDescrip.Text = "";
         display();
     }
 }
Exemplo n.º 6
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (txtid.Text.Equals("") || txtname.Text.Equals(""))
     {
         MessageBox.Show("Please Select one.");
     }
     else
     {
         int i = ClassRegiments.sp_updateRegiment(int.Parse(txtid.Text), txtname.Text, rtxtDescrip.Text);
         MessageBox.Show("Done");
         txtid.Text = txtname.Text = rtxtDescrip.Text = "";
         display();
     }
 }
 private void txtSearch_TextChanged(object sender, EventArgs e)
 {
     dgvSaraya.DataSource = ClassRegiments.sp_SearchSarayaR(txtSearch.Text);
 }
 void display()
 {
     dgvSaraya.DataSource = ClassRegiments.sp_allSarayaR();
 }
Exemplo n.º 9
0
 private void txtSearch_TextChanged(object sender, EventArgs e)
 {
     dgvRegiment.DataSource = ClassRegiments.sp_searchRegiment(txtSearch.Text);
 }
Exemplo n.º 10
0
 void display()
 {
     dgvRegiment.DataSource = ClassRegiments.sp_allRegiment();
 }