public void FunTracker_Log(string method, string reqData) { try { FUNTrackerInfo funTrac = new FUNTrackerInfo(); JavaScriptSerializer s = new JavaScriptSerializer(); FUNBaseRequest bReq = FillBaseRequestInfo(); funTrac.appName = bReq.appName; funTrac.appVersion = bReq.appVersion; funTrac.deviceID = bReq.deviceID; funTrac.dversion = bReq.dversion; funTrac.ipAddress = bReq.ipAddress; funTrac.sessionID = bReq.sessionID; funTrac.methodName = method; funTrac.requestData = reqData; string ser_str = s.Serialize(funTrac); string ret_str = ExecuteWebService(ser_str, "/FUNTracker"); FUNBaseResponse tracResp = s.Deserialize <FUNBaseResponse>(ret_str); //clsDtLayer.EnrollCustomer(retXml); if (tracResp != null) { if (tracResp.requestStatus == 0) { } } } catch (Exception ex) { WriteErrorLog("FunTracker_Log", ex, -11, "", ""); } }
public void InsertMileStoneDetails(string MileStone, string Value = null, string Source = "WebTX") { try { string Brandcode = System.Configuration.ConfigurationManager.AppSettings["BrandCode"].ToString(); FUNBaseRequest bReq = FillBaseRequestInfo(); OpenDBConnectionFUNWeb("FUNEnrollment"); SqlCommand command = new SqlCommand(); command.CommandType = CommandType.StoredProcedure; // command.CommandText = "sp_InsertMileStone"; //command.CommandText = "sp_InsertMileStone_ver2"; command.CommandText = "sp_InsertMileStone_New"; command.Parameters.Add("@Source", SqlDbType.VarChar).Value = Source; command.Parameters.Add("@SessionId", SqlDbType.VarChar).Value = bReq.sessionID; command.Parameters.Add("@MileStone", SqlDbType.VarChar).Value = MileStone; command.Parameters.Add("@Value", SqlDbType.VarChar).Value = Value; command.Parameters.Add("@Brandcode", SqlDbType.VarChar).Value = Brandcode; command.Connection = mDBConnectionFUNWeb; command.ExecuteNonQuery(); mDBConnectionFUNWeb.Close(); } catch (Exception ex) { mDBConnectionFUNWeb.Close(); WriteErrorLog("InsertMileStoneDetails", ex, -11, "", ""); } }
public bool IsAllowIPAddress() { bool isAllow = true; try { FUNBaseRequest baseReq = new FUNBaseRequest(); baseReq.ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; var serialize = new JavaScriptSerializer(); string jsonReq = serialize.Serialize(baseReq); string resp = ExecuteWebService(jsonReq, "/IsAllowIPAddress"); var isAllowIP = new IsAllowIPAddressResponse(); if (resp != null) { isAllowIP = serialize.Deserialize <IsAllowIPAddressResponse>(resp); isAllow = isAllowIP.IsAllowIPAddress; } return(isAllow); } catch (Exception ex) { WriteErrLog("DataLayer:IsAllowIPAddress", ex, -11, "", ""); } return(isAllow); }
public FUNBaseRequest FillBaseRequestInfo() { FUNBaseRequest BaseReq = new FUNBaseRequest(); AppInfo appinfo = GetAppInfo(); BaseReq.appName = appinfo.appName; BaseReq.appVersion = appinfo.appVersion; //BaseReq.deviceID = ""; BaseReq.sessionID = GetSessionID(); BaseReq.dversion = -1; BaseReq.ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; return(BaseReq); }
public void WriteErrLog(string method, Exception exp, int errType, string request = null, string response = null) { try { if ((exp.Message != "Thread was being aborted.")) { string BrandCode = System.Configuration.ConfigurationManager.AppSettings["BrandCode"].ToString(); string IsMobile = ""; if (HttpContext.Current.Session["IsMobileBrowserResponsive"] != null) { if (HttpContext.Current.Session["IsMobileBrowserResponsive"].ToString() == "no") { IsMobile = "Web"; } else { IsMobile = "Mobile"; } } int line = (new StackTrace(exp, true)).GetFrame(0).GetFileLineNumber(); FUNBaseRequest baseReq = new FUNBaseRequest(); baseReq = FillBaseRequestInfo(); ErrorLogger errLog = new ErrorLogger(); errLog.FunName = method + "::" + BrandCode + "::" + IsMobile; errLog.ExceptionText = exp.Message + " @Line no:" + line + exp.StackTrace; errLog.errorType = errType; errLog.AccountNo = null; errLog.appName = baseReq.appName; errLog.appVersion = baseReq.appVersion; errLog.deviceID = baseReq.deviceID; errLog.ipAddress = baseReq.ipAddress; errLog.dversion = baseReq.dversion; errLog.ResData = response; errLog.ReqData = request; JavaScriptSerializer j = new JavaScriptSerializer(); string strSer = j.Serialize(errLog); string strRet = ExecuteWebService(strSer, "/ErrorLogger"); } } catch (Exception ex) { WriteErrLog("DataLayer:WriteErrLog", ex, -11, "", ""); } }
//public void WriteErrLog(string method, Exception exp, int errType, string request = null, string response = null) //{ // if ((exp.Message != "Thread was being aborted.")) // { // int line = (new StackTrace(exp, true)).GetFrame(0).GetFileLineNumber(); // FUNBaseRequest baseReq = new FUNBaseRequest(); // baseReq = FillBaseRequestInfo(); // ErrorLogger errLog = new ErrorLogger(); // errLog.FunName = method; // errLog.ExceptionText = exp.Message + " @Line no:" + line + exp.StackTrace; // errLog.errorType = errType; // errLog.AccountNo = null; // errLog.appName = baseReq.appName; // errLog.appVersion = baseReq.appVersion; // errLog.deviceID = baseReq.deviceID; // errLog.ipAddress = baseReq.ipAddress; // errLog.dversion = baseReq.dversion; // errLog.ResData = response; // errLog.ReqData = request; // JavaScriptSerializer j = new JavaScriptSerializer(); // string strSer = j.Serialize(errLog); // string strRet = ExecuteWebService(strSer, "/ErrorLogger"); // } //} public void WriteErrorLog(string method, Exception exp, int errType, string request, string response) { try { string expmessage = exp != null ? exp.Message : ""; if ((expmessage != "Thread was being aborted.")) { int line = 0; if (exp != null) { line = (new StackTrace(exp, true)).GetFrame(0).GetFileLineNumber(); } FUNBaseRequest baseReq = new FUNBaseRequest(); baseReq = FillBaseRequestInfo(); ErrorLogger errLog = new ErrorLogger(); errLog.FunName = method; if (exp != null) { errLog.ExceptionText = exp.Message + "@Line No: " + line + "Exception: " + exp.StackTrace; } errLog.errorType = errType; errLog.AccountNo = null; errLog.appName = baseReq.appName; errLog.appVersion = baseReq.appVersion; errLog.deviceID = baseReq.deviceID; errLog.ipAddress = baseReq.ipAddress; errLog.dversion = baseReq.dversion; errLog.ReqData = request; errLog.ResData = response; JavaScriptSerializer j = new JavaScriptSerializer(); string strSer = j.Serialize(errLog); string strRet = ExecuteWebService(strSer, "/ErrorLogger"); } } catch (Exception ex) { WriteErrorLog("WriteErrorLog", ex, -11, "", ""); } }
public void WriteErrInfo(string method, string errorMsg, int errType) { try { FUNBaseRequest baseReq = new FUNBaseRequest(); baseReq = FillBaseRequestInfo(); ErrorLogger errLog = new ErrorLogger(); errLog.FunName = method; errLog.ExceptionText = errorMsg; errLog.errorType = errType; errLog.AccountNo = null; errLog.appName = baseReq.appName; errLog.appVersion = baseReq.appVersion; errLog.deviceID = baseReq.deviceID; errLog.dversion = baseReq.dversion; JavaScriptSerializer j = new JavaScriptSerializer(); string strSer = j.Serialize(errLog); string strRet = ExecuteWebService(strSer, "/ErrorLogger"); } catch (Exception ex) { WriteErrorLog("WriteErrInfo", ex, -11, "", ""); } }