Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<AutekInfo.Model.M_Menu_Auth> DataTableToList(DataTable dt)
        {
            List<AutekInfo.Model.M_Menu_Auth> modelList = new List<AutekInfo.Model.M_Menu_Auth>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                AutekInfo.Model.M_Menu_Auth model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new AutekInfo.Model.M_Menu_Auth();
                                                    if(dt.Rows[n]["id"].ToString()!="")
                {
                    model.id=int.Parse(dt.Rows[n]["id"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["auth_id"].ToString()!="")
                {
                    model.auth_id=int.Parse(dt.Rows[n]["auth_id"].ToString());
                }
                                                                                                                                                model.menu_options= dt.Rows[n]["menu_options"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Пример #2
0
 public int SetMenu2Auth()
 {
     string auth_id = Request["auth_id"].ToString();
     string menuoption = Request["menuids"].ToString();
     menuoption = menuoption.Remove(menuoption.Length - 1, 1);
     string[] arrop = menuoption.Split(',');
     var b = new AutekInfo.BLL.M_Menu_Auth();
     var list = new List<AutekInfo.Model.M_Menu_Auth>();
     foreach (string op in arrop)
     {
         var m=new AutekInfo.Model.M_Menu_Auth();
         m.auth_id=int.Parse(auth_id);
         m.menu_options=op;
         list.Add(m);
     }
     return b.AddModelList(list);
 }