Пример #1
0
        public ActionResult AlterStatus(int id, int status)
        {
            int error; //If 0 then error

            TrvReq info = travelHelper.GetRawRequest(id);

            info.IdEstatus = status;

            if (status == 3)
            {
                info.Aprobado = true;
                notify.CreateNotification(string.Format("ha aprobado tu solicitud de vijae"), string.Format("({0}, {1})", info.PaisDes, info.Destino), Url.Action("TravelDetail", "Travel", new { reqID = info.IdTrvReq }), info.Creadopor, int.Parse(Session["IdUser"].ToString()), "check_circle", true);
            }

            if (status == 2)
            {
                info.Aprobado = false;
                notify.CreateNotification(string.Format("ha rechazado tu solicitud de vijae"), string.Format("({0}, {1})", info.PaisDes, info.Destino), Url.Action("TravelDetail", "Travel", new { reqID = info.IdTrvReq }), info.Creadopor, int.Parse(Session["IdUser"].ToString()), "cancel", true);
            }

            error = travelHelper.ChangeStatus(info); //Cambiamos el estado del ticket

            return(Json(new
            {
                msg = "Successfully added "
            }));
        }