Exemplo n.º 1
0
        public ActionResult Contact(StaffContactViewModel model)
        {
            if (ModelState.IsValid)
            {
                FMessage message = new FMessage(model.UserId);
                message.Title   = model.Title;
                message.Message = model.Message;
                var content = FirebaseClient.PushNotification("global", message);
                return(RedirectToAction("Index", "Staff"));
            }
            var userChild = FirebaseClient.Get("users/" + model.UserId);
            var user      = userChild.ResultAs <User>();

            ViewBag.User = user;
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Contact(String id)
        {
            if (id == null)
            {
                return(new HttpNotFoundResult());
            }
            var userChild = FirebaseClient.Get("users/" + id);
            var user      = userChild.ResultAs <User>();

            if (user == null)
            {
                return(new HttpNotFoundResult());
            }
            user.UserID  = id;
            ViewBag.User = user;
            var model = new StaffContactViewModel();

            model.UserId = user.UserID;
            return(View(model));
        }