private void llamar_Formulario(Cl_Enumeradores.eTipo_action Accion) { try { frm = new frmCon_CentroCostos_Man(); frm.event_frmCon_CentroCostos_Man_FormClosing += new frmCon_CentroCostos_Man.delegate_frmCon_CentroCostos_Man_FormClosing(frm_event_frmCon_CentroCostos_Man_FormClosing); if (!(Accion == Cl_Enumeradores.eTipo_action.grabar)) { frm.Info_centro_costo = InfoCentroCosto; frm._Accion = Accion; } else { frm._Accion = Accion; } frm.Show(); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private void llamar_Formulario(Cl_Enumeradores.eTipo_action Accion) { try { frm = new frmCon_CentroCostos_Man(); frm.event_frmCon_CentroCostos_Man_FormClosing += new frmCon_CentroCostos_Man.delegate_frmCon_CentroCostos_Man_FormClosing(frm_event_frmCon_CentroCostos_Man_FormClosing); if (Accion != Cl_Enumeradores.eTipo_action.grabar) { if (InfoCentroCosto != null) { //if(info frm.Info_centro_costo = InfoCentroCosto; frm._Accion = Accion; frm.Show(); } else { MessageBox.Show("Para continuar seleccione un registro.", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { frm._Accion = Accion; frm.Show(); } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private void gridViewSolicitudCompra_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { com_solicitud_compra_det_Info row = new com_solicitud_compra_det_Info(); row = (com_solicitud_compra_det_Info)gridViewSolicitudCompra.GetFocusedRow(); int cont = 0; if (row != null) { if (!String.IsNullOrEmpty(Convert.ToString(row.IdPunto_cargo)) && !String.IsNullOrEmpty(Convert.ToString(row.IdCentroCosto))) { if (row.IdProducto == null) { cont = ListDetSolCom.Where(q => q.NomProducto.Trim() == row.NomProducto.Trim() && q.IdPunto_cargo == row.IdPunto_cargo && q.IdCentroCosto == row.IdCentroCosto).Count(); } else { cont = ListDetSolCom.Where(q => q.IdProducto == row.IdProducto && q.IdPunto_cargo == row.IdPunto_cargo && q.IdCentroCosto == row.IdCentroCosto).Count(); } } } if (cont > 1) { MessageBox.Show("El registro : " + gridViewSolicitudCompra.GetFocusedRowCellValue(colpr_descripcion) + " ya se encuentra en el Detalle. Se procederá a Eliminar", param.Nombre_sistema); gridViewSolicitudCompra.DeleteSelectedRows(); } if (e.Column.Name == "colIdProducto") { Item = ListProducto.First(v => v.IdProducto == Convert.ToDecimal(e.Value)); gridViewSolicitudCompra.SetFocusedRowCellValue(coldo_Cantidad, 0); gridViewSolicitudCompra.SetFocusedRowCellValue(colpr_descripcion, Item.pr_descripcion); gridViewSolicitudCompra.SetFocusedRowCellValue(colIdUnidadMedida, Item.IdUnidadMedida); gridViewSolicitudCompra.SetFocusedRowCellValue(colStock, Item.pr_stock); } else { if (e.Column.Name == "coldo_Cantidad") { if (Convert.ToDouble(gridViewSolicitudCompra.GetFocusedRowCellValue(coldo_Cantidad)) < 0) { gridViewSolicitudCompra.SetFocusedRowCellValue(coldo_Cantidad, Convert.ToDouble(gridViewSolicitudCompra.GetFocusedRowCellValue(coldo_Cantidad)) * -1); } } else { if (e.Column.Name == "colpr_descripcion") { } } } ct_centro_costo_sub_centro_costo_Bus busSubCen = new ct_centro_costo_sub_centro_costo_Bus(); if (e.Column == colIdCentroCosto) { string IdCentroCosto = Convert.ToString(e.Value); if (IdCentroCosto == "-999") // esta creando un registro nuevo { frmCon_CentroCostos_Man frmCentroCosto = new frmCon_CentroCostos_Man(); frmCentroCosto.setAccion(Cl_Enumeradores.eTipo_action.grabar); frmCentroCosto.event_frmCon_CentroCostos_Man_FormClosing += frmCentroCosto_event_frmCon_CentroCostos_Man_FormClosing; frmCentroCosto.ShowDialog(); gridViewSolicitudCompra.SetFocusedRowCellValue(colIdCentroCosto, ""); } } if (e.Column == col_IdPuntoCargo_FJ) { switch (param.IdCliente_Ven_x_Default) { case Cl_Enumeradores.eCliente_Vzen.FJ: if (row.IdPunto_cargo != 0 && row.IdPunto_cargo != null) { ct_punto_cargo_Info info_punto_cargo = new ct_punto_cargo_Info(); ct_punto_cargo_Bus bus_punto_cargo = new ct_punto_cargo_Bus(); info_punto_cargo = bus_punto_cargo.Get_info_punto_Cargo_con_subcentro(param.IdEmpresa, Convert.ToInt32(row.IdPunto_cargo)); row.IdPunto_cargo_grupo = info_punto_cargo.IdPunto_cargo_grupo; row.IdCentroCosto = info_punto_cargo.IdCentroCosto_Scc; row.IdCentroCosto_sub_centro_costo = info_punto_cargo.IdCentroCosto_sub_centro_costo_Scc; } else { row.IdPunto_cargo_grupo = null; row.IdCentroCosto = null; row.IdCentroCosto_sub_centro_costo = null; } break; default: break; } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }