Esempio n. 1
0
 public ActionResult Add()
 {
     StoryModel added = new StoryModel();
     added.currentUser = User.Identity.Name;
     added.title = Request["title"];
     added.text = Request["text"];
     added.likes = 0;
     Cords c = new Cords();
     string temp = Request["cords"];
     string[] i = temp.Split(' ');
     bool n;
     try
     {
         Convert.ToDecimal(i[1]);
         Convert.ToDecimal(i[2]);
         n = true;
     }
     catch { n = false; }
     if (n)
     {
         c.x = Convert.ToDecimal(i[1]);
         c.y = Convert.ToDecimal(i[2]);
         added.cord.Add(c);
     }
     database send = new database();
     send.addStory(added);
     return View("Sandbox", i);
 }
Esempio n. 2
0
 public ActionResult showData()
 {
     string user = Request["user"];
     database getData = new database();
     List<StoryModel> result = getData.getStory(user);
     if (User.Identity.IsAuthenticated) return View("Index", result);
     else return View("NotLoggedIn");
 }
Esempio n. 3
0
 public ActionResult Index()
 {
     database getData = new database();
     string currentUser = User.Identity.Name;
     List<StoryModel> result = getData.getStory(currentUser);
     
     if (User.Identity.IsAuthenticated) return View("Index", result);
     else return View("NotLoggedIn");
 }