示例#1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <BWS.ERP.Model.sysRolesUserEntity> DataTableToList(DataTable dt)
        {
            List <BWS.ERP.Model.sysRolesUserEntity> modelList = new List <BWS.ERP.Model.sysRolesUserEntity>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                BWS.ERP.Model.sysRolesUserEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new BWS.ERP.Model.sysRolesUserEntity();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["RoleID"].ToString() != "")
                    {
                        model.RoleID = int.Parse(dt.Rows[n]["RoleID"].ToString());
                    }
                    if (dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    model.sUserID        = dt.Rows[n]["sUserID"].ToString();
                    model.sRoleUserID    = dt.Rows[n]["sRoleUserID"].ToString();
                    model.sRoleUserCName = dt.Rows[n]["sRoleUserCName"].ToString();
                    model.sRoleNo        = dt.Rows[n]["sRoleNo"].ToString();
                    model.sRoleCName     = dt.Rows[n]["sRoleCName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BWS.ERP.Model.sysRolesUserEntity model, SqlTransaction trans)
 {
     dal.Update(model, trans);
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BWS.ERP.Model.sysRolesUserEntity model, SqlTransaction trans)
 {
     return(dal.Add(model, trans));
 }
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<BWS.ERP.Model.sysRolesUserEntity> DataTableToList(DataTable dt)
 {
     List<BWS.ERP.Model.sysRolesUserEntity> modelList = new List<BWS.ERP.Model.sysRolesUserEntity>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         BWS.ERP.Model.sysRolesUserEntity model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new BWS.ERP.Model.sysRolesUserEntity();
             if (dt.Rows[n]["ID"].ToString() != "")
             {
                 model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
             }
             if (dt.Rows[n]["RoleID"].ToString() != "")
             {
                 model.RoleID = int.Parse(dt.Rows[n]["RoleID"].ToString());
             }
             if (dt.Rows[n]["UserID"].ToString() != "")
             {
                 model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString());
             }
             model.sUserID = dt.Rows[n]["sUserID"].ToString();
             model.sRoleUserID = dt.Rows[n]["sRoleUserID"].ToString();
             model.sRoleUserCName = dt.Rows[n]["sRoleUserCName"].ToString();
             model.sRoleNo = dt.Rows[n]["sRoleNo"].ToString();
             model.sRoleCName = dt.Rows[n]["sRoleCName"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }