public DataTable Dynamic_Pixel(OrderVariables oVariables, string SPname, string pixcd) { CommonModels oComm = new CommonModels(); dbConn.dbConnector.dbConn oDBConn; DataTable pixeltb = new DataTable(); DataSet VpixData = new DataSet(); try { //DBConn and SP execution oDBConn = new dbConn.dbConnector.dbConn(); oDBConn.regKey = ConfigurationManager.AppSettings["SQLConn"].ToString(); VpixData = oDBConn.ExecSPReturnSingleDS(SPname, pixcd); pixeltb = VpixData.Tables[0]; return pixeltb; } catch (Exception ex) { oComm.SendEmail("Dynamic_Pixel() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); return null; } finally { oDBConn = null; pixeltb = null; VpixData = null; } }
private DataTable SelectMeissaDataStatus(string strCode) { try { string SQLString = System.Configuration.ConfigurationManager.AppSettings["SQLConn"].ToString(); dbConn.dbConnector.dbConn oDBConn = new dbConn.dbConnector.dbConn(); oDBConn.regKey = SQLString; DataTable dt = oDBConn.ExecSPReturnSingleDS("SelectMelissaDataStatusForCode", strCode).Tables[0]; return dt; } catch (Exception ex) { throw; } }
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; } }
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; } }
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; } }