Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.Sys.Tb_Sys_UserRole> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.Sys.Tb_Sys_UserRole> modelList = new List <MobileSoft.Model.Sys.Tb_Sys_UserRole>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.Sys.Tb_Sys_UserRole model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Sys.Tb_Sys_UserRole();
                    if (dt.Rows[n]["UserRoleCode"].ToString() != "")
                    {
                        model.UserRoleCode = new Guid(dt.Rows[n]["UserRoleCode"].ToString());
                    }
                    model.UserCode = dt.Rows[n]["UserCode"].ToString();
                    model.RoleCode = dt.Rows[n]["RoleCode"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Sys.Tb_Sys_UserRole model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.Sys.Tb_Sys_UserRole model)
 {
     dal.Add(model);
 }