Пример #1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public KryptonAccessController.AccessDataBase.Model.ManagerRightList DataRowToModel(DataRow row)
 {
     KryptonAccessController.AccessDataBase.Model.ManagerRightList model=new KryptonAccessController.AccessDataBase.Model.ManagerRightList();
     if (row != null)
     {
         if(row["ManagerRightListID"]!=null && row["ManagerRightListID"].ToString()!="")
         {
             model.ManagerRightListID=int.Parse(row["ManagerRightListID"].ToString());
         }
         if(row["ManagerID"]!=null && row["ManagerID"].ToString()!="")
         {
             model.ManagerID=int.Parse(row["ManagerID"].ToString());
         }
         if(row["MenuID"]!=null && row["MenuID"].ToString()!="")
         {
             model.MenuID=int.Parse(row["MenuID"].ToString());
         }
     }
     return model;
 }
Пример #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public KryptonAccessController.AccessDataBase.Model.ManagerRightList GetModel(int ManagerRightListID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 ManagerRightListID,ManagerID,MenuID from ManagerRightList ");
            strSql.Append(" where [email protected] ");
            SqlParameter[] parameters = {
                    new SqlParameter("@ManagerRightListID", SqlDbType.Int,4)			};
            parameters[0].Value = ManagerRightListID;

            KryptonAccessController.AccessDataBase.Model.ManagerRightList model=new KryptonAccessController.AccessDataBase.Model.ManagerRightList();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }