1
13693261870
2024-04-22 9a7f04549c266b922b9fb28f3747f6dc11eeb995
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Terra.YaoGan.Common;
 
namespace Terra.YaoGan.Service
{
   public  class FirstCatlogService
    {
        sqlserverDBhelper DB = new sqlserverDBhelper();
 
        public int Add(string name, string pname)
        {
 
            string id = Guid.NewGuid().ToString("N"); ;
            string s = "SELECT  *  FROM  SecondCatlog  WHERE  name='" + pname + "'";
            DataTable DT = DB.QueryTable(s);
            string pid = DT.Rows[0][0].ToString();
 
            string sql = string.Format("INSERT  INTO  ThirdCatlog VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}');", id, name, DateTime.Now.ToString(), "", "false", "false", "false", pid);
 
            return DB.GetRow(sql);
            // return -1;
        }
 
 
 
 
        public  DataTable GetTable(string  where)
        {
            string sql = " select  ft.name,st.name sname,st.id    from (select  *  from  FirstCatlog  where parentId='" + where+ "') ft  LEFT JOIN SecondCatlog  st  on  ft.id=st.FirstPid ORDER BY  ft.name ;";
            DataTable dt= DB.QueryTable(sql);
            return dt;
        }
 
 
 
 
    }
 
 
}