Example #1
0
        public async Task <PartialViewResult> CopyModal(long invoiceId)
        {
            IInvoiceAppService invoiceAppService = this._invoiceAppService;
            IdInput <long>     idInput           = new IdInput <long>()
            {
                Id = invoiceId
            };
            CopyInvoiceModalViewModel copyInvoiceModalViewModel = new CopyInvoiceModalViewModel(await invoiceAppService.GetInvoiceForCopy(idInput));
            List <SelectListItem>     selectListItems           = new List <SelectListItem>();

            foreach (Customer customersForBusiness in await this._customerAppServer.GetCustomersForBusiness())
            {
                if (customersForBusiness.Id == copyInvoiceModalViewModel.Invoice.CustomerId)
                {
                    continue;
                }
                List <SelectListItem> selectListItems1 = selectListItems;
                SelectListItem        selectListItem   = new SelectListItem()
                {
                    Text     = string.Concat(customersForBusiness.LastName, ", ", customersForBusiness.FirstName),
                    Value    = customersForBusiness.Id.ToString(),
                    Disabled = false,
                    Selected = false
                };
                selectListItems1.Add(selectListItem);
            }
            List <SelectListItem> selectListItems2 = selectListItems;
            SelectListItem        selectListItem1  = new SelectListItem()
            {
                Text     = "",
                Value    = "",
                Disabled = false
            };

            selectListItems2.Insert(0, selectListItem1);
            this.ViewData["Customers"] = selectListItems;
            return(this.PartialView("_CopyModal", copyInvoiceModalViewModel));
        }