Пример #1
0
        /// <summary>
        /// </summary>
        public override bool UpdateItem(MenuItemDAL newItem)
        {
            try
            {
                ArrayList      parms   = newItem.GetPropertiesToSQLParms(SQLAction.UPDATE);
                SqlParameter[] slParms = (SqlParameter[])parms.ToArray(typeof(SqlParameter));

                SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, GetFullyQualifiedName("UpdateItem"), slParms);
                return(true);
            }
            catch (Exception ex)
            {
                DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// </summary>
        public override int AddItem(int moduleId, MenuItemDAL newItem)
        {
            int result = 0, itemId = 0;

            try
            {
                ArrayList    parms       = newItem.GetPropertiesToSQLParms(SQLAction.INSERT);
                SqlParameter prmNewEVOut = new SqlParameter("MenuItemId", 0);
                prmNewEVOut.Direction = ParameterDirection.Output;
                parms.Insert(0, prmNewEVOut);

                SqlParameter[] slParms = (SqlParameter[])parms.ToArray(typeof(SqlParameter));

                result = SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, GetFullyQualifiedName("AddItem"), slParms);
                itemId = Convert.ToInt32(slParms[0].Value);
            }
            catch (Exception ex)
            {
                DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
            }
            return(itemId);
        }