Exemplo n.º 1
0
        public IHttpActionResult SaveTicReply(TicketReply tReply)
        {
            // Also store file path in DB
            TicReply ticR = new TicReply
            {
                //uTic.TicketId = uTic.TicketId;
                TicketId  = tReply.TicketId,
                ReplyText = tReply.ReplyText
            };

            db.TicReplies.Add(ticR);
            db.SaveChanges();


            return(Ok("OK"));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetTicReplies(UserTicket tic)
        {
            List <TicketReply> ticRList = new List <TicketReply>();

            var currentTicReplies = db.TicReplies.Where(o => o.TicketId == tic.TicketId);

            foreach (var ticR in currentTicReplies)
            {
                TicketReply tReply = new TicketReply();
                tReply.TicketId  = ticR.TicketId;
                tReply.Id        = ticR.Id;
                tReply.ReplyText = ticR.ReplyText;



                ticRList.Add(tReply);
            }
            return(Ok(ticRList));
            //return db.Tickets;
        }