Esempio n. 1
0
        public static List <SelectListItem> PositionAgent(int?defaultValue)
        {
            List <SelectListItem> list = new List <SelectListItem>();

            var data = new PositionRepository().GetPositionAgent();

            foreach (var item in data)
            {
                SelectListItem select = new SelectListItem();
                select.Value    = item.PoAID.ToString();
                select.Text     = item.PoAName;
                select.Selected = defaultValue.HasValue ? (item.PoAID == defaultValue ? true : false) : false;
                list.Add(select);
            }
            return(list);
        }
Esempio n. 2
0
        public static List <SelectListItem> GetPosition(int?defaultValue, int?typeid, bool isActive)
        {
            List <SelectListItem> list = new List <SelectListItem>();

            var data = new PositionRepository().GetByType(typeid);

            if (isActive == true)
            {
                data = data.Where(m => m.PoStatus == true).ToList();
            }

            foreach (var item in data)
            {
                SelectListItem select = new SelectListItem();
                select.Value    = item.PoID.ToString();
                select.Text     = " (" + item.PoCode + ") " + item.PoName;
                select.Selected = defaultValue.HasValue ? (item.PoID == defaultValue ? true : false) : false;
                list.Add(select);
            }
            return(list);
        }