コード例 #1
0
 private void BtnModify_Click(object sender, EventArgs e)
 {
     if (dgvSearch.SelectedRows.Count > 0)
     {
         if (dgvSearch.CurrentRow.Cells[0].Value == null)
         {
             frmMessageBoxInvalidData frm = new frmMessageBoxInvalidData();
             frm.ShowDialog();
         }
         else
         {
             flag                = false;
             btnNew.Enabled      = false;
             btnDelete.Enabled   = true;
             btnModify.Enabled   = false;
             txtId.Text          = dgvSearch.CurrentRow.Cells[0].Value.ToString();
             txtName.Text        = dgvSearch.CurrentRow.Cells[1].Value.ToString();
             nombreTextoAnterior = dgvSearch.CurrentRow.Cells[1].Value.ToString();
             cboCategory.Text    = cmbSearch.Text;
             cboCategory.Enabled = true;
             cboType.Enabled     = false;
             txtName.Enabled     = true;
             operation           = true;
             btnSave.Enabled     = true;
         }
     }
     else
     {
         frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
         frm2.ShowDialog();
     }
 }
コード例 #2
0
        private void BtnAddTool_Click(object sender, EventArgs e)
        {
            frmTool frm = new frmTool();

            if (dgvSearch.SelectedRows.Count > 0)
            {
                if (dgvSearch.CurrentRow.Cells[0].Value == null)
                {
                    frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
                    frm3.ShowDialog();
                }
                else
                {
                    frm.flag = 2;
                    frm.cboCategory.Enabled   = false;
                    frm.cboFamily.Enabled     = false;
                    frm.cboBrand.Enabled      = false;
                    frm.cboStorehouse.Enabled = false;
                    frm.cboSupplier.Enabled   = false;
                    frm.cboMoney.Enabled      = false;
                    frm.cboWayofPay.Enabled   = false;
                    frm.txtName.Enabled       = false;
                    frm.txtPrice.Enabled      = false;
                    frm.txtCode.Enabled       = true;
                    frm.txtSerie.Enabled      = true;
                    frm.txtId.Enabled         = false;
                    OpenFormPanel(frm);
                }
            }
            else
            {
                frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
                frm2.ShowDialog();
            }
        }
コード例 #3
0
        private void BtnModify_Click(object sender, EventArgs e)
        {
            frmMaterial frm = new frmMaterial();

            if (dgvSearch.SelectedRows.Count > 0)
            {
                if (dgvSearch.CurrentRow.Cells[0].Value == null)
                {
                    frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
                    frm3.ShowDialog();
                }
                else
                {
                    frm.flag = 0;

                    frm.btnDelete.Enabled = true;
                    //Llenamos todos los datos falta ver como capturarlos


                    OpenFormPanel(frm);
                }
            }
            else
            {
                frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
                frm2.ShowDialog();
            }
        }
コード例 #4
0
        private void BtnModify_Click(object sender, EventArgs e)
        {
            frmWorkOrder frm = new frmWorkOrder();

            if (dgvSearch.SelectedRows.Count > 0)
            {
                if (dgvSearch.CurrentRow.Cells[0].Value == null)
                {
                    frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
                    frm3.ShowDialog();
                }
                else
                {
                    frm.txtCodeWorkOrder.Enabled = false;

                    frm.btnEliminarItem.Enabled = false;
                    frm.btnAddMaterial.Enabled  = false;
                    frm.btnAddTool.Enabled      = false;
                    frm.txtDesc.Enabled         = false;
                    frm.dtpFin.Enabled          = false;
                    frm.dtpInicio.Enabled       = false;
                    frm.dgvSearchClient.Enabled = false;
                    frm.dgvItem.Enabled         = false;

                    frm.flag = false;
                    frm.txtCodeWorkOrder.Text = dgvSearch.CurrentRow.Cells[0].Value.ToString();
                    frm.txtDesc.Text          = dgvSearch.CurrentRow.Cells[1].Value.ToString();

                    /*
                     * frm.btnNew.Enabled = false;
                     * frm.btnDelete.Enabled = true;
                     * frm.txtId.Text = dgvSearch.CurrentRow.Cells[0].Value.ToString();
                     * frm.txtName.Text = dgvSearch.CurrentRow.Cells[1].Value.ToString();
                     *
                     * frm.txtAddress.Text = dgvSearch.CurrentRow.Cells[2].Value.ToString();
                     * //Los combo box se rellenan diferente asi no
                     * //frm.cboCity.SelectedValue = dgvSearch.CurrentRow.Cells[3].Value.ToString();
                     *
                     * frm.txtPhone.Text = dgvSearch.CurrentRow.Cells[4].Value.ToString();
                     */

                    OpenFormPanel(frm);
                }
            }
            else
            {
                frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
                frm2.ShowDialog();
            }
        }
