public ActionResult Create(long?id)
        {
            var viewModel = new InvoiceViewModel
            {
                Categories     = categoryService.GetAll(),
                Currencies     = currencyService.GetAll(),
                Customers      = customerService.GetAll(),
                Items          = itemService.GetAll(),
                Taxes          = taxService.GetAll(),
                DefaultSetting = defaultService.GetByUserId(LogedInUser.Id),
                Invoice_Number = id > 0 ? string.Empty : invoiceService.GenerateInvoiceNumber(),
                Invoice        = id > 0 ? invoiceService.GetById(id ?? 0) : new Invoice()
            };

            return(View(viewModel));
        }
Exemple #2
0
        public ActionResult Create(long?id)
        {
            var viewModel = new BillViewModel
            {
                Categories     = categoryService.GetAll(),
                Currencies     = currencyService.GetAll(),
                Vendors        = vendorService.GetAll(),
                Items          = itemService.GetAll(),
                Taxes          = taxService.GetAll(),
                DefaultSetting = defaultService.GetByUserId(LogedInUser.Id),
                Bill           = id > 0 ? billService.GetById((long)id) : new Bill
                {
                    Number = billService.GenerateBillNumber()
                }
            };

            return(View(viewModel));
        }
Exemple #3
0
        public ActionResult GetDefaultSettings()
        {
            var defaultSettings = defaultService.GetByUserId(LogedInUser.Id);

            return(Json(defaultSettings, JsonRequestBehavior.AllowGet));
        }