Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.SQMSys.Tb_Sys_Role> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.SQMSys.Tb_Sys_Role> modelList = new List <MobileSoft.Model.SQMSys.Tb_Sys_Role>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.SQMSys.Tb_Sys_Role model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new MobileSoft.Model.SQMSys.Tb_Sys_Role();
                    model.RoleCode = dt.Rows[n]["RoleCode"].ToString();
                    if (dt.Rows[n]["StreetCode"].ToString() != "")
                    {
                        model.StreetCode = new Guid(dt.Rows[n]["StreetCode"].ToString());
                    }
                    model.RoleName     = dt.Rows[n]["RoleName"].ToString();
                    model.RoleDescribe = dt.Rows[n]["RoleDescribe"].ToString();
                    if (dt.Rows[n]["IsSysRole"].ToString() != "")
                    {
                        model.IsSysRole = int.Parse(dt.Rows[n]["IsSysRole"].ToString());
                    }
                    model.DepCode     = dt.Rows[n]["DepCode"].ToString();
                    model.SysRoleCode = dt.Rows[n]["SysRoleCode"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.SQMSys.Tb_Sys_Role model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.SQMSys.Tb_Sys_Role model)
 {
     dal.Add(model);
 }