public ActionResult VmQuote()
 {
     using (QuoteEntities db = new QuoteEntities())
     {
         var quotes   = db.Quotes;
         var VmQuotes = new List <VmQuote>
                            ();
         foreach (var quote in quotes)
         {
             var VmQuote = new VmQuote();
             VmQuote.FirstName    = quote.FirstName;
             VmQuote.LastName     = quote.LastName;
             VmQuote.EmailAddress = quote.EmailAddress;
             VmQuote.FinalQuote   = quote.FinalQuote;
             VmQuotes.Add(VmQuote);
         }
         return(View(VmQuotes));
     }
 }
示例#2
0
 // GET: Admin
 public ActionResult Index()
 {
     using (QuoteEntities db = new QuoteEntities())
     {
         var quotes = (from c in db.Quotes
                       select c).ToList();
         var VmQuotes = new List <VmQuote>();
         foreach (var quote in quotes)
         {
             var VmQuote = new VmQuote();
             VmQuote.Id           = quote.Id;
             VmQuote.FirstName    = quote.FirstName;
             VmQuote.LastName     = quote.LastName;
             VmQuote.EmailAddress = quote.EmailAddress;
             VmQuote.FinalQuote   = quote.FinalQuote;
             VmQuotes.Add(VmQuote);
         }
         return(View(VmQuotes));
     }
 }