Ejemplo n.º 1
0
    void Awake()
    {
        if (checkpoint)
        {
            Persistor.Save(SceneManager.GetActiveScene().name);
        }

        Author author = FindObjectOfType <Author>();

        if (author.pageNumber > 0)
        {
            pageNumber = author.pageNumber;
        }

        if (!author.showImage)
        {
            contentWait = 0;
        }
    }
Ejemplo n.º 2
0
        public virtual Data.Model.Invoice Save(Guid userId, Data.Model.Invoice invoice)
        {
            if (userId == Guid.Empty)
            {
                throw new ArgumentException("User id most be specified to save an invoice");
            }

            if (invoice.Client_Id == Guid.Empty)
            {
                throw new ArgumentException("Client id most be specified to save an invoice");
            }

            var isNew  = invoice.Id == Guid.Empty;
            var result = Persistor.Save(invoice);

            if (!isNew)
            {
                Persistor.Commit();
                (Persistor as Data.Persistor.Invoice).UpdateUserId(userId, invoice.Id);
                return(result);
            }

            foreach (var item in invoice.Items)
            {
                item.Invoice_Id = result.Id;
                InvoiceItemPersistor.Save(item);
            }

            Persistor.Commit();
            if (invoice.Items.Any())
            {
                InvoiceItemPersistor.Commit();
            }
            (Persistor as Data.Persistor.Invoice).UpdateUserId(userId, invoice.Id);

            return(result);
        }