public void Save(UserFb entity) { try { repository.SaveAndCommit(entity); } catch (Exception) { } }
public void Update(UserFb entity) { try { repository.Update(entity); } catch (Exception) { } }
public ActionResult SsoResult() { string userMsisdn; if ((WebServiceDefinitions.Platform == WebServiceDefinitions.PlatformCode.Static) || (config.ByPassLogin)) { userMsisdn = config.ByPassLoginMsisdn; } else { var ssoHeaders = System.Web.HttpContext.Current.Request.Headers; userMsisdn = ssoHeaders["TCELL-UID"] == null ? String.Empty : ssoHeaders["TCELL-UID"].ToString(); if (userMsisdn == String.Empty) { return(RedirectToAction("AppOffline", "Error")); } } try { SsoLoginHandler handler = new SsoLoginHandler(); var ssoLoginData = handler.PrepareData(userMsisdn); //Kurumsal Kullanıcı ise if (ssoLoginData.CustomerType != Parameter.CustomerType.flat.ToString()) { return(RedirectToAction("CorporateCustomerError")); } session.IsSsoLogin = true; UserFb.Data.UserType = (int)Enum.Parse(typeof(Parameter.UserType), ssoLoginData.CustomerPaymentType); UserFb.Data.Msisdn = ssoLoginData.CustomerMsisdn; //FbLogin isleminden sonra msisdn sessiondaki nesneye atilmamisti. //FormatHelper'in exception firlatmamasi icin msisdn eklendikten sonra //sessiondaki nesneyi güncelliyoruz. UserFb.UpdateSession(); //Herhangi bir handler'in bu propertyleri static loader'in ilgili //propertylerini set ettigi icin dispose olmasindan korkmaya gerek yok. handler.PageToken = ssoLoginData.SessionToken; handler.TcellSession = ssoLoginData.Sid; session.PageToken = ssoLoginData.SessionToken; session.TurkcellSessionId = ssoLoginData.Sid; UserService.Update(UserFb.Data); } catch (Exception) { return(RedirectToAction("AppOffline", "Error")); } return(View()); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { //Bu attribute ile donatilmis her action, //kendi islemini kayit altina alir. TransactionLog olarak kayit eder. var IpAddress = HttpContext.Current.Request.UserHostAddress; var sessionData = HttpContext.Current.Session["TurkcellSessionId"]; string TurkcellSession = sessionData == null ? null : sessionData.ToString(); BaseController controllerDefault = (BaseController)filterContext.Controller; //SessionManager s = new SessionManager(); UserFb userData = null; var sessionManager = SessionManager.GetInstance(); var serializer = new Serialize(); if (sessionManager.HasSessionUser) { //Sessionda user bilgileri var ise, bunlari deserilaze edip data'ya aktariyoruz. userData = (UserFb)serializer.DeserializeObject(sessionManager.SessionUser, typeof(UserFb)); } string msisdn = userData == null ? "" : userData.Msisdn; int userId = userData == null ? 0 : userData.Id; string userFbId = userData == null ? "" : userData.FbId; TransactionLog log = new TransactionLog(); log.Status = LogService.LogDefinitions.ActionCall.ToString(); log.Naming = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName + "::" + filterContext.ActionDescriptor.ActionName; log.IP = IpAddress; log.Msisdn = msisdn; log.UserId = userId; log.FbId = userFbId; log.TcellSession = TurkcellSession; log.Details = ActionDescription; LogService logger = LogService.GetInstance(); logger.Log <TransactionLog>(log); base.OnActionExecuting(filterContext); }