public async Task <ActionResult> Auth() { var userName = Request.QueryString["E"]; var Password = Request.QueryString["P"]; using (var bal = new MarketBal()) { var user = bal.GetWpUser(userName, Password); if (user != null) { SystemLogin(user); await CheckUserBundle(user); var loggedInUser = Session["SystemUser"]; return(RedirectToAction("Index")); } else { SystemLogout(); //Redirect To Unknown payment page } } return(await Task.FromResult(View())); }
public async Task <JsonResult> GetAllMarketSetupData() { JsonResult json = null; try { var list = await MarketBal.GetMarketData(); var categories = await MarketBal.GetActiveMarketCategories(); json = new JsonResult { Data = new { list = list, categories = categories, livePortfolio1 = list.Where(a => a.ProductTypeID.Equals("104")), lastCompletedTradesMain = list.Where(a => a.ExitDate.HasValue && a.ProductTypeID.Equals("105")).OrderBy(n => n.ExitDate).Take(10), }, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } catch (WebException ex) //if server is off it will throw exeception and here we need notify user { throw ex; } return(json); }
public async Task <JsonResult> DeleteMarketData(long id) { var result = await MarketBal.DeleteMarketData(id); if (result >= 0) { var jsonResult = await GetMarketSetDataByType(Convert.ToString(result)); jsonResult.Data = new { list = jsonResult.Data, productTypeId = result }; jsonResult.MaxJsonLength = int.MaxValue; jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return(jsonResult); } return(Json(new List <MarketDataDto>(), JsonRequestBehavior.AllowGet)); }
public async Task <JsonResult> SaveMarketData(MarketDataDto vm) { var result = await MarketBal.SaveMarketData(vm); if (result >= 0) { var limitedData = await GetMarketSetDataByType(vm.ProductTypeID); var jsonResult = await GetAllMarketSetupData(); jsonResult.Data = new { allData = jsonResult.Data, limitedData = limitedData.Data }; jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet; jsonResult.MaxJsonLength = int.MaxValue; return(jsonResult); } return(Json(new List <MarketDataDto>(), JsonRequestBehavior.AllowGet)); }
public async Task <JsonResult> GetMarketSetDataByType(string typeId) { JsonResult json = null; try { var list = await MarketBal.GetMarketData(typeId); json = new JsonResult { Data = list, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } catch (WebException ex) //if server is off it will throw exeception and here we need notify user { throw ex; } return(json); }
public async Task <JsonResult> GetMarketDataById(long id) { JsonResult json = null; try { var vm = await MarketBal.GetMarketDataById(id); json = new JsonResult { Data = vm, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } catch (WebException ex) //if server is off it will throw exeception and here we need notify user { throw ex; } return(json); }
public AccountController(MarketBal marketBal, UserChartHistoryBal ChartBal, GlobalCodesBal gcBal) { _marketBal = marketBal; _ChartBal = ChartBal; _gcBal = gcBal; }