Exemple #1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public bool Update(Model.GroupModules model)
        {
            int rowsAffected;

            IDataParameter[] parameters =
            {
                new SqlParameter("@GroupId",  SqlDbType.Int, 4),
                new SqlParameter("@ModuleId", SqlDbType.Int, 4)
            };
            parameters[0].Value = model.GroupId;
            parameters[1].Value = model.ModuleId;

            DbHelperSql.RunProcedure("T_GroupModules_Update", parameters, out rowsAffected);
            return(rowsAffected > 0);
        }
Exemple #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.GroupModules DataRowToModel(DataRow row)
        {
            var model = new Model.GroupModules();

            if (row != null)
            {
                if (row["GroupId"] != null && row["GroupId"].ToString() != "")
                {
                    model.GroupId = int.Parse(row["GroupId"].ToString());
                }
                if (row["ModuleId"] != null && row["ModuleId"].ToString() != "")
                {
                    model.ModuleId = int.Parse(row["ModuleId"].ToString());
                }
            }
            return(model);
        }
Exemple #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Model.GroupModules model)
 {
     return(_dal.Update(model));
 }