Exemplo n.º 1
0
        public Int32 AltaMovimiento(tMovimiento tm)
        {
            if (!SDK.SDK_Iniciado)
            {
                throw new Exception("Primero debe inicializar el SDK");
            }

            if (!SDK.EmpresaAbierta)
            {
                throw new Exception("Primero debe establecer una empresa");
            }

            Int32 idMvto = 0;

            Resultado = Funciones.fAltaMovimiento(ref _idDocto, ref idMvto, ref tm);
            if (Resultado == 0)
            {
                EventLog.WriteInfo(string.Format("Se Creó el Movimiento {0} Correctamente...", idMvto.ToString()));
            }
            SDK.rError(Resultado);
            return(idMvto);
        }
Exemplo n.º 2
0
        public string ObtieneFolioSiguiente(string codConcepto)
        {
            if (!SDK.SDK_Iniciado)
            {
                throw new Exception("Primero debe inicializar el SDK");
            }
            if (!SDK.EmpresaAbierta)
            {
                throw new Exception("Primero debe abrir una empresa");
            }
            double        f = 0;
            StringBuilder s = new StringBuilder();

            Resultado = Funciones.fSiguienteFolio(codConcepto, s, ref f);
            if (Resultado == 0)
            {
                _folio = f.ToString();
                _serie = s.ToString();
                EventLog.WriteInfo(string.Format("Se obtuvo el Folio siguiente: {0}", _folio));
                return(_folio);
            }
            SDK.rError(Resultado);
            return("");
        }
Exemplo n.º 3
0
        public string ObtieneCodigoConcepto(string concepto)
        {
            if (!SDK.SDK_Iniciado)
            {
                throw new Exception("Primero debe inicializar el SDK");
            }

            if (!SDK.EmpresaAbierta)
            {
                throw new Exception("Primero debe abrir una empresa");
            }

            StringBuilder codConcepto    = new StringBuilder();
            StringBuilder nombreConcepto = new StringBuilder();

            string codaux = "";

            Resultado = Funciones.fPosPrimerConceptoDocto();
            while (Resultado == 0 && codaux.Trim().Length == 0)
            {
                try
                {
                    Resultado = Funciones.fLeeDatoConceptoDocto("CCODIGOCONCEPTO", codConcepto, 30);
                }
                catch (Exception ex)
                {
                    EventLog.WriteError(ex.ToString());
                    Resultado = -1;
                }
                if (Resultado == 0)
                {
                    try
                    {
                        Resultado = Funciones.fLeeDatoConceptoDocto("CNOMBRECONCEPTO", nombreConcepto, 60);
                    }
                    catch (Exception ex)
                    {
                        EventLog.WriteError(ex.ToString());
                        Resultado = -1;
                    }
                    if (Resultado == 0)
                    {
                        if (concepto == nombreConcepto.ToString())
                        {
                            codaux = codConcepto.ToString();
                        }
                    }
                }

                if (Resultado == 0 && codaux.Trim().Length == 0)
                {
                    Resultado = Funciones.fPosSiguienteConceptoDocto();
                }
            }

            if (Resultado == 0 && codaux.Trim().Length > 0)
            {
                EventLog.WriteInfo(string.Format("Se Obtuvo el codigo de concepto {0} para {1}", codaux, concepto));
            }
            else if (Resultado > 0)
            {
                SDK.rError(Resultado);
            }

            return(codaux);
        }