public void EditQuote(Quote QuoteToEdit)
 {
     QuoteRepository.Update(QuoteToEdit);
     SaveQuote();
 }
        public ActionResult Details(PotentialFormModel potentialformmodel, string command)
        {
            if (command == "Create Invoice")
            {
                Invoice invoice = new Invoice()
                {
                    InvoiceNo = "Inv0001",
                    CustomerNo = "Inv0001",
                    Account = potentialformmodel.Account,
                    AssignedTo = potentialformmodel.AssignedTo,
                    AssignedToUserGroup = potentialformmodel.AssignedToUserGroup == UserGroup.group ? "group" : "user",
                    CreatedOn = DateTime.Now,
                    ModifiedOn = DateTime.Now,
                    CreatedBy = Session["UserID"].ToString(),
                    ModifiedBy = Session["UserID"].ToString()

                };

                invoiceService.CreateInvoice(invoice);

                return RedirectToAction("List", "Invoice");
            }
            else if (command == "Create Quote")
            {
                Quote quote = new Quote()
                {
                    Subject = potentialformmodel.PotentialName,
                    Account = potentialformmodel.Account,
                    Potential = potentialformmodel.ID,
                    AssignedTo = potentialformmodel.AssignedTo,
                    AssignedToUserGroup = potentialformmodel.AssignedToUserGroup == UserGroup.group ? "group" : "user",
                    CreatedOn = DateTime.Now,
                    ModifiedOn = DateTime.Now,
                    CreatedBy = Session["UserID"].ToString(),
                    ModifiedBy = Session["UserID"].ToString(),
                };

                quoteService.CreateQuote(quote);

                return RedirectToAction("List", "Quote");
            }

            return RedirectToAction("List", "Potential");
        }
 public void CreateQuote(Quote Quote)
 {
     QuoteRepository.Add(Quote);
     SaveQuote();
 }