Example #1
0
 public ActionResult Create(Quotation quotation)
 {
     try
     {
         quotation.LastUpdated = DateTime.Now;
         // add to database table
         db.AddToQuotations(quotation);
         // save
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     catch
     {
         return View("Error");
     }
 }
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Quotations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToQuotations(Quotation quotation)
 {
     base.AddObject("Quotations", quotation);
 }
Example #3
0
 //
 // GET: /Quotations/Create
 public ActionResult Create()
 {
     var data = new Quotation();
     return View(data);
 }
Example #4
0
 /// <summary>
 /// Create a new Quotation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="quote">Initial value of the Quote property.</param>
 /// <param name="lastUpdated">Initial value of the LastUpdated property.</param>
 public static Quotation CreateQuotation(global::System.Int32 id, global::System.String quote, global::System.DateTime lastUpdated)
 {
     Quotation quotation = new Quotation();
     quotation.Id = id;
     quotation.Quote = quote;
     quotation.LastUpdated = lastUpdated;
     return quotation;
 }