예제 #1
0
 private void btnNuevo_Click(object sender, EventArgs e)
 {
     try
     {
         frmNuevoPedido Nuevo = new frmNuevoPedido();
         this.Visible = false;
         Nuevo.ShowDialog();
         Nuevo.Dispose();
         if (Nuevo.DialogResult == DialogResult.OK)
         {
             if (!Busqueda)
             {
                 this.CargarPedidosPendientes();
             }
             else
             {
                 this.CargarPedidosBusq();
             }
         }
         this.Visible = true;
     }
     catch (Exception ex)
     {
         this.Visible = true;
         LogError.AddExcFileTxt(ex, "frmPedidos ~ btnNuevo_Click");
         MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     try
     {
         int          Tab = this.tabControl1.SelectedIndex;
         DataGridView DGV = this.ObtenerDGVXTab(Tab);
         if (DGV.SelectedRows.Count == 1)
         {
             int    RowToUpdate = DGV.Rows.GetFirstRow(DataGridViewElementStates.Selected);
             Pedido DatosAux    = this.ObtenerDatosGrid(RowToUpdate);
             if (DatosAux.IDEstatus == 1)
             {
                 frmNuevoPedido Nuevo = new frmNuevoPedido(DatosAux);
                 this.Visible = false;
                 Nuevo.ShowDialog();
                 Nuevo.Dispose();
                 //if (Nuevo.DialogResult == DialogResult.OK)
                 //{
                 //     No se modifica ningún campo de la tabla
                 //}
                 this.Visible = true;
             }
             else
             {
                 MessageBox.Show("El pedido debe estar en estatus Creado.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         else
         {
             MessageBox.Show("Seleccione un registro.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     catch (Exception ex)
     {
         this.Visible = true;
         LogError.AddExcFileTxt(ex, "frmPedidos ~ btnModificar_Click");
         MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }