Exemplo n.º 1
0
        public void InsertQAOCRData(DataTable dt)
        {
            SOQ_DETAILS soq = new SOQ_DETAILS();
            try
            {
                foreach (DataRow eachRow in dt.Rows)
                {
                    soq.ADDENDA_NBR = eachRow["ADDENDA_NBR"].ToString();
                    soq.DODGE_PROJ_NBR = eachRow["DODGE_PROJ_NBR"].ToString();
                    soq.PDF_FILE_SIZE_BYTES = eachRow["PDF_FILE_SIZE_BYTES"].ToString();
                    soq.QUEUE_TIMESTAMP = eachRow["QUEUE_TIMESTAMP"].ToString();
                    soq.SBP_OCR_XML = eachRow["SBP_OCR_XML"].ToString();
                    soq.TITLE_CODE = eachRow["TITLE_CODE"].ToString();
                    soq.VER_NBR = eachRow["VER_NBR"].ToString();

                    OracleHelper helper = new OracleHelper();
                    helper.InsertQAOCRData(soq);

                    XElement statusXML = XElement.Load(string.Format(@"{0}\StatusXML\status.xml", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)));
                    statusXML.XPathSelectElement("//last-queue-timestamp").SetValue((eachRow["QUEUE_TIMESTAMP"].ToString()));
                    statusXML.Save(string.Format(@"{0}\StatusXML\status.xml", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)));
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 2
0
        public DataTable GetProdOCRData()
        {
            string value = "1";
            string startDate;
            string endDate;
            DataTable prodOCRtb = new DataTable();
            string queryName = string.Empty;
            try
            {
                XElement statusXML = XElement.Load(string.Format(@"{0}\StatusXML\status.xml", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)));
                var da = statusXML.XPathSelectElement("//last-queue-timestamp['"+value+"']/@name");
                if (!string.IsNullOrEmpty(statusXML.XPathSelectElement("//last-queue-timestamp").Value))
                {
                    startDate = "TO_DATE ('" + Convert.ToDateTime(statusXML.XPathSelectElement("//last-queue-timestamp").Value).ToString("yyyyMMddHHmmss") + "','YYYYMMDDHH24MISS')";
                    queryName = "PROD_OCR_QUERY.sql";
                }
                else
                {
                    startDate = "TO_DATE ('" + DateTime.Now.ToString("yyyyMMddHHmmss") + "','YYYYMMDDHH24MISS')";
                    queryName = "PROD_OCR_QUERY_1.sql";
                }
                OracleHelper oracleHelper = new OracleHelper();
                 endDate= "TO_DATE ('" + DateTime.Now.ToString("yyyyMMddHHmmss") + "','YYYYMMDDHH24MISS')";
                DataSet prodOCRData = oracleHelper.GetProdOCRData(queryName, startDate, endDate);
                if (prodOCRData != null)
                {
                    prodOCRtb = prodOCRData.Tables[0];
                }
            }
            catch (Exception e)
            {

                throw;
            }

            return prodOCRtb;
        }