Exemplo n.º 1
0
        public static void perform(dynamic objInvoice = null)
        {
            ActivityLogModel objLog       = new ActivityLogModel();
            dynamic          log_invoices = null;

            if (objInvoice != null)
            {
                log_invoices = objLog.where (objLog, "invoice_id='" + objInvoice.id + "'");
            }
            else
            {
                log_invoices = objLog.where (objLog, "model='invoice'");
            }
            if (log_invoices.Count > 0)
            {
                List <string> activites      = new List <string>();
                dynamic       activityObject = new ExpandoObject();
                foreach (var log_invoice in log_invoices)
                {
                    String activity = invoiceData(log_invoice);
                    activites.Add(activity);
                }

                dynamic postData = new ExpandoObject();
                postData.activities = activites;
                string json     = JsonConvert.SerializeObject(postData);
                string response = WebAPI.postRequest("activities/offline_changes", json);
                ActivityLogModel.remove(response);
            }
            else
            {
                Console.WriteLine("Everything sync");
            }
        }
Exemplo n.º 2
0
        public void loadMembership()
        {
            ActivityLogModel log         = new ActivityLogModel();
            dynamic          memberships = log.where (log, "model = 'membership'");

            if (memberships.Count > 0)
            {
                foreach (var membership in memberships)
                {
                    membershipList.Rows.Add(membership.id, membership.model, membership.action, membership.date, membership.ref_id, membership.department_id);
                }
            }
        }
Exemplo n.º 3
0
        public void loadPayment()
        {
            ActivityLogModel log      = new ActivityLogModel();
            dynamic          payments = log.where (log, "model = 'payment'");

            if (payments.Count > 0)
            {
                foreach (var payment in payments)
                {
                    paymentsList.Rows.Add(payment.id, payment.model, payment.action, payment.date, payment.ref_id, payment.department_id);
                }
            }
        }
Exemplo n.º 4
0
        public void loadInvoiceItem()
        {
            ActivityLogModel log          = new ActivityLogModel();
            dynamic          invoiceItems = log.where (log, "model = 'invoice_items'");

            if (invoiceItems.Count > 0)
            {
                foreach (var invoiceItem in invoiceItems)
                {
                    invoiceItemList.Rows.Add(invoiceItem.id, invoiceItem.model, invoiceItem.action, invoiceItem.date, invoiceItem.ref_id, invoiceItem.department_id);
                }
            }
        }
Exemplo n.º 5
0
        public void loadInvoice()
        {
            ActivityLogModel log      = new ActivityLogModel();
            dynamic          invoices = log.where (log, "model = 'invoice'");

            if (invoices.Count > 0)
            {
                foreach (var invoice in invoices)
                {
                    invoiceList.Rows.Add(invoice.id, invoice.model, invoice.action, invoice.date, invoice.ref_id, invoice.department_id);
                }
            }
        }