Beispiel #1
0
        /// <summary>
        /// 添加/修改权限组
        /// </summary>
        public void AddGroupModel()
        {
            int groupid = RequestHelper.GetRequestInt("admingroup-groupid", 0);
            string groupname = RequestHelper.GetRequestStr("admingroup-groupname", "");
            string describe = RequestHelper.GetRequestStr("admingroup-describe", "");
            string groupauth = RequestHelper.GetRequestStr("admingroup-groupauth", "");

            AdminGroupInfo ainfo = new AdminGroupInfo();
            ainfo.GroupName = groupname;
            ainfo.Describe = describe;
            ainfo.GroupAuth = groupauth;
            ainfo.CreateTime = DateTime.Now;
            ainfo.AdminID = adminInfo.AdminID;
            if (groupid == 0)//添加
            {
                adminGroup.Add(ainfo);
                log.Add(new SysLogInfo("权限组管理", "添加", "添加名称为【" + groupname + "】的权限组信息", Function.GetIP(), adminInfo.AdminID, adminInfo.AdminName, DateTime.Now));
                AjaxMsg.msg = "\"msg\":\"添加成功\"";
            }
            else//修改
            {
                ainfo.GroupID = groupid;
                adminGroup.Update(ainfo);
                log.Add(new SysLogInfo("权限组管理", "修改", "修改编号为【" + groupid + "】的权限组名称为", Function.GetIP(), adminInfo.AdminID, adminInfo.AdminName, DateTime.Now));
                AjaxMsg.msg = "\"msg\":\"修改成功\"";
            }
        }
Beispiel #2
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<YK.Model.AdminGroupInfo> DataTableToList(DataTable dt)
 {
     List<YK.Model.AdminGroupInfo> modelList = new List<YK.Model.AdminGroupInfo>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         YK.Model.AdminGroupInfo model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new YK.Model.AdminGroupInfo();
             if(dt.Rows[n]["GroupID"]!=null && dt.Rows[n]["GroupID"].ToString()!="")
             {
                 model.GroupID=int.Parse(dt.Rows[n]["GroupID"].ToString());
             }
             if(dt.Rows[n]["GroupName"]!=null && dt.Rows[n]["GroupName"].ToString()!="")
             {
             model.GroupName=dt.Rows[n]["GroupName"].ToString();
             }
             if(dt.Rows[n]["Describe"]!=null && dt.Rows[n]["Describe"].ToString()!="")
             {
             model.Describe=dt.Rows[n]["Describe"].ToString();
             }
             if(dt.Rows[n]["GroupAuth"]!=null && dt.Rows[n]["GroupAuth"].ToString()!="")
             {
             model.GroupAuth=dt.Rows[n]["GroupAuth"].ToString();
             }
             if(dt.Rows[n]["CreateTime"]!=null && dt.Rows[n]["CreateTime"].ToString()!="")
             {
                 model.CreateTime=DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
             }
             if(dt.Rows[n]["AdminID"]!=null && dt.Rows[n]["AdminID"].ToString()!="")
             {
                 model.AdminID=int.Parse(dt.Rows[n]["AdminID"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }