Exemple #1
0
        public void UpdatePID(T_Doc Tdoc, T_DocTree NewTdoctree)
        {
            string sql = string.Empty;

            sql = "update t_doc set " + " DOCTREE_ID ='" + NewTdoctree.Id + "' " + "  where ID=" + Tdoc.Id;
            gt.SetBySQL(sql);
        }
        public void DeleteById(T_DocTree DT)
        {
            if (DT.Id == 0 || DT.Id == 1)
            {
                return;
            }

            gt.SetBySQL("DELETE FROM T_DOCTREE WHERE ID=" + DT.Id);
        }
        public List <T_DocTree> GetDocTreeByPID(string PID)
        {
            List <T_DocTree> tl = new List <T_DocTree>();
            DataTable        dt = gt.GetTableBySQL("SELECT * from T_DocTree where PID=" + PID);


            foreach (DataRow item in dt.Rows)  //loop through the columns.
            {
                T_DocTree TDocTree = new T_DocTree();

                TDocTree.Id        = int.Parse(item["Id"].ToString());
                TDocTree.PId       = int.Parse(item["pId"].ToString());
                TDocTree.NodeTitle = item["NodeTitle"].ToString();
                TDocTree.NodeType  = int.Parse(item["NodeType"].ToString());

                tl.Add(TDocTree);
            }
            return(tl);
        }
 public void UpdateTitle(T_DocTree DT)
 {
     gt.SetBySQL("UPDATE	T_DOCTREE SET NodeTitle='" + DT.NodeTitle + "' WHERE ID=" + DT.Id);
 }
 public int AddNodeAndGetId(T_DocTree DT)
 {
     // string sql = "SELECT last_insert_rowid()";
     gt.SetBySQL("INSERT INTO T_DOCTREE	(ID,PID, NodeTitle, NodeType)VALUES (null,"+ DT.PId + ",' " + DT.NodeTitle + "', '" + DT.NodeType.ToString() + "')");
     return(int.Parse(gt.GetLastInsertID("T_DOCTREE")));
 }