Exemplo n.º 1
0
        public IHttpActionResult MakePayment(int projectId)
        {
            Project project = projectDal.GetProject(projectId);


            if (project.IsCompletedOwner && project.IsCompletedWorker)
            {
                Payment payment = paymentDal.FindByProjectId(projectId);
                paymentDal.MakePayment(payment);
                return(Ok());
            }
            else
            {
                return(BadRequest("Payment cannot be made until the project is approved"));
            }
        }
Exemplo n.º 2
0
        public ActionResult SetCompleteAsOwner(int projectId)
        {
            Payment payment = _paymentDal.FindByProjectId(projectId);

            _paymentDal.MakePayment(payment);

            Project project = _projectDal.GetProject(projectId);

            project.StateId = 4;
            _projectDal.UpdateProject(project);

            TempData.Add("message", String.Format("Proje onaylandı. Ödeme Tamamlandı."));

            return(RedirectToAction("index", "home"));
        }