コード例 #1
0
        public IHttpActionResult PutMessageMaster(int id, MessageMaster messageMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != messageMaster.Id)
            {
                return(BadRequest());
            }

            db.Entry(messageMaster).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MessageMasterExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #2
0
        // GET: Message
        public ActionResult Compose()
        {
            var model = new MessageMaster();

            model.From = User.Identity.Name;
            return(View(model));
        }
コード例 #3
0
        public PartialViewResult ComposeContent()
        {
            MessageMaster x = new MessageMaster();

            x.From = User.Identity.Name;

            return(PartialView("~/Views/Message/Compose.cshtml", x));
        }
コード例 #4
0
        public PartialViewResult MessageIndexContent()
        {
            MessageMaster x = new MessageMaster();

            x.From = User.Identity.Name;

            return(PartialView("/Views/Message/Index.cshtml", x));
        }
コード例 #5
0
        public IHttpActionResult GetMessageMaster(int id)
        {
            MessageMaster messageMaster = db.MessageMasters.Find(id);

            if (messageMaster == null)
            {
                return(NotFound());
            }

            return(Ok(messageMaster));
        }
コード例 #6
0
 public ActionResult Compose(MessageMaster MessageMaster)
 {
     if (ModelState.IsValid)
     {
         db.MessageMasters.Add(MessageMaster);
         db.SaveChanges();
         return(new JavaScriptResult {
             Script = "alert('Message Sent Succesfully');"
         });
     }
     return(View(MessageMaster));
 }
コード例 #7
0
        public MessageMaster CreateMessageMAster(string messagetext, string sendorid, string expirytime, string recipients, string messagetype, string subject, string downPlayTime,
                                                 string sendertype, string recipienttype, string MasterParentId, string InvitationParentid)
        {
            string token = "";

            Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
            token = appclient.Login("*****@*****.**", "messagemaster");
            MessageMaster appmessagemaster = appclient.createmessagemaster(messagetext, appclient.GetUserObject(token).Id, expirytime, recipients, messagetype, subject, downPlayTime, sendertype, recipienttype,
                                                                           MasterParentId, InvitationParentid, token);

            return(appmessagemaster);
        }
コード例 #8
0
        public ActionResult Index()
        {
            MessageMaster msg = new MessageMaster();

            var today = DateTime.Now;

            if (today == msg.ExpiredIn)
            {
                DeleteMessageMaster(msg);
            }

            return(View());
        }
コード例 #9
0
        public IHttpActionResult DeleteMessageMaster(int id)
        {
            MessageMaster messageMaster = db.MessageMasters.Find(id);

            if (messageMaster == null)
            {
                return(NotFound());
            }

            db.MessageMasters.Remove(messageMaster);
            db.SaveChanges();

            return(Ok(messageMaster));
        }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        text      = GetComponentInChildren <Text>();
        text.text = "Hello!";

        c   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        pos = 0;

        master = GameObject.FindGameObjectWithTag("Message Master").GetComponent <MessageMaster>();

        sentences = master.messages[message].text;

        text.text = sentences[0];
        pos       = 0;
    }
コード例 #11
0
        public PartialViewResult content03()
        {
            MessageMaster x = new MessageMaster();

            x.From = User.Identity.Name;
            //string currentUserName = User.Identity.GetUserName();
            //var messageList = db.MessageMasters.ToList()
            //    .Select(e => new MessageViewModel { From = e.From, To = e.To, Subject = e.Subject, Message = e.Message, DateTime = e.DateTime })
            //    .Where(e => e.To == currentUserName);


            //if (ModelState.IsValid)
            //{
            //    ModelState.Clear();
            //}
            return(PartialView("/Views/Message/Index.cshtml", x));
        }
コード例 #12
0
        public IHttpActionResult PostMessageMaster(MessageMaster messageMaster)
        {
            AuthRepository  repository = new AuthRepository();
            ClaimsPrincipal principal  = Request.GetRequestContext().Principal as ClaimsPrincipal;

            var myId = principal.Claims.Where(e => e.Type == "sub").FirstOrDefault();

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            messageMaster.From = myId.Value;

            db.MessageMasters.Add(messageMaster);
            db.SaveChanges();

            return(CreatedAtRoute("ComposeMessage", new { id = messageMaster.Id, from = messageMaster.From }, messageMaster));
        }
コード例 #13
0
        public IHttpActionResult InputScheduler(MessageMaster msg)
        {
            var msgMaster = db.MessageMasters.ToList();

            foreach (var message in msgMaster)
            {
                message.DeleteIn  = msg.DeleteIn;
                message.ExpiredIn = message.DateTime.AddDays(message.DeleteIn); //<-----Deploy With This
                //message.ExpiredIn = message.DateTime.AddSeconds(message.DeleteIn); //Test Purpose Only

                db.Entry(message).State = EntityState.Modified;
            }

            db.SaveChanges();
            //messageMaster.ExpiredIn = messageMaster.DateTime.AddDays(messageMaster.DeleteIn);

            //db.Entry(messageMaster).State = EntityState.Modified;

            return(Ok(new HttpResponseException(HttpStatusCode.OK)));
        }
コード例 #14
0
 public ActionResult SetExpiryDate(MessageMaster DaysToExpire)
 {
     return(new JavaScriptResult {
         Script = "alert('Expiry Date Set!')"
     });
 }
コード例 #15
0
 public ActionResult DeleteMessageMaster(MessageMaster msg)
 {
     db.MessageMasters.Remove(msg);
     return(View());
 }