Exemple #1
0
        public BE_Json GetInvoiceGeneral([FromBody] BEInvoiceFilter _bEInvoiceFilter)
        {
            BE_Json objJson     = null;
            var     objListaAux = string.Empty;

            try
            {
                BL_Invoice _blInvoice = new BL_Invoice();
                _blInvoice.connectionString = AppConfig.DbConnection;
                objListaAux = JsonConvert.SerializeObject(_blInvoice.GetInvoiceGeneral(_bEInvoiceFilter));

                objJson        = new BE_Json();
                objJson.data   = objListaAux;
                objJson.status = CManager.RESULTADO_WCF.OK;
            }
            catch (Exception ex)
            {
                objJson        = new BE_Json();
                objJson.data   = "Hubo en error en servidor:" + ex.Message + ";" + ex.StackTrace + ";" + ex.ToString();
                objJson.status = CManager.RESULTADO_WCF.ERROR;
                objJson.status = CManager.RESULTADO_WCF.ERROR;
            }
            finally
            {
                objListaAux = null;
            }
            return(objJson);
        }
Exemple #2
0
        public BE_Json GetInvoiceByCompanyCodeAndType(string companyCode, string invoiceType, string invoiceStatusId)
        {
            BE_Json objJson     = null;
            var     objListaAux = string.Empty;

            try
            {
                BL_Invoice _blInvoice = new BL_Invoice();
                _blInvoice.connectionString = AppConfig.DbConnection;

                List <VE_Invoice> result = null;
                if (invoiceType.ToUpper() == "O")
                {
                    result = _blInvoice.GetInvoiceGeneral(new BEInvoiceFilter()
                    {
                        CompanyCodeTarget = companyCode, invoiceType = invoiceType, invoiceStatusId = 0
                    });
                }
                else
                {
                    result = _blInvoice.GetInvoiceByCompanyCodeAndType(companyCode, invoiceType, int.Parse(invoiceStatusId));
                }
                objListaAux = JsonConvert.SerializeObject(result);

                objJson        = new BE_Json();
                objJson.data   = objListaAux;
                objJson.status = CManager.RESULTADO_WCF.OK;
            }
            catch (Exception ex)
            {
                objJson        = new BE_Json();
                objJson.data   = "Hubo en error en servidor:" + ex.Message + ";" + ex.StackTrace + ";" + ex.ToString();
                objJson.status = CManager.RESULTADO_WCF.ERROR;
                objJson.status = CManager.RESULTADO_WCF.ERROR;
            }
            finally
            {
                objListaAux = null;
            }
            return(objJson);
        }