Ejemplo n.º 1
0
        public void UpdateNode(Ncu.jsj.Model.SysNode node)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update S_Tree set ");
            strSql.Append("Text='" + node.Text + "',");
            strSql.Append("ParentID=" + node.ParentID.ToString() + ",");
            strSql.Append("Location='" + node.Location + "',");
            strSql.Append("OrderID=" + node.OrderID + ",");
            strSql.Append("comment='" + node.Comment + "',");
            strSql.Append("Url='" + node.Url + "',");
            strSql.Append("PermissionID=" + node.PermissionID + ",");
            strSql.Append("ImageUrl='" + node.ImageUrl + "'");
            strSql.Append(" where NodeID=" + node.NodeID);
            DbHelperOra.ExecuteSql(strSql.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到菜单节点
        /// </summary>
        /// <param name="NodeID"></param>
        /// <returns></returns>
        public Ncu.jsj.Model.SysNode GetNode(int NodeID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * from S_Tree ");
            strSql.Append(" where NodeID=@NodeID");

            SqlParameter[] parameters =
            {
                new SqlParameter("@NodeID", SqlDbType.Int, 4)
            };
            parameters[0].Value = NodeID;

            Ncu.jsj.Model.SysNode node = new Ncu.jsj.Model.SysNode();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                node.NodeID = int.Parse(ds.Tables[0].Rows[0]["NodeID"].ToString());
                node.Text   = ds.Tables[0].Rows[0]["text"].ToString();
                if (ds.Tables[0].Rows[0]["ParentID"].ToString() != "")
                {
                    node.ParentID = int.Parse(ds.Tables[0].Rows[0]["ParentID"].ToString());
                }
                node.Location = ds.Tables[0].Rows[0]["Location"].ToString();
                if (ds.Tables[0].Rows[0]["OrderID"].ToString() != "")
                {
                    node.OrderID = int.Parse(ds.Tables[0].Rows[0]["OrderID"].ToString());
                }
                node.Comment = ds.Tables[0].Rows[0]["comment"].ToString();
                node.Url     = ds.Tables[0].Rows[0]["url"].ToString();
                if (ds.Tables[0].Rows[0]["PermissionID"].ToString() != "")
                {
                    node.PermissionID = int.Parse(ds.Tables[0].Rows[0]["PermissionID"].ToString());
                }
                node.ImageUrl = ds.Tables[0].Rows[0]["ImageUrl"].ToString();

                return(node);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
        public void UpdateNode(Ncu.jsj.Model.SysNode model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update S_Tree set ");
            strSql.Append("Text=@Text,");
            strSql.Append("ParentID=@ParentID,");
            strSql.Append("Location=@Location,");
            strSql.Append("OrderID=@OrderID,");
            strSql.Append("comment=@comment,");
            strSql.Append("Url=@Url,");
            strSql.Append("PermissionID=@PermissionID,");
            strSql.Append("ImageUrl=@ImageUrl");
            strSql.Append(" where NodeID=@NodeID");

            SqlParameter[] parameters =
            {
                new SqlParameter("@NodeID",       SqlDbType.Int,       4),
                new SqlParameter("@Text",         SqlDbType.VarChar, 100),
                new SqlParameter("@ParentID",     SqlDbType.Int,       4),
                new SqlParameter("@Location",     SqlDbType.VarChar,  50),
                new SqlParameter("@OrderID",      SqlDbType.Int,       4),
                new SqlParameter("@comment",      SqlDbType.VarChar,  50),
                new SqlParameter("@Url",          SqlDbType.VarChar, 100),
                new SqlParameter("@PermissionID", SqlDbType.Int,       4),
                new SqlParameter("@ImageUrl",     SqlDbType.VarChar, 100)
            };
            parameters[0].Value = model.NodeID;
            parameters[1].Value = model.Text;
            parameters[2].Value = model.ParentID;
            parameters[3].Value = model.Location;
            parameters[4].Value = model.OrderID;
            parameters[5].Value = model.Comment;
            parameters[6].Value = model.Url;
            parameters[7].Value = model.PermissionID;
            parameters[8].Value = model.ImageUrl;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 4
0
        public int AddTreeNode(Ncu.jsj.Model.SysNode node)
        {
            node.NodeID = GetMaxId();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into S_Tree(");
            strSql.Append("NodeID,Text,ParentID,Location,OrderID,comment,Url,PermissionID,ImageUrl)");
            strSql.Append(" values (");
            strSql.Append("'" + node.NodeID + "',");
            strSql.Append("'" + node.Text + "',");
            strSql.Append("" + node.ParentID + ",");
            strSql.Append("'" + node.Location + "',");
            strSql.Append("" + node.OrderID + ",");
            strSql.Append("'" + node.Comment + "',");
            strSql.Append("'" + node.Url + "',");
            strSql.Append("" + node.PermissionID + ",");
            strSql.Append("'" + node.ImageUrl + "'");
            strSql.Append(")");
            DbHelperOra.ExecuteSql(strSql.ToString());
            return(node.NodeID);
        }
Ejemplo n.º 5
0
        public int AddTreeNode(Ncu.jsj.Model.SysNode model)
        {
            model.NodeID = GetMaxId();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into S_Tree(");
            strSql.Append("NodeID,Text,ParentID,Location,OrderID,comment,Url,PermissionID,ImageUrl)");
            strSql.Append(" values (");
            strSql.Append("@NodeID,@Text,@ParentID,@Location,@OrderID,@comment,@Url,@PermissionID,@ImageUrl)");

            //
            SqlParameter[] parameters =
            {
                new SqlParameter("@NodeID",       SqlDbType.Int,       4),
                new SqlParameter("@Text",         SqlDbType.VarChar, 100),
                new SqlParameter("@ParentID",     SqlDbType.Int,       4),
                new SqlParameter("@Location",     SqlDbType.VarChar,  50),
                new SqlParameter("@OrderID",      SqlDbType.Int,       4),
                new SqlParameter("@comment",      SqlDbType.VarChar,  50),
                new SqlParameter("@Url",          SqlDbType.VarChar, 100),
                new SqlParameter("@PermissionID", SqlDbType.Int,       4),
                new SqlParameter("@ImageUrl",     SqlDbType.VarChar, 100)
            };
            parameters[0].Value = model.NodeID;
            parameters[1].Value = model.Text;
            parameters[2].Value = model.ParentID;
            parameters[3].Value = model.Location;
            parameters[4].Value = model.OrderID;
            parameters[5].Value = model.Comment;
            parameters[6].Value = model.Url;
            parameters[7].Value = model.PermissionID;
            parameters[8].Value = model.ImageUrl;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            return(model.NodeID);
        }