public ActionResult EditCase(int id, int category, string description, bool isActive) { ProjektService.Service1Client client = new ProjektService.Service1Client(); client.editCase(id, category, description, isActive); return(RedirectToAction("Admin")); }
//Tar emot ett ärende (från formuläret) och skickar till WebService public ActionResult AddCase(ProjektService.CaseData iCase) { ProjektService.Service1Client client = new ProjektService.Service1Client(); client.addCase(iCase); return(RedirectToAction("Index")); }
//Metoden som hämtar data från WebbService public ActionResult GetCases() { ProjektService.Service1Client client = new ProjektService.Service1Client(); List <ProjektService.CaseData> caseList = client.getAllCases().ToList(); //Gör om listan av objekt till en JSON sträng och returnerar det return(Json(JsonSerializer.Serialize(caseList))); }
//Tar emot ett ärende (från formuläret) och skickar till WebService public ActionResult AddCase(ProjektService.CaseData iCase) { ProjektService.Service1Client client = new ProjektService.Service1Client(); //Tillfälligt tills jag fixar switch case i uträkningen iCase.category = 1; client.addCase(iCase); return(RedirectToAction("Index")); }
public ActionResult LogIn(UserModel u) { ProjektService.Service1Client client = new ProjektService.Service1Client(); bool x = client.logIn(u.username, u.password); if (client.logIn(u.username, u.password) == true) { System.Web.Security.FormsAuthentication.RedirectFromLoginPage(u.username, false); return(RedirectToAction("Admin", "Home")); } errorMessage = "Fel användarnamn eller lösenord"; ViewBag.ErrorMessage = errorMessage; return(LogIn()); }
public ActionResult DeleteCase(int id) { ProjektService.Service1Client client = new ProjektService.Service1Client(); client.deleteCase(id); return(RedirectToAction("Admin")); }