Example #1
0
        public void SendGOCErrorMail(String strTo, string strFrom, string strSubject, string strBody, bool IsBodyHTML)
        {
            ISBL.General oISBLGen        = new ISBL.General();
            Thread       threadSendMails = new Thread(delegate() { oISBLGen.sendemail(strTo, strFrom, strSubject, strBody, IsBodyHTML); });

            threadSendMails.IsBackground = true;
            threadSendMails.Start();
            //oISBLGen = null;
        }
Example #2
0
        public DataSet listCases(string strLoginID, DateTime fromDate, DateTime toDate, string ReportType, out string strMessage, bool blnSaveEventLog)
        {
            Boolean blnStatus = false;
            DataSet ds        = new DataSet();

            try
            {
                SqlCommand myCmd = new SqlCommand();
                myCmd.Connection  = conn.Connection;
                myCmd.CommandText = "sp_WSAPIlistCases";
                myCmd.CommandType = CommandType.StoredProcedure;

                myCmd.Parameters.Add("@fromDate", SqlDbType.DateTime);
                myCmd.Parameters["@fromDate"].Value = fromDate;

                myCmd.Parameters.Add("@toDate", SqlDbType.DateTime);
                myCmd.Parameters["@toDate"].Value = toDate;

                myCmd.Parameters.Add("@ReportType", SqlDbType.VarChar, 50);
                myCmd.Parameters["@ReportType"].Value = ReportType;


                myCmd.Parameters.Add("@LoginID", SqlDbType.VarChar, 15);
                myCmd.Parameters["@LoginID"].Value = strLoginID;

                SqlDataAdapter sda = new SqlDataAdapter();
                sda.SelectCommand = myCmd;
                conn.Open();
                conn.callingMethod = "ISBL.WSAPI.sp_WSAPIlistCases";
                ds = conn.FillDataSet(sda);
                conn.Close();
                myCmd.Dispose();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    blnStatus   = true;
                    strMessage  = "<Result>true</Result>";
                    strMessage += "<MessageOut>";
                    strMessage += "<FromDate>" + fromDate + "</FromDate><ToDate>" + toDate + "</ToDate><ReportType>" + ReportType + "</ReportType><Error/>";
                    strMessage += "</MessageOut>";
                }
                else
                {
                    strMessage  = "<Result>false</Result>";
                    strMessage += "<MessageOut>";
                    strMessage += "<FromDate>" + fromDate + "</FromDate><ToDate>" + toDate + "</ToDate><ReportType>" + ReportType + "</ReportType><Error>No record exists.</Error>";
                    strMessage += "</MessageOut>";
                    blnStatus   = false;
                    ds          = null;
                }
            }
            catch (Exception ex)
            {
                strMessage  = "<Result>false</Result>";
                strMessage += "<MessageOut>";
                strMessage += "<FromDate>" + fromDate + "</FromDate><ToDate>" + toDate + "</ToDate><ReportType>" + ReportType + "</ReportType><Error>" + ex.Message + "</Error>";
                strMessage += "</MessageOut>";
                blnStatus   = false;
                ds          = null;
            }

            if (blnSaveEventLog)
            {
                string strOldXMLData   = "";
                string strErrorMessage = "";
                string strErrorCode    = "APILC_";
                string strLogID        = System.Guid.NewGuid().ToString();

                strOldXMLData += "<root>";
                strOldXMLData += "<FromDate>" + fromDate + "</FromDate>";
                strOldXMLData += "<ToDate>" + toDate + "</ToDate>";
                strOldXMLData += "<ReportType>" + ReportType + "</ToDate>";
                strOldXMLData += "</root>";


                if (!blnStatus)
                {
                    strErrorMessage = "List Cases Failed.";
                    strErrorCode   += "1";
                }
                else
                {
                    strErrorCode += "0";
                }

                ISBL.General oGen = new ISBL.General();
                oGen.SaveEventLog(strLogID, "", "", "API List Cases", strOldXMLData, "<root>" + strMessage + "</root>", System.DateTime.Now, System.DateTime.Now, strLoginID, "", strErrorCode, strErrorMessage);
                oGen = null;
            }

            return(ds);
        }
Example #3
0
        public DataSet checkOrderStatus(string strLoginID, string strPassword, string strCRN, bool blnSaveEventLog)
        {
            Boolean blnStatus;

            blnStatus = false;
            ISBL.General oGen            = new ISBL.General();
            DataSet      ds              = new DataSet();
            string       strErrorMessage = "";

            try
            {
                SqlCommand myCmd = new SqlCommand();
                myCmd.Connection  = conn.Connection;
                myCmd.CommandText = "sp_WSAPIcheckOrderStatus";
                myCmd.CommandType = CommandType.StoredProcedure;

                myCmd.Parameters.Add("@LoginID", SqlDbType.VarChar, 15);
                myCmd.Parameters["@LoginID"].Value = strLoginID;

                myCmd.Parameters.Add("@Password", SqlDbType.VarChar, 250);
                myCmd.Parameters["@Password"].Value = strPassword;

                myCmd.Parameters.Add("@CRN", SqlDbType.VarChar, 80);
                myCmd.Parameters["@CRN"].Value = strCRN;

                SqlDataAdapter sda = new SqlDataAdapter();
                sda.SelectCommand = myCmd;
                conn.Open();
                conn.callingMethod = "ISBL.WSAPI.checkOrderStatus";
                ds = conn.FillDataSet(sda);
                conn.Close();
                myCmd.Dispose();

                if (ds.Tables[0].Rows.Count > 0)
                {
                    blnStatus = true;
                }
                else
                {
                    blnStatus = false;
                }
            }
            catch (Exception ex)
            {
                strErrorMessage = ex.Message;
                blnStatus       = false;
            }

            if (blnSaveEventLog)
            {
                string strOldXMLData = "";

                string strErrorCode = "APICOS_";
                string strLogID     = System.Guid.NewGuid().ToString();

                strOldXMLData += "<root>";
                strOldXMLData += "<LoginID>" + strLoginID + "</LoginID>";
                strOldXMLData += "<Password>********************</Password>";
                strOldXMLData += "<CRN>" + strCRN + "</CRN>";
                strOldXMLData += "</root>";


                if (!blnStatus)
                {
                    strErrorMessage = "Check Case Status Failed";
                    strErrorCode   += "1";
                }
                else
                {
                    strErrorCode += "0";
                }

                oGen.SaveEventLog(strLogID, "", strCRN, "API Check Status", strOldXMLData, "", System.DateTime.Now, System.DateTime.Now, strLoginID, "", strErrorCode, strErrorMessage);
            }
            oGen = null;
            return(ds);
        }