// 注册 public int Reister(LandingModel reister) { string pwd = EncryptionHelper.Sha1(reister.Pwd); string sql = $"insert into Landing values('{reister.Name}','{pwd}') "; return(DapperHelper <ReisterModel> .Execute(sql, null)); }
public async Task FetchDecisionDueData() { try { if (!IsRefreshing) { IsBusy = true; } IsDecisionDueListVisible = true; IsClosingsListVisible = false; HttpClient hc = new HttpClient(); await Task.Delay(new TimeSpan(0, 0, 2)).ConfigureAwait(false); var jsonString = await hc.GetStringAsync(Config.DECISIONDUE_API + userId); DecisionDueList = LandingModel.FromJson(jsonString); IsBusy = false; if (DecisionDueList.Count > 0) { IsDataNotAvailable = false; } else { IsDataNotAvailable = true; } } finally { IsBusy = false; } }
public async Task FetchDecisionDueData() { using (HttpClient hc = new HttpClient()) { try { //IsBusy = true; var jsonString = await hc.GetStringAsync(Config.DECISIONDUE_API + userId); DecisionDueList = LandingModel.FromJson(jsonString); //IsBusy = false; if (DecisionDueList.Count > 0) { IsDataNotAvailable = false; IsDecisionDueListVisible = true; IsClosingsListVisible = false; } else { IsDataNotAvailable = true; IsDecisionDueListVisible = true; IsClosingsListVisible = false; } } finally { IsBusy = false; } } }
public async Task <IActionResult> Index() { var model = new LandingModel(); model.CurrentUser = await GetAuthenticatedUserInfoAsync(); // should return the proper error codes if the user is not in the discord or muted return(View(nameof(Index), model)); }
// GET: /Admin/ public ActionResult Index(int?page) { var currentPage = page ?? 1; var vehicles = SVD.Controller.Instance.VehicleController.GetVehicles(25, currentPage); var pagedList = new PagedList <Vehicle>(vehicles, currentPage, 25, vehicles.TotalCount); var m = new LandingModel { Vehicles = pagedList }; return(View(m)); }
public ActionResult Index() { var model = new LandingModel(); try { model.AppId = _applicationSettings.AppId; model.ShopYourWayUrl = _platformSettings.SywWebSiteUrl; } catch (ConfigurationErrorsException) { model.DisplayProperConfiguraionMessage = true; } return(View(model)); }
public ActionResult Index() { RestClient client = new RestClient("http://api.twitter.com/1"); JsonDeserializer jsonDeserializer = new JsonDeserializer(); var model = new LandingModel(); var request = new RestRequest(Method.GET); request.Resource = "statuses/user_timeline.json"; request.Parameters.Add(new Parameter() { Name = "screen_name", Value = "tkglaser", Type = ParameterType.GetOrPost }); request.Parameters.Add(new Parameter() { Name = "count", Value = 10, Type = ParameterType.GetOrPost }); request.Parameters.Add(new Parameter() { Name = "include_rts", Value = true, Type = ParameterType.GetOrPost }); request.Parameters.Add(new Parameter() { Name = "include_entities", Value = true, Type = ParameterType.GetOrPost }); var response = client.Execute(request); model.Tweets = jsonDeserializer.Deserialize <List <Tweet> >(response); return(View(model)); }
public int Reister(string name, string pwd, string pwd2, string validCode) { if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(pwd) && !string.IsNullOrEmpty(validCode)) { var sessionValidCode = HttpContext.Session.GetString("validCode"); if (sessionValidCode.Equals(validCode.Trim(), StringComparison.CurrentCultureIgnoreCase)) { if (pwd != pwd2) { return(1); } //登陆表 LandingModel user = new LandingModel { Name = name, Pwd = pwd, }; int i = int.Parse(client.Post("api/Landing/Reister", JsonConvert.SerializeObject(user))); if (i > 0) { return(2); } else { return(3); } } else { return(4); } } else { return(5); } }
// 注册 public int Reister(LandingModel reister) { return(dal.Reister(reister)); }
public static LandingState Failed(LandingModel model, string error) { return(new LandingState(false, model, error)); }
public static LandingState Success(LandingModel model) { return(new LandingState(false, model, null)); }
public static LandingState Loading(LandingModel model) { return(new LandingState(true, model, null)); }
private LandingState(bool isBusy, LandingModel model, string error) { IsBusy = isBusy; Model = model; Error = error; }
public GetLandingSuccessAction(LandingModel data) { Data = data; }