Beispiel #1
0
 public void Init(SqlConnection conn, ArrayList allTreeNode)
 {
     m_AllScriptTreeNode = allTreeNode;
     Conn = conn;
     sqlDB = new SqlDb();
     sqlDB.SetConnection(Conn);           
 }
Beispiel #2
0
        private void fillListBox(ListBox lb, string fieldid, string tabid, string curCode)
        {
            if (this.m_conn == null)
            {
                return;
            }
            SqlDb sdb = new SqlDb();

            sdb.SetConnection(this.m_conn);
            string sql = "";

            if (fieldid == "0")
            {
                sql = string.Format("select logid,scriptcode,logtime,reason,author from sys_scriptstore_log where (fieldid is NULL or fieldid=0) and modtabid={0} order by logtime", tabid);
            }
            else
            {
                sql = string.Format("select logid,scriptcode,logtime,reason,author from sys_scriptstore_log where fieldid={0} and modtabid={1} order by logtime", fieldid, tabid);
            }
            DataSet ds = sdb.ExeSqlDs(sql, "script");

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                int     id      = int.Parse(r["logid"].ToString().Trim());
                string  logtime = r["logtime"].ToString().Trim();
                string  reason  = r["reason"].ToString().Trim();
                string  author  = r["author"].ToString().Trim();
                Byte[]  ab      = r["scriptcode"] as Byte[];
                string  strCode = ab == null? "" : Encoding.UTF8.GetString(ab);
                hisItem hi      = new hisItem(id, logtime, strCode, reason, author);
                lb.Items.Add(hi);
            }
            hisItem hi1 = new hisItem(curCode);

            lb.Items.Add(hi1);
        }
Beispiel #3
0
 private void fillListBox(ListBox lb, string fieldid, string tabid, string curCode)
 {
     if (this.m_conn == null) return;
     SqlDb sdb = new SqlDb();
     sdb.SetConnection(this.m_conn);
     string sql = "";
     if(fieldid == "0")
     {
         sql = string.Format("select logid,scriptcode,logtime,reason,author from sys_scriptstore_log where (fieldid is NULL or fieldid=0) and modtabid={0} order by logtime", tabid);
     }
     else
     {
         sql = string.Format("select logid,scriptcode,logtime,reason,author from sys_scriptstore_log where fieldid={0} and modtabid={1} order by logtime", fieldid, tabid);
     }
     DataSet ds = sdb.ExeSqlDs(sql, "script");
     foreach (DataRow r in ds.Tables[0].Rows)
     {
         int id = int.Parse(r["logid"].ToString().Trim());
         string logtime = r["logtime"].ToString().Trim();
         string reason = r["reason"].ToString().Trim();
         string author = r["author"].ToString().Trim();
         Byte[] ab = r["scriptcode"] as Byte[];
         string strCode = ab == null? "" : Encoding.UTF8.GetString(ab);
         hisItem hi = new hisItem(id, logtime, strCode, reason, author);
         lb.Items.Add(hi);
     }
     hisItem hi1 = new hisItem(curCode);
     lb.Items.Add(hi1);
 }