Exemple #1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role DataRowToModel(DataRow row)
 {
     Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role model = new Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role();
     if (row != null)
     {
         if (row["UserGroupId"] != null && row["UserGroupId"].ToString() != "")
         {
             model.UserGroupId = int.Parse(row["UserGroupId"].ToString());
         }
         if (row["RoleId"] != null && row["RoleId"].ToString() != "")
         {
             model.RoleId = int.Parse(row["RoleId"].ToString());
         }
     }
     return(model);
 }
Exemple #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role GetModel()
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select UserGroupId,RoleId from Sys_UserGroup_In_Role ");
            strSql.Append(" where ");
            SQLiteParameter[] parameters =
            {
            };

            Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role model = new Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role();
            DataSet ds = DbHelperSQLite.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }