예제 #1
0
        public ct_Cbtecble_Info get_Cbtecble()
        {
            try
            {
                Per_I = Per_B.Get_Info_Periodo(param.IdEmpresa, Convert.ToDateTime(dtp_fechaOG.EditValue).Date, ref msg);
                CbteCble_I.IdEmpresa        = param.IdEmpresa;
                CbteCble_I.IdTipoCbte       = _IdTipoCbte;
                CbteCble_I.CodCbteCble      = "";
                CbteCble_I.IdPeriodo        = Per_I.IdPeriodo;
                CbteCble_I.cb_Fecha         = Convert.ToDateTime(dtp_fechaOG.EditValue).Date;
                CbteCble_I.cb_Valor         = UC_Diario_x_cxp.Get_ValorCbteCble();
                CbteCble_I.cb_Observacion   = txt_observacion.Text.Trim() + "FP:#" + txeSerie.Text + "-" + txeNumDocum.Text + " Prv:" + ucCp_Proveedor1.get_ProveedorInfo().pr_nombre;
                CbteCble_I.Secuencia        = 0;
                CbteCble_I.Estado           = "A";
                CbteCble_I.Anio             = Convert.ToDateTime(dtp_fechaOG.EditValue).Date.Year;
                CbteCble_I.Mes              = Convert.ToDateTime(dtp_fechaOG.EditValue).Date.Month;
                CbteCble_I.IdUsuario        = param.IdUsuario;
                CbteCble_I.IdUsuarioUltModi = param.IdUsuario;
                CbteCble_I.cb_FechaTransac  = param.Fecha_Transac;
                CbteCble_I.cb_FechaUltModi  = param.Fecha_Transac;
                CbteCble_I.Mayorizado       = "N";
                CbteCble_I.IdCbteCble       = (txt_NOrdeG.Text == "") ? 0 : Convert.ToDecimal(txt_NOrdeG.Text);

                return(CbteCble_I);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(new ct_Cbtecble_Info());
            }
        }
