Ejemplo n.º 1
0
        public ActionResult ChangeState(Invoice invoice, InvoiceStateEnum state)
        {
            Invoice        invoic = invoiceProvider.ChangeState(invoice, state);
            InvoiceApiPoco retour = new InvoiceApiPoco(invoic);

            return(Json(retour, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
 public Invoice ChangeState(Invoice invoice, InvoiceStateEnum newstate)
 {
     try
     {
         invoice.InvoiceState = newstate;
         base.SaveBubble(invoice);
         return(invoice);
     }
     catch (Exception ex) { throw new Exception("ChangeState " + ex.Message, ex); }
 }
        public void SelectInvoiceState(InvoiceStateEnum invoiceStateEnum)
        {
            switch (invoiceStateEnum)
            {
            case InvoiceStateEnum.SAVED_AS_DRAFT: _saveAsDraftRadio.Click();
                break;

            case InvoiceStateEnum.APPROVED: _approveRadio.Click();
                break;

            case InvoiceStateEnum.APPROVED_FOR_SENDING: _approveForSendingRadio.Click();
                break;
            }
        }
        internal RepeatingInvoicesPage AddNewRepeatingInvoice(string invoiceRecipient, InvoiceStateEnum invoiceState)
        {
            var invoiceDate = DateTime.Today.AddMonths(1).ToString("dd MMM yyyy");
            var dueDateDay  = 1;
            var description = Guid.NewGuid().ToString("N");

            SelectInvoiceState(invoiceState);
            SetInvoiceTo(invoiceRecipient);
            AddDescription(0, description);
            SetInvoiceDate(invoiceDate);
            SetDueDate(dueDateDay);

            return(Save());
        }