Пример #1
0
        public ActionResult Index()
        {
            OrderViewModel order = null;

            try
            {
                order = new OrderViewModel();
                List <SelectListItem> selectListItem          = new List <SelectListItem>();
                List <SelectListItem> selectListPaymentStatus = new List <SelectListItem>();
                //Country Drop down bind
                List <CountryViewModel> CounrtyList = Mapper.Map <List <Country>, List <CountryViewModel> >(_masterBusiness.GetAllCountries());
                foreach (CountryViewModel ccl in CounrtyList)
                {
                    selectListItem.Add(new SelectListItem
                    {
                        Text     = ccl.Name,
                        Value    = ccl.Code,
                        Selected = false
                    });
                }
                order.Countries = selectListItem;
                List <PaymentStatusViewModel> paymentstatusListVM = Mapper.Map <List <PaymentStatusMaster>, List <PaymentStatusViewModel> >(_masterBusiness.GetAllPaymentStatus());
                foreach (PaymentStatusViewModel pvm in paymentstatusListVM)
                {
                    selectListPaymentStatus.Add(new SelectListItem
                    {
                        Text     = pvm.Description,
                        Value    = pvm.Code.ToString(),
                        Selected = false
                    });
                }
                order.PaymentStatusList = selectListPaymentStatus;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(View(order));
        }
Пример #2
0
        // GET: Invoices
        public ActionResult Index()
        {
            OrderViewModel                order = new OrderViewModel();
            List <SelectListItem>         selectListPaymentStatus = new List <SelectListItem>();
            List <PaymentStatusViewModel> paymentstatusListVM     = Mapper.Map <List <PaymentStatusMaster>, List <PaymentStatusViewModel> >(_masterBusiness.GetAllPaymentStatus());

            foreach (PaymentStatusViewModel pvm in paymentstatusListVM)
            {
                selectListPaymentStatus.Add(new SelectListItem
                {
                    Text     = pvm.Description,
                    Value    = pvm.Code.ToString(),
                    Selected = false
                });
            }
            order.PaymentStatusList = selectListPaymentStatus;
            return(View(order));
        }