public async Task<ActionResult> Index(Guid id)
        {
            var model = new RejectViewModel();
            var notificationId = await mediator.SendAsync(new GetNotificationIdByMovementId(id));
            model.NotificationId = notificationId;

            return View(model);
        }
Esempio n. 2
0
        public ActionResult Index(RejectViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            return(RedirectToAction("Index", "Reject", new { area = "ExportMovement", id = model.Selected.Value }));
        }
        public ActionResult Reject(int id)
        {
            var             report = _reportLogic.GetById(id);
            RejectViewModel assign = new RejectViewModel();

            assign.Id         = id;
            assign.PPKComment = report.PPKComment;
            return(View(assign));
        }
        public ActionResult Index(RejectViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            return RedirectToAction("Index", "Reject", new { area = "ExportMovement", id = model.Selected.Value });
        }
Esempio n. 5
0
 /// <summary>
 /// 审核影人不通过
 /// </summary>
 /// <param name="model"></param>
 public static void Reject(RejectViewModel model)
 {
     using (MR_DataClassesDataContext _db = new MR_DataClassesDataContext())
     {
         tbl_Celebrity celeb = _db.tbl_Celebrity.SingleOrDefault(m => m.celeb_Id == model.Id);
         celeb.celeb_Status = 1;
         celeb.celeb_Note   = model.Note;
         _db.SubmitChanges();
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 审核用户创建的电影不通过
 /// </summary>
 /// <param name="model"></param>
 public static void Reject(RejectViewModel model)
 {
     using (MR_DataClassesDataContext _db = new MR_DataClassesDataContext())
     {
         tbl_Movie movie = _db.tbl_Movie.SingleOrDefault(m => m.movie_Id == model.Id);
         movie.movie_Status = 1;
         movie.movie_Note   = model.Note;
         _db.SubmitChanges();
     }
 }
Esempio n. 7
0
        public ActionResult Reject(string id, string returnurl)
        {
            if (!CelebManager.Exist(id))
            {
                return(RedirectToAction("NotFound", "Error"));
            }
            RejectViewModel model = new RejectViewModel();

            model.Id          = id;
            ViewBag.ReturnUrl = returnurl;
            return(View(model));
        }
Esempio n. 8
0
        public async Task <ActionResult> Index(Guid id)
        {
            var movementDate = await mediator.SendAsync(new GetMovementDateByMovementId(id));

            var notificationId = await mediator.SendAsync(new GetNotificationIdByMovementId(id));

            var model = new RejectViewModel(movementDate);

            model.NotificationId = notificationId;

            return(View(model));
        }
Esempio n. 9
0
 public ActionResult Reject(RejectViewModel model, string returnurl)
 {
     if (model.Note == "0")
     {
         model.Note = "信息有误";
     }
     else if (model.Note == "1")
     {
         model.Note = "已存在";
     }
     else
     {
         model.Note = "其他";
     }
     CelebManager.Reject(model);
     return(RedirectToLocal(returnurl));
 }
        public async Task<ActionResult> Index(Guid id, RejectViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            var fileExtension = Path.GetExtension(model.File.FileName);
            var uploadedFile = await fileReader.GetFileBytes(model.File);

            await mediator.SendAsync(new SetMovementRejected(id, 
                model.RejectionDate.AsDateTime().Value, 
                model.RejectionReason,
                uploadedFile,
                fileExtension));

            return RedirectToAction("Success");
        }
        public IHttpActionResult Reject(RejectViewModel viewModel)
        {
            var claim = _context.Claims.SingleOrDefault(c => c.Id == viewModel.ClaimId);

            if (claim == null)
            {
                return(NotFound());
            }
            var cause = _context.RejectCauses.SingleOrDefault(c => c.Id == viewModel.CauseId);

            if (cause == null)
            {
                return(NotFound());
            }
            claim.StateId = RejectStateId;
            _context.SaveChanges();
            return(Ok(claim));
        }
        public async Task <ActionResult> Index(Guid id, RejectViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var fileExtension = Path.GetExtension(model.File.FileName);
            var uploadedFile  = await fileReader.GetFileBytes(model.File, User.GetAccessToken());

            await mediator.SendAsync(new SetMovementRejected(id,
                                                             model.RejectionDate.AsDateTime().Value,
                                                             model.RejectionReason,
                                                             uploadedFile,
                                                             fileExtension));

            return(RedirectToAction("Success"));
        }
Esempio n. 13
0
        public ActionResult Reject(RejectViewModel model)
        {
            var report = _reportLogic.GetById(model.Id);

            report.PPKComment += "<br /><b>Komentar Admin</b>";
            report.PPKComment += model.StaffComment;
            report.Status      = Constant.ReportStatus.ONPROCESS;
            report.ClosedDate  = null;
            _reportLogic.Edit(report);


            try
            {
                var ppk = _ppkLogic.GetById(report.PPKId.Value);

                if (ppk != null)
                {
                    if (ppk.PIC != null)
                    {
                        var msg = new MailMessage();
                        msg.To.Add(new MailAddress(ppk.PIC.Email));
                        msg.Subject = "LAPOR-BRANTAS Rejected Report";
                        msg.Body    = model.StaffComment;
                        msg.From    = new MailAddress("*****@*****.**");

                        using (var client = new SmtpClient()
                        {
                            Host = "relay-hosting.secureserver.net", Port = 25, EnableSsl = false, UseDefaultCredentials = false
                        })
                        {
                            client.Send(msg);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }

            return(RedirectToAction("Index"));
        }