コード例 #1
0
        public ActionResult CustomerSales()
        {
            CustomerSalesCriteriaModel model = new CustomerSalesCriteriaModel();

            model.Customers.Add(new SelectListItem
            {
                Text  = "All Customers",
                Value = "0"
            });

            foreach (var customer in CustomerHelper.GetCustomers())
            {
                model.Customers.Add(new SelectListItem
                {
                    Text  = customer.CustomerName,
                    Value = customer.Id.ToString()
                });
            }

            //model.Customers = CustomerHelper.GetCustomers().Select(x => new SelectListItem
            //{
            //    Text = x.CustomerName,
            //    Value = x.Id.ToString()
            //}).ToList();

            //if (model.Customers != null && model.Customers.Count() > 0)
            //{
            //    model.CustomerId = Convert.ToInt64(model.Customers.FirstOrDefault().Value);
            //}

            return(View(model));
        }
コード例 #2
0
        public ActionResult CustomerwiseReceiptClearance()
        {
            CustomerSalesCriteriaModel model = new CustomerSalesCriteriaModel();

            model.Customers.Add(new SelectListItem
            {
                Text  = "All Customers",
                Value = "0"
            });

            foreach (var customer in CustomerHelper.GetCustomers())
            {
                model.Customers.Add(new SelectListItem
                {
                    Text  = customer.CustomerName,
                    Value = customer.Id.ToString()
                });
            }

            return(View(model));
        }