Example #1
0
        public BE_Json UpdateInvoiceGeneral([FromBody] VE_Invoice _VeInvoice)
        {
            BE_Json objJson     = null;
            var     objListaAux = string.Empty;

            if (_VeInvoice == null)
            {
                return(objJson);
            }

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

                objJson        = new BE_Json();
                objJson.data   = objListaAux;
                objJson.status = CManager.RESULTADO_WCF.OK;
            }
            catch (ApplicationException ex)
            {
                objJson        = new BE_Json();
                objJson.data   = ex.Message;
                objJson.status = CManager.RESULTADO_WCF.ERROR;
            }
            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);
        }
Example #2
0
        public bool UpdateSchedule(BE_Schedule bE_Schedule)
        {
            _database = new MySQLDatabase(connectionString);
            bool       bOk       = true;
            BL_Invoice blInvoice = new BL_Invoice();

            blInvoice._database = _database;
            VE_Invoice invoice = blInvoice.updateInvoiceGeneral(bE_Schedule.Invoice);

            bOk = bOk && (invoice != null);

            if (exist(bE_Schedule))
            {
                bOk = bOk && new DA_Schedule(_database).UpdateSchedule(bE_Schedule);
            }
            else
            {
                bOk = bOk && new DA_Schedule(_database).CreateSchedule(bE_Schedule);
            }



            return(bOk);
        }