// GET: User public ActionResult Index() { ServiceReference1.BlankettService1Client ser = new ServiceReference1.BlankettService1Client(); int formid = ser.GetFormIdFromUsername(Session["usr"].ToString()); Userpage f1 = new Userpage(); ServiceReference1.Blankett b1 = ser.GetFormWithId(formid); List <string> tempList = new List <string>(); int userId = ser.GetUserIdWithUsername(Session["usr"].ToString()); string[] tempString = new string[3]; tempList = ser.GetBookedTimeWithUserId(userId).ToList(); foreach (var i in tempList) { tempString = i.Split(' '); f1.Date = tempString[0]; f1.Time = tempString[1]; } f1.FormId = b1.FormId; f1.InmateSSN = b1.InmateSSN; f1.VisitorFName = b1.VisitorFName; f1.VisitorLName = b1.VisitorLName; f1.PersonOfInterestFName = b1.PersonOfInterestFName; f1.PersonOfInterestLName = b1.PersonOfInterestLName; f1.PhoneNumber = b1.PhoneNumber; f1.EMail = b1.EMail; f1.Status = b1.Status; return(View(f1)); }
public ActionResult BokaTid(int id) { ServiceReference1.BlankettService1Client client = new ServiceReference1.BlankettService1Client(); Userpage f1 = new Userpage(); List <string> tempList = new List <string>(); f1.User = client.GetUserIdWithUsername(Session["usr"].ToString()); string poi = client.GetInmateSSNWIthUsername(Session["usr"].ToString()); f1.PersonOfInterest = int.Parse(poi); string[] tempString = new string[3]; tempList = client.GetBooktimeWithId(id).ToList(); foreach (var i in tempList) { tempString = i.Split(' '); f1.Date = tempString[0]; f1.Time = tempString[1]; } return(View(f1)); }
// GET: Userpage public ActionResult Index(int id) { acc = db.Account.Where(s => s.Username == User.Identity.Name).FirstOrDefault(); ViewBag.CurrentUser = acc; ViewBag.Contacts = GetAllContact(); ViewBag.FollowedTheir = CheckMeFollowFriendReturnFolowID(acc, id); (ViewBag.countFollower, ViewBag.countFollowed) = CountFollow(id); Userpage userpage = new Userpage(); userpage.account = db.Account.Find(id); userpage.posts = db.Post.Where(s => s.UserID == id).ToList(); userpage.posts.Reverse(); return(View(userpage)); }
public ActionResult BokaTid(Userpage f1) { ServiceReference1.BlankettService1Client client = new ServiceReference1.BlankettService1Client(); bool res = client.CheckStatusWithUsername(Session["usr"].ToString()); if (res) { ViewBag.booktimeres = client.BookTime(f1.Date, f1.Time, Session["usr"].ToString(), f1.PersonOfInterest); return(RedirectToAction("Index", "Calender")); } else { f1.Status = "DU MÅSTE FÅ DIN BLANKETT GODKÄND FÖR ATT BOKA TID, DU KAN SE BLANKETT STATUS PÅ 'MINA SIDOR'."; return(View(f1)); } }