Exemple #1
0
        public IActionResult AddNote(string type, string body, string jobID)
        {
            if (!isAuthenticated())
            {
                return(RedirectToAction("Login", "Auth"));
            }

            JobNote note = new JobNote
            {
                id   = JobProvider.GetUniqueKey(255),
                type = type,
                body = body,
                time = DateTime.Now,
                user = UserProvider.getUserFromUsername(HttpContext.Session.GetString("user"))
            };

            JobProvider.addJobNote(note, jobID);

            if (type == "Invoice")
            {
                JobProvider.updateStatus(jobID, "Complete - Awaiting Payment");
            }

            return(RedirectToAction("ViewJob", "Job", new { id = jobID }));
        }
Exemple #2
0
        public IActionResult Pay(string jobID)
        {
            if (!isAuthenticated())
            {
                return(RedirectToAction("Login", "Auth"));
            }

            JobProvider.updateStatus(jobID, "Complete - Paid");

            JobNote note = new JobNote
            {
                id   = JobProvider.GetUniqueKey(255),
                type = "Payment",
                body = "Customer payment taken.",
                time = DateTime.Now,
                user = UserProvider.getUserFromUsername(HttpContext.Session.GetString("user"))
            };

            JobProvider.addJobNote(note, jobID);

            return(RedirectToAction("ViewJob", "Job", new { id = jobID }));
        }