コード例 #5
0
        private void BtnModify_Click(object sender, EventArgs e)
        {
            if (dgvSearch.SelectedRows.Count > 0)
            {
                if (dgvSearch.CurrentRow.Cells[0].Value == null)
                {
                    frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
                    frm3.ShowDialog();
                }
                else
                {
                    frmSupplier frm = new frmSupplier();
                    AddOwnedForm(frm);
                    frm.FormBorderStyle = FormBorderStyle.None;
                    frm.TopLevel        = false;
                    frm.Dock            = DockStyle.Fill;
                    this.Controls.Add(frm);
                    this.Tag = frm;
                    frm.BringToFront();

                    frm.flag = false;

                    frm.btnDelete.Enabled = true;
                    frm.txtCode.Text      = dgvSearch.CurrentRow.Cells[0].Value.ToString();
                    frm.txtName.Text      = dgvSearch.CurrentRow.Cells[1].Value.ToString();
                    frm.txtRuc.Text       = dgvSearch.CurrentRow.Cells[2].Value.ToString();
                    frm.txtAddress.Text   = dgvSearch.CurrentRow.Cells[3].Value.ToString();
                    //Los combo box se rellenan diferente asi no
                    //frm.cboCity.SelectedValue = dgvSearch.CurrentRow.Cells[4].Value.ToString();
                    //frm.cboCountry.SelectedValue = dgvSearch.CurrentRow.Cells[5].Value.ToString();
                    frm.txtPhone.Text = dgvSearch.CurrentRow.Cells[5].Value.ToString();
                    frm.txtEmail.Text = dgvSearch.CurrentRow.Cells[6].Value.ToString();

                    frm.cboCountry.Enabled = false;
                    frm.cboCity.Enabled    = false;

                    frm.Show();
                }
            }
            else
            {
                frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
                frm2.ShowDialog();
            }
        }
コード例 #6
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);
             }
         }
     }
 }
コード例 #7
0
 private void BtnA_Click(object sender, EventArgs e)
 {
     if (dgvSearch.SelectedRows.Count > 0)
     {
         if (dgvSearch.CurrentRow.Cells[0].Value == null)
         {
             frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
             frm3.ShowDialog();
         }
         else
         {
             //Se llama al update con el estado finalizado
         }
     }
     else
     {
         frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
         frm2.ShowDialog();
     }
 }
コード例 #8
0
        private void btnAddMaterial_Click(object sender, EventArgs e)
        {
            if (dgvSearch.SelectedRows.Count > 0)
            {
                if (dgvSearch.CurrentRow.Cells[0].Value == null)
                {
                    frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
                    frm3.ShowDialog();
                }
                else
                {
                    frmWorkOrder fm = Owner as frmWorkOrder;
                    //se rellena el grip con magia :v

                    this.Close();
                }
            }
            else
            {
                frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
                frm2.ShowDialog();
            }
        }
コード例 #9
0
        private void BtnAddMaterial_Click(object sender, EventArgs e)
        {
            frmMaterial frm = new frmMaterial();

            if (dgvSearch.SelectedRows.Count > 0)
            {
                if (dgvSearch.CurrentRow.Cells[0].Value == null)
                {
                    frmMessageBoxInvalidData frm3 = new frmMessageBoxInvalidData();
                    frm3.ShowDialog();
                }
                else
                {
                    frm.flag = 2;

                    frm.cboCategory.Enabled    = false;
                    frm.cboFamily.Enabled      = false;
                    frm.cboBrand.Enabled       = false;
                    frm.cboUnit.Enabled        = false;
                    frm.cboSupplier.Enabled    = false;
                    frm.cboMoney.Enabled       = false;
                    frm.txtName.Enabled        = false;
                    frm.txtPrice.Enabled       = false;
                    frm.txtMinQuantity.Enabled = false;
                    // frm.btnDelete.Enabled = true;
                    //Llenamos todos los datos falta ver como capturarlos


                    OpenFormPanel(frm);
                }
            }
            else
            {
                frmMessageBoxSelectRow frm2 = new frmMessageBoxSelectRow();
                frm2.ShowDialog();
            }
        }