public static void Edit(InputInvoiceViewModel source)
        {
            InputInvoice item = InputInvoice.Get(source.Oid, false);

            source.CopyTo(item);
            item.Save();
        }
        public static InputInvoiceViewModel Get(long oid, ETipoAcreedor providerType)
        {
            InputInvoiceViewModel obj = new InputInvoiceViewModel();

            obj.CopyFrom(InputInvoiceInfo.Get(oid, providerType));
            return(obj);
        }
        public static InputInvoiceViewModel New(InputInvoiceInfo source)
        {
            InputInvoiceViewModel obj = new InputInvoiceViewModel();

            obj.CopyFrom(source);
            return(obj);
        }
        public static InputInvoiceViewModel New()
        {
            InputInvoiceViewModel obj = new InputInvoiceViewModel();

            obj.CopyFrom(InputInvoiceInfo.New());
            return(obj);
        }
        public static void Add(InputInvoiceViewModel item)
        {
            InputInvoice newItem = InputInvoice.New();

            item.CopyTo(newItem);
            newItem.Save();
            item.CopyFrom(newItem);
        }
        public static InputInvoiceViewModel Get(long oid, ETipoAcreedor providerType, bool childs = false)
        {
            InputInvoiceViewModel obj     = new InputInvoiceViewModel();
            InputInvoiceInfo      invoice = InputInvoiceInfo.Get(oid, providerType, childs);

            if (invoice == null)
            {
                return(null);
            }

            obj.CopyFrom(invoice);

            if (childs)
            {
                obj.Lines = InputInvoiceLineListViewModel.Get(invoice.Conceptos);
            }

            return(obj);
        }