Beispiel #1
0
 public bool ValidatedNextWorkFlowStep(int workFlowId, int IdInvoice, string userName)
 {
     try
     {
         _database = new MySQLDatabase(connectionString);
         var result = new DA_WorkFlow(_database).ValidatedNextWorkFlowStep(workFlowId, IdInvoice, userName);
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
        public bool NextWorkFlowStep(ref string mensaje, int workFlowId, int IdInvoice, string userName, bool refuse, string comment)
        {
            try
            {
                _database = new MySQLDatabase(connectionString);
                var result = new DA_WorkFlow(_database).NextWorkFlowStep(ref mensaje, workFlowId, IdInvoice, userName, refuse);

                if (!string.IsNullOrEmpty(comment) && refuse)
                {
                    BEInvoiceFilter filter = new BEInvoiceFilter();
                    filter.invoiceIdList = IdInvoice.ToString();
                    filter.statusList    = "";
                    filter.invoiceType   = "";

                    BL_Invoice bL_Invoice = new BL_Invoice();
                    bL_Invoice.connectionString = connectionString;
                    var invoice = bL_Invoice.GetInvoiceGeneral(filter);
                    if (invoice.Count > 0)
                    {
                        invoice[0].userName  = userName;
                        invoice[0].comments += comment;
                        bL_Invoice.updateInvoiceGeneral(invoice[0]);
                    }
                    else
                    {
                        mensaje = "No existe una factura que concuerde con la informacion proporcionada";
                    }
                }


                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }