コード例 #1
0
 private void btnEditar_Click(object sender, EventArgs e)
 {
     if (GridCompraProducto.SelectedRows.Count == 1)
     {
         FormMantCompras hijo = new FormMantCompras();
         AddOwnedForm(hijo);
         hijo.IsInsert        = false;
         hijo.FormBorderStyle = FormBorderStyle.None;
         hijo.TopLevel        = false;
         hijo.Dock            = DockStyle.Fill;
         hijo.Top             = (this.Height / 2) - (hijo.Height / 2);
         hijo.Left            = (this.Width / 2) - (hijo.Width / 2);
         hijo.FormClosed     += new FormClosedEventHandler(Form_Closed);
         hijo.ControlBox      = false;
         this.Controls.Add(hijo);
         this.Tag = hijo;
         hijo.BringToFront();
         hijo.txtid.Text          = GridCompraProducto.CurrentRow.Cells[0].Value.ToString();
         hijo.txtDescripcion.Text = GridCompraProducto.CurrentRow.Cells[3].Value.ToString();
         hijo.fecha.Value         = DateTime.Parse(GridCompraProducto.CurrentRow.Cells[1].Value.ToString());
         hijo.Show();
     }
     else
     {
         MessageBox.Show("seleccione una fila por favor");
     }
 }
コード例 #2
0
 private void GridCuenta_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (GridProductos.SelectedRows.Count == 1)
     {
         if (acc.Equals("Facturacion"))
         {
             FormMantFactura frm = Owner as FormMantFactura;
             frm.id          = GridProductos.CurrentRow.Cells[0].Value.ToString();
             frm.descripcion = GridProductos.CurrentRow.Cells[2].Value.ToString();
             frm.unidad      = GridProductos.CurrentRow.Cells[5].Value.ToString();
             frm.categoria   = GridProductos.CurrentRow.Cells[4].Value.ToString();
             frm.precioPro   = float.Parse(GridProductos.CurrentRow.Cells[3].Value.ToString());
             frm.stockIn     = float.Parse(GridProductos.CurrentRow.Cells[8].Value.ToString());
             frm.minimo      = float.Parse(GridProductos.CurrentRow.Cells[9].Value.ToString());
             frm.DGData();
             this.Close();
         }
         else
         {
             FormMantCompras frm = Owner as FormMantCompras;
             frm.id          = GridProductos.CurrentRow.Cells[0].Value.ToString();
             frm.descripcion = GridProductos.CurrentRow.Cells[2].Value.ToString();
             frm.unidad      = GridProductos.CurrentRow.Cells[5].Value.ToString();
             frm.categoria   = GridProductos.CurrentRow.Cells[4].Value.ToString();
             frm.precioPro   = float.Parse(GridProductos.CurrentRow.Cells[3].Value.ToString());
             frm.DGData();
             this.Close();
         }
     }
     else
     {
         MessageBox.Show("seleccione una fila por favor");
     }
 }
コード例 #3
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormMantCompras hijo = new FormMantCompras();

            AddOwnedForm(hijo);
            hijo.IsInsert        = true;
            hijo.FormBorderStyle = FormBorderStyle.None;
            hijo.TopLevel        = false;
            hijo.Dock            = DockStyle.Fill;
            hijo.Top             = (this.Height / 2) - (hijo.Height / 2);
            hijo.Left            = (this.Width / 2) - (hijo.Width / 2);
            hijo.FormClosed     += new FormClosedEventHandler(Form_Closed);
            hijo.ControlBox      = false;
            this.Controls.Add(hijo);
            this.Tag = hijo;
            hijo.BringToFront();
            hijo.Show();
        }