using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using APP.Models; namespace APP.Controllers { public class LoginController : Controller { public IActionResult Index() { return View(); } public IActionResult Login(LoginModel model) { App.Helper.HttpClientHelper httpcli = new App.Helper.HttpClientHelper(); string username = model.UserName; string password = model.Password; httpcli.CallService("user",username+','+password, "GET", null); if (httpcli.Results.resultstatus==true && httpcli.Results.daten !="[]") { APP.Models.SessionClass.UserName = "AAA"; return Json(new { success = true }); } else { return Json(new { error = "Kann nicht angemeldet werden!" }); }; return Json(new { error = "" }); } } }