Esempio n. 1
0
 public void AddQuoteTest()
 {
     repo.Add(pr1);
     Assert.Equal(Status.New, repo.ShowProjectByID(1, true).Progress);
     Assert.Equal(0, repo.ShowProjectByID(1, true).Quote);
     repo.AddQuote(1, 500.00);
     Assert.Equal(Status.Quoted, repo.ShowProjectByID(1, true).Progress);
     Assert.Equal(500, repo.ShowProjectByID(1, true).Quote);
 }
        public IActionResult ProjectQuote(int projectId, double quote)
        {
            TempData["Message"] = "Quote Added, Message Sent to Client!";
            var p = project.ShowProjectByID(projectId, CLIENT);

            project.AddQuote(projectId, quote);
            message.Add(new Message()
            {
                Date    = DateTime.Now,
                FromID  = GetCurrentUserId(),
                ToID    = p.CustomerID,
                Status  = Read.Unread,
                Parent  = 0,
                Subject = "Quote Added for " + p.Name,
                Text    = "We've added a quote for your project. " + HttpUtility.HtmlDecode("<a href=\"/Account/ProjectView/" + p.ID + "\"> Click Here to View your Project and see your quote.</a>")
            });
            return(View("ProjectView", project.ShowProjectByID(projectId, CLIENT)));
        }