Exemple #1
0
        public static List <SelectListItem> GetPayCompany(string PayCompany)
        {
            List <SelectListItem> list = new List <SelectListItem>();
            DataTable             dt   = MandateInfoPro.GetPayCompany();

            if (dt == null)
            {
                return(list);
            }
            SelectListItem SelListItem = new SelectListItem();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                SelListItem       = new SelectListItem();
                SelListItem.Text  = dt.Rows[i][0].ToString();
                SelListItem.Value = dt.Rows[i][0].ToString();
                if (dt.Rows[i][0].ToString() == PayCompany)
                {
                    SelListItem.Selected = true;
                }
                list.Add(SelListItem);
            }
            return(list);
        }