protected override void OnPreInit(EventArgs e) { InitLoader(); base.OnPreInit(e); if (UserSession != null && !FunMode) { CashTransporter cashTransporter = new CashTransporter(UserSession, Domain.DomainID, VendorID); string language = GetLanguage(); cashTransporter.TransferMoney(language); } }
public JsonResult TransferMoney(CashTransporterRequest request) { CashTransporterResponse response = new CashTransporterResponse(); if (string.IsNullOrWhiteSpace(request.Sid) || string.IsNullOrEmpty(request.VendorName) || request.DomainId == 0) { response.Success = false; response.ErrorMessage = string.Format("Parameter requied. Received parameters: Sid: {0}, DomainId: {1}, VendorName: {2}, Language: {3}", request.Sid, request.DomainId, request.VendorName, request.Language); return(Json(response, JsonRequestBehavior.AllowGet)); } SessionPayload session = _agentClient.GetSessionByGuid(request.Sid); try { if (session != null && session.IsAuthenticated == true && session.DomainID == request.DomainId) { VendorID vendor = (VendorID)Enum.Parse(typeof(VendorID), request.VendorName, true); CashTransporter cashTransporter = new CashTransporter(session, request.DomainId, vendor); string language = VendorLanguageSelector.GetLanguage(vendor, request.Language); cashTransporter.TransferMoney(language); response.Success = true; } else { response.ErrorMessage = "Session expired"; } } catch (Exception ex) { response.ErrorMessage = ex.Message; } return(Json(response, JsonRequestBehavior.AllowGet)); }