コード例 #1
0
 //查格口状态
 public bool SelectState(string plcid, string code)
 {
     try
     {
         DataTable tb     = new DataTable();
         string    sqlStr = "SELECT  * FROM t_prot where prot=(select prot from t_djmx WHERE ExpressNo='" + code + "'and plcid='" + plcid + "') ";
         tb = SqliteDbHelp.Query(sqlStr, null);
         if (tb != null)
         {
             if (tb.Rows.Count > 0)
             {
                 if (tb.Rows[0]["sts"].ToString() == "0")
                 {
                     return(false);
                 }
                 else
                 {
                     return(true);
                 }
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #2
0
        public DataTable SelectOldData()
        {
            string selectStr = "select    ExpressNo,plcid  from t_djmx  order by djsj desc limit 0,5 ";

            try
            {
                //DataSet data = SqliteDbHelp.ExecuteDataSet(sqlStr);
                DataTable currentDt = SqliteDbHelp.Query(selectStr, null);
                return(currentDt);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
コード例 #3
0
        //查询格口号状态为 1或2的格口
        public DataTable GetProtSend()
        {
            //1代表还没传送给WMS   2代表已经传送给WMS
            string sqlStr = "select * from  t_prot where  datasts='1'  ";

            try
            {
                DataTable currentDt = SqliteDbHelp.Query(sqlStr, null);
                return(currentDt);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
コード例 #4
0
        //查询前200条条码数据
        public DataTable TwohundredData()
        {
            string selectStr = "select * from t_djmx order by djsj desc limit 0,100  ";

            //string sqlStr = "select top 200 * from t_djmx order by djsj desc ;select prot,(case sts when '0' then'解锁' when '1' then '锁定' end) sts,count from t_prot   ";
            try
            {
                DataTable currentDt = SqliteDbHelp.Query(selectStr, null);
                return(currentDt);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
コード例 #5
0
        //查询格口状态、数量
        public DataTable GetTaskData()
        {
            string selectStr = "select prot,(case sts when '0' then'解锁' when '1' then '锁定' end) sts,count from t_prot ";

            //string sqlStr = "select top 200 * from t_djmx order by djsj desc ;select prot,(case sts when '0' then'解锁' when '1' then '锁定' end) sts,count from t_prot   ";
            try
            {
                //DataSet data = SqliteDbHelp.ExecuteDataSet(sqlStr);
                DataTable currentDt = SqliteDbHelp.Query(selectStr, null);
                return(currentDt);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
コード例 #6
0
 //查询实际格口是否写入
 public DataTable MatchingData()
 {
     lock (this)
     {
         //1代表还没匹配到DB块的值   2代表已经匹配到值
         string sqlStr = "Select * from t_protstate where state='1'  ";
         try
         {
             DataTable currentDt = SqliteDbHelp.Query(sqlStr, null);
             return(currentDt);
         }
         catch (Exception ex)
         {
             return(null);
         }
     }
 }
コード例 #7
0
        // 根据 快递单号模糊查询
        public DataTable queryByExpressNo(string expressNo, string start, string end)
        {
            DataTable tb = new DataTable();

            try
            {
                string sqlStr = "select * from t_djmx where ExpressNo like '%" + expressNo + "' " +
                                " and (djsj between '" + start + "' and '" + end +
                                "') order by djsj desc";
                tb = SqliteDbHelp.Query(sqlStr, null);
                return(tb);
            }
            catch (Exception ex)
            {
                //SystemCommon.WriteLog("异常:" + ex.Message.ToString());
                return(null);
            }
        }
コード例 #8
0
 public DataTable GetPlcSednCode()
 {
     lock (this)
     {
         //1代表还没传送给WMS   2代表已经传送给WMS
         string sqlStr = "Select * from t_djmx where endsts='1'  ";
         try
         {
             DataTable currentDt = SqliteDbHelp.Query(sqlStr, null);
             return(currentDt);
         }
         catch (Exception ex)
         {
             //SystemCommon.WriteLog("异常:" + ex.Message.ToString());
             return(null);
         }
     }
 }