Esempio n. 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(EtNet_Models.PanelMenuList model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update PanelMenuList set ");
            strSql.Append(" num = @num , ");
            strSql.Append(" cname = @cname , ");
            strSql.Append(" imageload = @imageload  ");
            strSql.Append(" where id=@id ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@id",        SqlDbType.Int,      4),
                new SqlParameter("@num",       SqlDbType.VarChar, 20),
                new SqlParameter("@cname",     SqlDbType.VarChar, 40),
                new SqlParameter("@imageload", SqlDbType.VarChar, 200)
            };

            parameters[0].Value = model.id;
            parameters[1].Value = model.num;
            parameters[2].Value = model.cname;
            parameters[3].Value = model.imageload;

            int result = EtNet_DAL.DBHelper.ExecuteCommand(strSql.ToString(), parameters);

            if (result >= 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static bool Add(EtNet_Models.PanelMenuList model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into PanelMenuList(");
            strSql.Append("num,cname,imageload");
            strSql.Append(") values (");
            strSql.Append("@num,@cname,@imageload");
            strSql.Append(") ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@num",       SqlDbType.VarChar, 20),
                new SqlParameter("@cname",     SqlDbType.VarChar, 40),
                new SqlParameter("@imageload", SqlDbType.VarChar, 200)
            };

            parameters[0].Value = model.num;
            parameters[1].Value = model.cname;
            parameters[2].Value = model.imageload;

            int result = EtNet_DAL.DBHelper.ExecuteCommand(strSql.ToString(), parameters);

            if (result >= 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static EtNet_Models.PanelMenuList GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select id, num, cname, imageload  ");
            strSql.Append("  from PanelMenuList ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;


            EtNet_Models.PanelMenuList model = new EtNet_Models.PanelMenuList();
            DataTable tbl = EtNet_DAL.DBHelper.GetDataSet(strSql.ToString(), parameters);

            if (tbl.Rows.Count > 0)
            {
                model.id        = int.Parse(tbl.Rows[0]["id"].ToString());
                model.num       = tbl.Rows[0]["num"].ToString();
                model.cname     = tbl.Rows[0]["cname"].ToString();
                model.imageload = tbl.Rows[0]["imageload"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 新加菜单面板
        /// </summary>
        private void AddPanelMenu(HttpContext context)
        {
            int id = int.Parse(context.Request.QueryString["id"].Trim());

            EtNet_Models.PanelMenuList model = EtNet_BLL.PanelMenuListManager.GetModel(id);
            string str = " founderid=" + ((EtNet_Models.LoginInfo)context.Session["login"]).Id + " AND colsnum='1' ";


            if (model != null)
            {
                int rows = EtNet_BLL.PanelMenuManager.GetList(str).Rows.Count;

                EtNet_Models.PanelMenu menumodel = new EtNet_Models.PanelMenu();
                menumodel.colsnum   = 1;
                menumodel.rowsnum   = rows + 1;
                menumodel.title     = model.cname;
                menumodel.imageload = model.imageload;
                menumodel.direction = model.num;
                menumodel.founderid = ((EtNet_Models.LoginInfo)context.Session["login"]).Id;



                if (EtNet_BLL.PanelMenuManager.Add(menumodel))
                {
                    string strdata = " <div id='portlet" + EtNet_BLL.PanelMenuManager.MaxId().ToString() + "' class='portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'>";
                    strdata += "<div class='portlet-header ui-widget-header ui-corner-all'>";
                    strdata += "<span class='ui-icon-del'></span><span class='ui-icon ui-icon-expand'></span>";
                    strdata += "<span class='ui-icon-edit'></span><span class='ui-icon-refresh'></span><span class='portlet-header-title'>" + model.cname + "</span></div>";
                    strdata += "<div id='content" + model.num + "' class='portlet-content' style='display:block;'>";

                    context.Response.Write(strdata);
                    LoadContentData(context, model.num.Trim());

                    strdata = "</div></div>";
                    context.Response.Write(strdata);
                }
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static bool Update(EtNet_Models.PanelMenuList model)
 {
     return(EtNet_DAL.PanelMenuListService.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static bool Add(EtNet_Models.PanelMenuList model)
 {
     return(EtNet_DAL.PanelMenuListService.Add(model));
 }