예제 #2
0
        private Boolean Validar()
        {
            try
            {
                Boolean respuesta = true;

                InfoPeriodo = BusPeriodo.Get_Info_Periodo(param.IdEmpresa, dtFecha.Value, ref MensajeError);
                if (InfoPeriodo == null || InfoPeriodo.pe_cerrado == "S")
                {
                    MessageBox.Show("No se puede grabar el comprobante contable debido a que el periodo se encuentra cerrado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    respuesta = false;
                }

                if (cmb_tipocomprobante.EditValue == null || cmb_tipocomprobante.EditValue == "")
                {
                    MessageBox.Show("Debe Seleecionar un Tipo de Comprobante ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    respuesta = false;
                }

                if (!param.Validar_periodo_cerrado_x_modulo(param.IdEmpresa, Cl_Enumeradores.eModulos.CONTA, Convert.ToDateTime(dtFecha.Value)))
                {
                    return(false);
                }

                return(respuesta);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name + " " + this.Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                return(false);
            }
        }
예제 #3
0
        void ucGe_Menu_event_btnAnular_Click(object sender, EventArgs e)
        {
            try
            {
                ct_Periodo_Info infoPeriodo = new ct_Periodo_Info();
                infoPeriodo = lstPeriodo.Where(q => q.IdPeriodo == Convert.ToInt32(cmbPeriodo.EditValue)).First();
                if (infoPeriodo.pe_cerrado == "S")
                {
                    MessageBox.Show("No puede Anular, El periodo ya se encuentra cerrado ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                //if (!lblContabilizado.Visible)
                if (busDepre.VerificarUltDepre(InfoDepre.IdEmpresa, InfoDepre.IdDepreciacion, InfoDepre.IdTipoDepreciacion))
                {
                    AnularDepreciacion();
                }
                else
                {
                    MessageBox.Show("No puede Anular por que no es la ultima Depreciacion Realizada", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                //else

                //  MessageBox.Show("No puede Anular porque ya se encuentra Contabilizado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                cargarErroresGrid(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #4
0
        public fa_liquidacion_gastos_Info Get_Info_Liquidacion()
        {
            try
            {
                Info_Periodo = Bus_Periodo.Get_Info_Periodo(param.IdEmpresa, dt_fecha_liqui.Value, ref mensaje);

                Info_Liquidacion.IdEmpresa       = param.IdEmpresa;
                Info_Liquidacion.IdPeriodo       = Info_Periodo.IdPeriodo;
                Info_Liquidacion.cod_liquidacion = txt_Codigo.Text;
                Info_Liquidacion.IdCliente       = ucFa_ClienteCmb.get_ClienteInfo().IdCliente;
                Info_Liquidacion.fecha_liqui     = dt_fecha_liqui.Value;
                ucFa_ClienteCmb.set_ClienteInfo(Info_Liquidacion.IdCliente);
                Info_Liquidacion.Observacion       = txt_Observacion.Text;
                Info_Liquidacion.IdUsuario         = param.IdUsuario;
                Info_Liquidacion.Fecha_Transaccion = DateTime.Now;
                Info_Liquidacion.IdLiquidacion     = Convert.ToInt32(txt_Codigo.Text);
                Info_Liquidacion.Lis_Detalle       = new List <fa_liquidacion_gastos_det_Info>(BindList_Liquidacion);

                return(Info_Liquidacion);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                NameMetodo = NameMetodo + " - " + ex.ToString();
                MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                return(new fa_liquidacion_gastos_Info());
            }
        }
예제 #5
0
        private void cmb_Periodo_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (cmb_Periodo.EditValue != null)
                {
                    int idPeriodo = Convert.ToInt32(cmb_Periodo.EditValue);
                    info_Periodo = lst_Periodo.FirstOrDefault(q => q.IdPeriodo == idPeriodo);
                    if (info_Periodo != null)
                    {
                        de_Desde.EditValue = info_Periodo.pe_FechaIni;
                        de_Hasta.EditValue = info_Periodo.pe_FechaFin;
                    }
                    else
                    {
                        cmb_Periodo.EditValue = null;
                        de_Desde.EditValue    = null;
                        de_Hasta.EditValue    = null;
                    }
                }
                else
                {
                    de_Desde.EditValue = null;
                    de_Hasta.EditValue = null;
                }

                event_delegate_cmb_Periodo_EditValueChanged(sender, e);
            }
            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());
            }
        }
예제 #6
0
        public Boolean EliminarDB(ct_Periodo_Info info, ref string MensajeError)
        {
            try
            {
                using (EntitiesDBConta context = new EntitiesDBConta())
                {
                    var contact = context.ct_periodo.FirstOrDefault(dinfo => dinfo.IdPeriodo == info.IdPeriodo);

                    if (contact != null)
                    {
                        contact.pe_estado = "I";
                        context.SaveChanges();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
예제 #7
0
        private void btn_ReversoMayo_Click_1(object sender, EventArgs e)
        {
            try
            {
                EstadoBotones(TipoProceso.Reverso);

                periodoSelect = (ct_Periodo_Info)cmb_periodo.SelectedItem;

                if (periodoSelect == null)
                {
                    return;
                }


                TimerReverso.Enabled = true;
                backgroundWorker.RunWorkerAsync();
                Mensaje = "Proceso de Reverso de Mayorizacion Generado Ok...";

                ct_ProcesosContables_Bus ProceMayoB = new ct_ProcesosContables_Bus(periodoSelect);
                //oThreadReverso = new Thread(new ThreadStart(ProceMayoB.ReversoMayorizar));

                oThreadReverso.Start();
                Thread.Sleep(1);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void ucCon_Periodo1_event_delegate_cmb_Periodo_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (_Accion == Cl_Enumeradores.eTipo_action.grabar)
                {
                    if (ucCon_Periodo1.Get_Periodo_Info() == null)
                    {
                        return;
                    }

                    info_Periodo = ucCon_Periodo1.Get_Periodo_Info();

                    double unidades_actuales = 0;
                    foreach (var item in list_ActF_x_CC)
                    {
                        unidades_actuales        = bus_registro_det.get_unidades_periodo_anterior(param.IdEmpresa, info_Periodo.IdPeriodo, item.IdActivoFijo);
                        item.Af_ValorUnidad_Actu = unidades_actuales == 0 ? item.Af_ValorUnidad_Actu : unidades_actuales;
                    }
                    gridControlEquiposAsignados.DataSource = null;
                    gridControlEquiposAsignados.DataSource = list_ActF_x_CC;
                }
            }
            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());
            }
        }
예제 #9
0
        private void ucGe_Menu_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                pi = (ct_Periodo_Info)gridViewPerido.GetFocusedRow();

                if (pi != null)
                {
                    frm = new frmCon_Periodo_Mantenimiento();
                    frm.event_frmCon_Periodo_Mantenimiento_FormClosing += frm_event_frmCon_Periodo_Mantenimiento_FormClosing;
                    frm.Text = frm.Text + "***ANULAR REGISTRO***";
                    frm.info = pi;
                    frm.set_periodo(pi);
                    frm.set_Accion(Cl_Enumeradores.eTipo_action.Anular);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
                else
                {
                    MessageBox.Show("Seleccione un Registro ", "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);
            }
        }
예제 #10
0
        private void frmAF_MejoraActivo_Mant_Load(object sender, EventArgs e)
        {
            try
            {
                string MensajeError = "";

                infoParam  = busParam.Get_Info_Parametros(param.IdEmpresa);
                IdTipoCbte = infoParam.IdTipoCbteMejora;
                Per_I      = Per_B.Get_Info_Periodo(param.IdEmpresa, Convert.ToDateTime(dtpFecha.Value), ref MensajeError);
                switch (_Accion)
                {
                case Cl_Enumeradores.eTipo_action.grabar:
                    cargarCombos(Cl_Enumeradores.eEstadoActivoFijo.TIP_ESTADO_AF_ACTIVO.ToString());
                    ucGe_Menu.Enabled_bntAnular   = false;
                    ucGe_Menu.Enabled_bntImprimir = false;
                    break;

                case Cl_Enumeradores.eTipo_action.actualizar:
                    cargarCombos("");
                    set_MejoraActivo();
                    ucGe_Menu.Enabled_bntAnular       = false;
                    cmbActivoFijo.Properties.ReadOnly = true;
                    txtCodMejora.Properties.ReadOnly  = true;
                    cmbActivoFijo_EditValueChanged(null, null);
                    ucGe_Menu.Enabled_bntImprimir = false;
                    break;

                case Cl_Enumeradores.eTipo_action.Anular:
                    cargarCombos("");
                    set_MejoraActivo();
                    ucCon_GridDiarioContable.Enabled     = false;
                    ucGe_Menu.Enabled_bntGuardar_y_Salir = false;
                    ucGe_Menu.Enabled_btnGuardar         = false;
                    cmbActivoFijo.Properties.ReadOnly    = true;
                    cmbProveedor.Enabled = false;
                    txtDescripcionTecnica.Properties.ReadOnly = true;
                    txtMotivoMejora.Properties.ReadOnly       = true;
                    txtCodMejora.Properties.ReadOnly          = true;
                    txtValorMejora.Properties.ReadOnly        = true;
                    txtComrobante.Properties.ReadOnly         = true;
                    cmbActivoFijo_EditValueChanged(null, null);
                    ucGe_Menu.Enabled_bntImprimir = false;
                    break;

                case Cl_Enumeradores.eTipo_action.consultar:
                    cargarCombos("");
                    set_MejoraActivo();
                    ucGe_Menu.Enabled_bntGuardar_y_Salir = false;
                    ucGe_Menu.Enabled_btnGuardar         = false;
                    ucGe_Menu.Enabled_bntAnular          = false;
                    cmbActivoFijo_EditValueChanged(null, null);
                    break;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #11
0
        public bool Validar_periodo_cerrado_x_modulo(int IdEmpresa, Cl_Enumeradores.eModulos IdModulo, DateTime Fecha)
        {
            try
            {
                string          MensajeError = "";
                ct_Periodo_Info info_periodo = new ct_Periodo_Info();
                ct_Periodo_Bus  bus_periodo  = new ct_Periodo_Bus();

                info_periodo = bus_periodo.Get_Info_Periodo(IdEmpresa, Fecha, ref MensajeError);
                if (info_periodo == null)
                {
                    MessageBox.Show("El periodo no se encuentra registrado en el sistema.", Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                ct_periodo_x_tb_modulo_Bus bus_periodo_x_modulo = new ct_periodo_x_tb_modulo_Bus();
                if (bus_periodo_x_modulo.Esta_modulo_cerrado_x_periodo(IdEmpresa, IdModulo, info_periodo.IdPeriodo))
                {
                    MessageBox.Show("El periodo se encuentra cerrado para el Modulo:." + IdModulo.ToString(), Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                //Valido contabilidad ya que las pantallas estan atadas a contabilidad
                if (bus_periodo_x_modulo.Esta_modulo_cerrado_x_periodo(IdEmpresa, Cl_Enumeradores.eModulos.CONTA, info_periodo.IdPeriodo))
                {
                    MessageBox.Show("El periodo en el modulo Contabilidad en el que intenta realizar la transacción se encuentra cerrado.", Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #12
0
        public frmCP_RetencionProveedor(double DvalorIVA, double DBaseImponible, cp_retencion_Info CabRetencion, decimal IdProveedor, DateTime fechaRetencion, Boolean VerNumRetencion = false, decimal NRetencion = 0)
        {
            try
            {
                InitializeComponent();

                string MensajeError = "";

                nDocu    = CabRetencion.NumRetencion;
                TipoDoc  = CabRetencion.TipoDocumento;
                NomProve = CabRetencion.NomProveedor;

                Per_I = Per_B.Get_Info_Periodo(param.IdEmpresa, fechaRetencion, ref MensajeError);

                paramCP_I = paramCP_B.Get_Info_parametros(param.IdEmpresa);

                if (CabRetencion == null)
                {
                    CabRetencion = new cp_retencion_Info();
                }

                ucCp_Retencion1.set_Valores(DBaseImponible, DvalorIVA);

                ucCp_Retencion1.carga_codigoSRI_x_Proveedor(param.IdEmpresa, IdProveedor);


                LstRetencion         = CabRetencion.ListDetalle;
                ucCp_Retencion1.Dock = DockStyle.Fill;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #13
0
        private void cmb_Periodo_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (cmb_Periodo.EditValue != null)
                {
                    lista.Clear();
                    gc_balance.DataSource = lista;
                    gc_balance.RefreshDataSource();


                    int IdPerido = Convert.ToInt32(cmb_Periodo.EditValue);
                    infoPeriodo = listPeriodo.FirstOrDefault(q => q.IdPeriodo == IdPerido);
                    if (infoPeriodo != null)
                    {
                        dtpFechaHasta.Value = infoPeriodo.pe_FechaFin;
                        dtpFechaDesde.Value = infoPeriodo.pe_FechaIni;
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #14
0
 public Boolean ModificarDB(ct_Periodo_Info info, ref string MensajeError)
 {
     try
     {
         using (EntitiesDBConta context = new EntitiesDBConta())
         {
             var contact = context.ct_periodo.FirstOrDefault(minfo => minfo.IdPeriodo == info.IdPeriodo && minfo.IdEmpresa == info.IdEmpresa);
             if (contact != null)
             {
                 contact.IdEmpresa    = info.IdEmpresa;
                 contact.IdPeriodo    = info.IdPeriodo;
                 contact.IdanioFiscal = info.IdanioFiscal;
                 contact.pe_mes       = Convert.ToByte(info.pe_mes);
                 contact.pe_FechaIni  = info.pe_FechaIni;
                 contact.pe_FechaFin  = info.pe_FechaFin;
                 contact.pe_estado    = info.pe_estado;
                 contact.pe_cerrado   = info.pe_cerrado;
                 context.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
예제 #15
0
        private void Llamar_rpt_balance_general()
        {
            try
            {
                XCONTA_Rpt013_rpt Reporte           = new XCONTA_Rpt013_rpt();
                int             IdEmpresa           = 0;
                int             IdNivel_a_mostrar   = 0;
                int             IdPunto_cargo_grupo = 0;
                int             IdPunto_cargo       = 0;
                ct_Periodo_Info Info_Periodo        = new ct_Periodo_Info();

                DateTime FechaIni;
                DateTime FechaFin;

                string IdCentroCosto         = "";
                string Nom_centro_Costo      = "";
                string Nom_Punto_Cargo_Grupo = "";
                string Nom_Punto_Cargo       = "";

                IdEmpresa = param.IdEmpresa;
                FechaIni  = dtpFechaDesde.Value;
                FechaFin  = dtpFechaHasta.Value;

                Info_Periodo = listPeriodo.FirstOrDefault(v => v.IdPeriodo == Convert.ToInt32(cmb_Periodo.EditValue));

                IdCentroCosto     = cmb_centro_costo.EditValue == null ? "" : cmb_centro_costo.EditValue.ToString();
                Nom_centro_Costo  = cmb_centro_costo.Text;
                IdNivel_a_mostrar = (int)cmb_nivel.SelectedValue;

                IdPunto_cargo_grupo   = uCct_Pto_Cargo_Grupo.Get_Id_grupo();
                Nom_Punto_Cargo_Grupo = (uCct_Pto_Cargo_Grupo.Get_info_grupo() == null) ? "" : uCct_Pto_Cargo_Grupo.Get_info_grupo().nom_punto_cargo_grupo;

                IdPunto_cargo   = uCct_Pto_Cargo_Grupo.Get_Id_punto_cargo();
                Nom_Punto_Cargo = (uCct_Pto_Cargo_Grupo.Get_info_punto_cargo() == null) ? "" : uCct_Pto_Cargo_Grupo.Get_info_punto_cargo().nom_punto_cargo;

                Reporte.PIdEmpresa.Value           = IdEmpresa;
                Reporte.PIdPeriodo.Value           = Info_Periodo.IdPeriodo;
                Reporte.PIdCentroCosto.Value       = IdCentroCosto;
                Reporte.PIdNivel_a_mostrar.Value   = IdNivel_a_mostrar;
                Reporte.PIdPunto_Cargo.Value       = IdPunto_cargo;
                Reporte.PIdPunto_Cargo_Grupo.Value = IdPunto_cargo_grupo;
                Reporte.PMostrar_Reg_en_cero.Value = chkMostrar_Reg_Cero.Checked;
                Reporte.PMostrar_CC.Value          = chkMostrar_CC.Checked;

                Reporte.RequestParameters = false;
                ReportPrintTool pt = new ReportPrintTool(Reporte);
                pt.AutoShowParametersPanel = false;

                Reporte.ShowPreview();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #16
0
 private void gridViewPerido_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     try
     {
         pi = GetSelectedRow((DevExpress.XtraGrid.Views.Grid.GridView)sender);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #17
0
        Boolean validarPeriodo()
        {
            try
            {
                ct_Periodo_Info PeriodoIni = lstPeriodo.Where(q => q.IdPeriodo == Convert.ToInt32(barPeriodoIni.EditValue)).First();
                //var PeriodoFin = (ct_Periodo_Info)barPeriodoFin.EditValue;
                ct_Periodo_Info PeriodoFin = lstPeriodo.Where(q => q.IdPeriodo == Convert.ToInt32(barPeriodoFin.EditValue)).First();

                int intPeriodo = 0;
                if (PeriodoFin.IdanioFiscal > PeriodoIni.IdanioFiscal)
                {
                    intPeriodo = PeriodoFin.IdanioFiscal - PeriodoIni.IdanioFiscal;
                    if (intPeriodo > 1)
                    {
                        MessageBox.Show("Los periodos a consultar no pueden ser mayor a 12", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return(false);
                    }
                    if (intPeriodo == 1)
                    {
                        if (PeriodoFin.pe_mes >= PeriodoIni.pe_mes)
                        {
                            MessageBox.Show("Los periodos a consultar no pueden ser mayor a 12", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return(false);
                        }
                    }
                }
                else
                {
                    if (PeriodoFin.IdanioFiscal == PeriodoIni.IdanioFiscal)
                    {
                        if (PeriodoFin.pe_mes < PeriodoIni.pe_mes)
                        {
                            MessageBox.Show("El periodo final no puede ser menor que el inicial", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return(false);
                        }
                    }
                    else
                    {
                        MessageBox.Show("El periodo final no puede ser menor que el inicial", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return(false);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.InnerException.ToString());
                return(false);
            }
        }
예제 #18
0
        private void cmb_periodo_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                info_periodo =(ct_Periodo_Info) cmb_periodo.Properties.View.GetFocusedRow();
            }
            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());

            }
        }
예제 #19
0
 private void cmb_periodo_event_delegate_cmb_Periodo_EditValueChanged_1(object sender, EventArgs e)
 {
     try
     {
         periodo_info = cmb_periodo.Get_Periodo_Info();
         buscar_liquidaciones();
         Set();
     }
     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());
     }
 }
예제 #20
0
        private void cmb_Periodo_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                ct_Periodo_Info oPeriO = listPeriodo.FirstOrDefault(v => v.IdPeriodo == Convert.ToInt32(cmb_Periodo.EditValue));

                dtpFechaIni.Value = oPeriO.pe_FechaIni;
                dtpFechaFin.Value = oPeriO.pe_FechaFin;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #21
0
 void LimpiiarDatos()
 {
     try
     {
         _Accion            = Cl_Enumeradores.eTipo_action.grabar;
         Pi                 = new ct_Periodo_Info();
         txtperiodo.Text    = "";
         chk_activo.Checked = true;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #22
0
 public Boolean ModificarDB(ct_Periodo_Info info, ref string MensajeError)
 {
     try
     {
         return(data.ModificarDB(info, ref MensajeError));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ModificarDB", ex.Message), ex)
               {
                   EntityType = typeof(ct_Periodo_Bus)
               };
     }
 }
예제 #23
0
 private void cmb_periodo_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         ct_Periodo_Info oPeriO = (ct_Periodo_Info)cmb_periodo.SelectedItem;
         periodoSelect    = oPeriO;
         lblFechaIni.Text = oPeriO.pe_FechaIni.ToShortDateString();
         lblfechaFin.Text = oPeriO.pe_FechaFin.ToShortDateString();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #24
0
 private void barItem_periodo_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         if (bei_Periodo.EditValue != null)
         {
             ct_Periodo_Info InfoP = new ct_Periodo_Info();
             InfoP = listPeriodo.FirstOrDefault(v => v.IdPeriodo == Convert.ToInt32(bei_Periodo.EditValue));
             dtpDesde.EditValue = InfoP.pe_FechaIni;
             dtpHasta.EditValue = InfoP.pe_FechaFin;
         }
     }
     catch (Exception ex)
     {
     }
 }
예제 #25
0
        public Boolean validaColumna()
        {
            try
            {
                string  MensajeError = "";
                Boolean estado       = true;
                Per_I = Per_B.Get_Info_Periodo(Info_DetPrestamo.IdEmpresa, Convert.ToDateTime(dte_Fecha.EditValue), ref MensajeError);

                if (Per_I.IdPeriodo == 0)
                {
                    MessageBox.Show("El Periodo no se encuentra ingresado en la Base de Datos", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    estado = false;
                }

                if (Per_I.pe_cerrado == "S")
                {
                    MessageBox.Show("No se procedio a Grabar porque el Periodo se encuentra cerrado ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    estado = false;
                }


                if (cmb_banco.get_BaCuentaInfo() == null)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_el) + " banco", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    estado = false;
                }


                if (parametro_banco_info.IdCtaCble_prestamos == null || parametro_banco_info.IdCtaCble_Interes == null)
                {
                    MessageBox.Show(" Falta cuentas contable en paramatros de bancos", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    estado = false;
                }


                return(estado);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                NameMetodo = NameMetodo + " - " + ex.ToString();
                MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                                , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                return(false);
            }
        }
예제 #26
0
        public ct_Periodo_Info Get_Info_Periodo(int IdEmpresa, DateTime fecha, ref string MensajeError)
        {
            try
            {
                string fechas;
                fechas = fecha.ToShortDateString();
                DateTime fechaI;
                fechaI = Convert.ToDateTime(fechas);

                ct_Periodo_Info _PeriodoInfo = new ct_Periodo_Info();


                EntitiesDBConta OEPeriodo     = new EntitiesDBConta();
                var             selectPeriodo = from C in OEPeriodo.ct_periodo
                                                where C.IdEmpresa == IdEmpresa && (C.pe_FechaIni <= fechaI && C.pe_FechaFin >= fechaI)
                                                select C;
                if (selectPeriodo.ToList().Count > 0)
                {
                    foreach (var item in selectPeriodo)
                    {
                        _PeriodoInfo.IdEmpresa    = item.IdEmpresa;
                        _PeriodoInfo.IdPeriodo    = item.IdPeriodo;
                        _PeriodoInfo.IdanioFiscal = item.IdanioFiscal;
                        _PeriodoInfo.pe_mes       = item.pe_mes;
                        _PeriodoInfo.pe_cerrado   = item.pe_cerrado;
                        _PeriodoInfo.pe_estado    = item.pe_estado;
                        _PeriodoInfo.pe_FechaFin  = item.pe_FechaFin;
                        _PeriodoInfo.pe_FechaIni  = item.pe_FechaIni;
                    }
                    return(_PeriodoInfo);
                }
                else
                {
                    return(new ct_Periodo_Info());
                }
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
예제 #27
0
 private void cmb_Periodo_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         if (ucCon_Periodo1.Get_Periodo_Info() != null)
         {
             int idPeriodo = ucCon_Periodo1.Get_Periodo_Info().IdPeriodo;
             info_Periodo = list_Periodo.FirstOrDefault(q => q.IdPeriodo == idPeriodo);
         }
     }
     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());
     }
 }
        private void wizardControl1_NextClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
        {
            if (e.Page.Name == "wizardPage1")
            {
                PU_CARGAR_EXCEL_GRILLA();
            }

            if (e.Page.Name == "wizardPage4")
            {
                Fecha_contabilizacion = Convert.ToDateTime(de_fecha_contabilizacion.EditValue).Date;
                info_periodo          = bus_periodo.Get_Info_Periodo(param.IdEmpresa, Fecha_contabilizacion, ref MensajeError);
            }

            if (e.Page.Name == "wizardPage3")
            {
            }//fin del wizardpage 3
        }
예제 #29
0
        private void cmb_Periodo_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                ct_Periodo_Info info = (ct_Periodo_Info)cmb_Periodo.Properties.View.GetFocusedRow();

                periodo_nombre = info.nom_periodo;
                periodo_inicio = Convert.ToString(info.pe_FechaIni);
                periodo_fin    = Convert.ToString(info.pe_FechaFin);
                //periodo = info.pe_FechaIni + "-" + info.pe_FechaFin;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #30
0
        public ct_Cbtecble_Info get_CbteCbleInfo()
        {
            InfoCbteCble = new ct_Cbtecble_Info();
            try
            {
                string codigo;
                string MensajeError = "";
                InfoPeriodo = BusPeriodo.Get_Info_Periodo(param.IdEmpresa, dtFecha.Value, ref MensajeError);

                if (InfoPeriodo != null && InfoPeriodo.pe_cerrado != "S")
                {
                    InfoCbteCble.IdEmpresa = param.IdEmpresa;
                    InfoCbteCble.IdUsuario = param.IdUsuario;
                    codigo = cbtipobus.Get_Codigo_x_CbtCble_tipo(param.IdEmpresa, Convert.ToInt32(this.cmb_tipocomprobante.EditValue), ref MensajeError).Trim();
                    InfoCbteCble.IdPeriodo       = InfoPeriodo.IdPeriodo;
                    InfoCbteCble.Anio            = InfoPeriodo.IdanioFiscal;
                    InfoCbteCble.Mes             = InfoPeriodo.pe_mes;
                    InfoCbteCble.IdTipoCbte      = Convert.ToInt32(this.cmb_tipocomprobante.EditValue);
                    InfoCbteCble.CodCbteCble     = txt_codCbteCble.Text;
                    InfoCbteCble.cb_Fecha        = Convert.ToDateTime(this.dtFecha.Value.ToShortDateString());
                    InfoCbteCble.cb_FechaTransac = param.GetDateServer();
                    InfoCbteCble.IdSucursal      = (cmb_sucursal.EditValue == null ? 0 : Convert.ToInt32(cmb_sucursal.EditValue));
                    InfoCbteCble.Mayorizado      = "N";
                    InfoCbteCble.cb_Observacion  = this.txt_concepto.Text;
                    InfoCbteCble.Secuencia       = BusCbteCble.Get_IdSecuencia(ref MensajeError);
                    InfoCbteCble.Estado          = "A";

                    InfoCbteCble._cbteCble_det_lista_info = UC_Diario.Get_List_Cbtecble_det();

                    return(InfoCbteCble);
                }
                else
                {
                    MessageBox.Show("El periodo de la fecha está cerrado.. No podrá grabar..");
                    InfoCbteCble = new ct_Cbtecble_Info();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                InfoCbteCble = new ct_Cbtecble_Info();
            }
            return(InfoCbteCble);
        }