Esempio n. 1
0
        private void FirePostBackPixel(OrderVariables oVariables)
        {
            string SQLString = System.Configuration.ConfigurationManager.AppSettings["SQLConn"].ToString();
            try
            {
                if (oVariables != null && (!string.IsNullOrEmpty(oVariables.transaction_id)) && (oVariables.transaction_id.Trim().Length > 0))
                {
                    string trans_id = oVariables.transaction_id.Trim();
                    string pixelstring = oVariables.pixel.Trim();
                    string conversionPixel = "https://sandvikpublishing.go2cloud.org/aff_lsr?transaction_id=" + trans_id;
                    dbConn.dbConnector.dbConn oDBConn = new dbConn.dbConnector.dbConn();
                    oDBConn.regKey = SQLString;
                    int rowId = 0;
                    rowId = oDBConn.ExecSPReturnInteger("InsertVendorPxlPostBackFeedback", oVariables.order_id, conversionPixel, rowId);
                    oDBConn = null;

                    var client = new WebClient();
                    var content = client.DownloadString(conversionPixel);

                    oDBConn = new dbConn.dbConnector.dbConn();
                    oDBConn.regKey = SQLString;
                    oDBConn.ExecSP("UpdateVendorPxlPostBackFeedback", rowId, string.IsNullOrEmpty(content) ? content.ToString().Trim() : "EMPTY");
                    oDBConn = null;

                }
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                // dSet = null;
            }
        }
Esempio n. 2
0
        private int InsertOrderStatusDetails(string address, string responseString, int orderId,string resultCodes, string status)
        {
            int resultStatus = 0;
            try
            {
                string SQLString = System.Configuration.ConfigurationManager.AppSettings["SQLConn"].ToString();
                dbConn.dbConnector.dbConn oDBConn = new dbConn.dbConnector.dbConn();
                oDBConn.regKey = SQLString;
                resultStatus = oDBConn.ExecSPReturnInteger("INSERT_OrderAddressDetails", address, responseString, orderId,"O", resultCodes, status, resultStatus);
                return resultStatus;
            }
            catch (Exception ex)
            {

                throw;
            }
        }
Esempio n. 3
0
        public int UpdateOrderDetails(string OrderId, string StreetAddress1, string StreetAddress2, string City, string StateCode, string ZipCode)
        {
            CommonModels oComm = new CommonModels();
            int result = 0;
            try
            {
                if (Session["ConfirmationTokenId"]!=null && Session["ConfirmationTokenId"].ToString() == "F1BD018E50F043D58B88B4A216B8523F")
                {
                    string SQLString = System.Configuration.ConfigurationManager.AppSettings["SQLConn"].ToString();
                    dbConn.dbConnector.dbConn oDBConn = new dbConn.dbConnector.dbConn();
                    oDBConn.regKey = SQLString;
                    if (string.IsNullOrEmpty(StreetAddress2))
                        StreetAddress2 = string.Empty;
                    result = oDBConn.ExecSPReturnInteger("UPDATEOrderDetails", OrderId,StreetAddress1, StreetAddress2, City,StateCode,ZipCode,result);
                    if(result==0)
                    {
                        string subject = ConfigurationManager.AppSettings["OrderSubject"] != null ? (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["OrderSubject"].ToString()) ? ConfigurationManager.AppSettings["OrderSubject"].ToString() : "Shippment Address change after Order exported to AS 400: " + OrderId) : "Shippment Address change after Order exported to AS 400: " + OrderId;
                        string To = ConfigurationManager.AppSettings["OrderTo"] != null ? ConfigurationManager.AppSettings["OrderTo"].ToString() : "*****@*****.**";
                        string From = ConfigurationManager.AppSettings["OrderFrom"] != null ? ConfigurationManager.AppSettings["OrderFrom"].ToString() : "*****@*****.**";
                        string body = string.Empty;
                        if (!string.IsNullOrEmpty(StreetAddress2))
                            body = "Address change requested:  <br /> <br /> StreetAddress1: " + StreetAddress1 + ", <br /> StreetAddress2: " + StreetAddress2 + ", <br /> City: " + City + ", <br /> State: " + StateCode + ", <br /> ZipCode: " + ZipCode + ". <br /> Order Id: " + OrderId;
                        else
                            body = "Address change requested: <br /> <br />  StreetAddress1: " + StreetAddress1 + ", <br /> City: " + City + ", <br /> State: " + StateCode + ", <br /> ZipCode: " + ZipCode + ". <br /> Order Id: " + OrderId;

                        oComm.SendEmail(subject, body, To, From);
                    }
                }
                return result;
            }
            catch (Exception ex)
            {

                throw;
            }
        }