Exemple #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);
            }
        }
Exemple #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);
        }
        public static IMenuItem DataModelFactory(string datalayer)
        {
            IMenuItem model;

            switch (datalayer.ToUpper())
            {
            case "DAL2":
                model = new Models.MenuItem();
                break;

            //case "EF":
            //    model = new EF.Item();
            //    break;

            //case "CI":
            //    model = new CI.Item();
            //    break;

            default:
                model = new Data.DAL.MenuItemDAL();
                break;
            }
            return(model);
        }
Exemple #4
0
 /// <summary>
 /// </summary>
 public abstract bool UpdateItem(MenuItemDAL newItem);
Exemple #5
0
 /// <summary>
 /// </summary>
 public abstract int AddItem(int ModuleId, MenuItemDAL newItem);