Example #1
0
 private void mnu_Modificar_Click(object sender, EventArgs e)
 {
     try
     {
         InfoOC = (com_ordencompra_local_Info)gridVwOCPend.GetFocusedRow();
         if (InfoOC != null)
         {
             frm = new frmCom_OrdenCompra_Mant();
             frm.Set_Info(InfoOC);
             frm.Set_Accion(Cl_Enumeradores.eTipo_action.actualizar);
             frm.Text = frm.Text + " ***MODIFICAR***";
             frm.event_frmCom_OrdenCompra_Mant_FormClosing += new frmCom_OrdenCompra_Mant.delegate_frmCom_OrdenCompra_Mant_FormClosing(frm_event_frmCom_OrdenCompra_Mant_FormClosing);
             frm.Show();
         }
         else
         {
             MessageBox.Show("Seleccione un Registro a Modificar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 private void mnu_consultar_Click(object sender, EventArgs e)
 {
     try
     {
         InfoOC = (com_ordencompra_local_Info)gridVwOCPend.GetFocusedRow();
         if (InfoOC != null)
         {
             frm = new frmCom_OrdenCompra_Mant();
             frm.Set_Info(InfoOC);
             frm.Set_Accion(Cl_Enumeradores.eTipo_action.consultar);
             frm.ShowDialog();
         }
         else
         {
             MessageBox.Show("Seleccione un Registro a Mostrar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void Preparar_Formulario(Cl_Enumeradores.eTipo_action iAccion)
        {
            try
            {
                string mensajeFrm = "";

                Info_OC = new com_ordencompra_local_Info();

                switch (iAccion)
                {
                case Cl_Enumeradores.eTipo_action.grabar:
                    mensajeFrm = "REGISTRO NUEVO";
                    break;

                case Cl_Enumeradores.eTipo_action.actualizar:
                    mensajeFrm = "MODIFICAR REGISTRO";
                    Info_OC    = (com_ordencompra_local_Info)gridViewOrdenCompra.GetFocusedRow();
                    in_Ing_Egr_Inven_det_Bus         bus_IngEgr  = new in_Ing_Egr_Inven_det_Bus();
                    List <in_Ing_Egr_Inven_det_Info> list_IngEgr = new List <in_Ing_Egr_Inven_det_Info>();
                    if (Info_OC != null)
                    {
                        list_IngEgr = bus_IngEgr.Get_List_Ing_Egr_Inven_det_x_OrdenCompra(Info_OC.IdEmpresa, Info_OC.IdSucursal, Info_OC.IdOrdenCompra);

                        if (Info_OC.IdEstadoAprobacion_cat == "APRO")
                        {
                            MessageBox.Show("La Orden de compra Nº " + Info_OC.oc_NumDocumento +
                                            " ya fue Aprobada. No se puede modificar.");
                            return;
                        }
                        else
                        {
                            if (list_IngEgr.Count != 0)
                            {
                                MessageBox.Show("La Orden de compra Nº " + Info_OC.oc_NumDocumento +
                                                " tiene Ingresos a Bodega. No se puede modificar.");
                                return;
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Seleccione un Registro ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                    }
                    break;

                case Cl_Enumeradores.eTipo_action.Anular:
                    mensajeFrm = "ANULAR REGISTRO";
                    Info_OC    = (com_ordencompra_local_Info)gridViewOrdenCompra.GetFocusedRow();
                    break;

                case Cl_Enumeradores.eTipo_action.consultar:
                    mensajeFrm = "CONSULTAR REGISTRO";
                    Info_OC    = (com_ordencompra_local_Info)gridViewOrdenCompra.GetFocusedRow();
                    break;

                default:
                    break;
                }

                if (Info_OC != null)
                {
                    frm      = new frmCom_OrdenCompra_Mant();
                    frm.Text = frm.Text + "***" + mensajeFrm + "***";
                    frm.Set_Accion(iAccion);
                    frm.Set_Info(Info_OC);
                    frm.Show();
                    frm.MdiParent = this.MdiParent;
                    frm.event_frmCom_OrdenCompra_Mant_FormClosing += frm_event_frmCom_OrdenCompra_Mant_FormClosing;
                }
                else
                {
                    MessageBox.Show("Seleccione un Registro ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Example #4
0
        private void gridVwOCPend_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                info = (com_ordencompra_local_Info)this.gridVwOCPend.GetFocusedRow();

                if (e.Column.Name == "colAbrirOC")
                {
                    var row = (com_ordencompra_local_Info)gridVwOCPend.GetFocusedRow();
                    if (row != null)
                    {
                        frmCom_OrdenCompra_Mant frm = new frmCom_OrdenCompra_Mant();
                        frm = new frmCom_OrdenCompra_Mant();
                        frm.Set_Info(row);
                        frm.event_frmCom_OrdenCompra_Mant_FormClosing += frm_event_frmCom_OrdenCompra_Mant_FormClosing;
                        frm.event_frmCom_OrdenCompra_Mant_FormClosing += new frmCom_OrdenCompra_Mant.delegate_frmCom_OrdenCompra_Mant_FormClosing(frm_event_frmCom_OrdenCompra_Mant_FormClosing);
                        frm.Set_Accion(Cl_Enumeradores.eTipo_action.consultar);
                        frm.MdiParent = this.MdiParent;
                        frm.Show();
                    }
                }


                if (e.Column.Name == "colCheck")
                {
                    if ((Boolean)gridVwOCPend.GetFocusedRowCellValue(colCheck))
                    {
                        gridVwOCPend.SetFocusedRowCellValue(colCheck, false);
                        gridVwOCPend.SetFocusedRowCellValue(colap_descripcion, info.IdEstadoAprobacion_AUX);
                    }

                    else
                    {
                        //lista = bus_inven.Get_List_Ing_Egr_Inven_det_x_OrdenCompra(info.IdEmpresa, info.IdSucursal, info.IdOrdenCompra);


                        //if (lista.Count > 0)
                        //{

                        //    FrmIn_Detalle_Ing_Egr_Bodega_Alerta frmConsulta = new FrmIn_Detalle_Ing_Egr_Bodega_Alerta();
                        //    frmConsulta.Text = "La OC#: " + info.IdOrdenCompra + " tiene Ingesos a Bodega";
                        //    frmConsulta.set_info_list(lista);
                        //    info.IdEstadoAprobacion_cat = info.IdEstadoAprobacion_AUX;
                        //    info.check = false;
                        //    frmConsulta.ShowDialog();
                        //}



                        if (info.IdEstadoAprobacion_AUX == "ANU")
                        {
                            MessageBox.Show("No se pueden modificar registros Inactivos", "Sistemas");
                            return;
                        }

                        gridVwOCPend.SetFocusedRowCellValue(colCheck, true);
                        gridVwOCPend.SetFocusedRowCellValue(colap_descripcion, "APRO");
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }