コード例 #1
0
        public JsonResult GetTransferCurrency()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadCurrencies().OrderBy(o => o.Name).Select(c => new { TransferCurrencyID = c.ID, TransferCurrency = c.Name }).OrderBy(o => o.TransferCurrency), JsonRequestBehavior.AllowGet);
        }
コード例 #2
0
        public static SelectList Getcurrencydropdown(string CurrencyID)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            var currency = modelRepo.ReadCurrencies();
            if (CurrencyID == null || CurrencyID == "0")
            {
                CurrencyID = "1";
            }
            List<SelectListItem> _Listpenaltrate = new List<SelectListItem>();

            foreach (var item in currency)
            {
                SelectListItem itr = new SelectListItem();
                itr.Text = item.Name;
                itr.Value = item.ID.ToString();
                itr.Selected = false;

                _Listpenaltrate.Add(itr);
            }

            return new SelectList(_Listpenaltrate, "Value", "Text", CurrencyID);
        }
コード例 #3
0
        public static SelectList Getunitcurrencydropdown(int CurrencyID)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            var penaltyrate = modelRepo.ReadCurrencies();

            List<SelectListItem> _Listpenaltrate = new List<SelectListItem>();

            foreach (var item in penaltyrate)
            {
                SelectListItem itr = new SelectListItem();
                itr.Text = item.Name;
                itr.Value = item.ID.ToString();
                itr.Selected = false;

                _Listpenaltrate.Add(itr);
            }

            return new SelectList(_Listpenaltrate, "Value", "Text", CurrencyID);
        }
コード例 #4
0
        public static SelectList GetCurrency(int CurrencyID)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            var Currency = modelRepo.ReadCurrencies();

            List<SelectListItem> _ListCurrency = new List<SelectListItem>();

                foreach (var item in Currency)
                {
                    SelectListItem itr = new SelectListItem();
                    itr.Text = item.Name;
                    itr.Value = item.ID.ToString();
                    itr.Selected = false;

                    _ListCurrency.Add(itr);
                }

            return new SelectList(_ListCurrency, "Value", "Text", CurrencyID);
        }