示例#1
0
 private void btnEliminarItem_Click(object sender, EventArgs e)
 {
     if (dgvItem.SelectedRows.Count > 0)
     {
         if (dgvItem.CurrentRow.Cells[0].Value == null)
         {
             frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
             frm3.ShowDialog();
         }
         else
         {
             frmMessageBoxDelete frm = new frmMessageBoxDelete();
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 dgvItem.Rows.RemoveAt(dgvItem.CurrentRow.Index);
             }
         }
     }
 }
示例#2
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtId.Text))
     {
         frmMessageBoxFillNull frm = new frmMessageBoxFillNull();
         frm.ShowDialog();
     }
     else
     {
         frmMessageBoxDelete frm = new frmMessageBoxDelete();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             //   int id = Int32.Parse(txtId.Text);
             //String name = txtName.Text;
             ////Category cat = new category(name,0);
             //Se llama al delete
             reiniciar();
         }
     }
 }
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtId.Text))
     {
         frmMessageBoxFillNull frm = new frmMessageBoxFillNull();
         frm.ShowDialog();
     }
     else
     {
         frmMessageBoxDelete frm = new frmMessageBoxDelete();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             int id     = Int32.Parse(txtId.Text);
             int result = serviceDA.deleteMeasure_unit(id);
             dgvSearch.AutoGenerateColumns = false;
             dgvSearch.DataSource          = serviceDA.queryAllMeasurement_Unit();
             reiniciar();
             btnModify.Enabled = true;
         }
     }
 }
示例#4
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtId.Text))
     {
         frmMessageBoxFillNull frm = new frmMessageBoxFillNull();
         frm.ShowDialog();
     }
     else
     {
         frmMessageBoxDelete frm = new frmMessageBoxDelete();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             int id = int.Parse(txtId.Text);
             serviceDA.deleteStorehouse(id);
             frmSearchStoreHouse fm = Owner as frmSearchStoreHouse;
             fm.dgvSearch.AutoGenerateColumns = false;
             fm.dgvSearch.DataSource          = "";
             this.Close();
         }
     }
 }
示例#5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtCode.Text))
            {
                frmMessageBoxFillNull frm = new frmMessageBoxFillNull();
                frm.ShowDialog();
            }
            else
            {
                frmMessageBoxDelete frm = new frmMessageBoxDelete();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    String cod = txtCode.Text;
                    serviceDA.deleteEmployee(cod);
                    frmSearchUser fm = Owner as frmSearchUser;
                    fm.dgvSearch.AutoGenerateColumns = false;
                    fm.dgvSearch.DataSource          = serviceDA.queryAllEmployee();

                    this.Close();
                }
            }
        }
示例#6
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtId.Text) || String.IsNullOrEmpty(cboCategory.Text))
     {
         frmMessageBoxFillNull frm = new frmMessageBoxFillNull();
         frm.ShowDialog();
     }
     else
     {
         frmMessageBoxDelete frm = new frmMessageBoxDelete();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             int    id     = Int32.Parse(txtId.Text);
             String name   = txtName.Text;
             int    result = serviceDA.deleteFamily(id);
             dgvSearch.AutoGenerateColumns = false;
             AlmacenDisecWS.category c = (AlmacenDisecWS.category)cboCategory.SelectedItem;
             dgvSearch.DataSource = serviceDA.queryAllFamily(c.category_id);
             reiniciar();
             btnModify.Enabled = true;
         }
     }
 }