public ActionResult CreateDemand(Demand d) { if (ModelState.IsValid) { d.MerchID = Convert.ToInt32(Session["merchID"]); d.Date = DateTime.Now.Date; demandRepository.Add(d); /************** Saving log ***************/ log.DoAll("Demand: " + d.No + ", " + d.Thickness + ", " + d.Color + ", " + d.Date + ", " + d.Quantity + ", " + d.Size + ", " + d.OrderNo + ", " + d.MerchID + "."); /*****************************************/ demandRepository.Save(); return View("Merch", merchRepository.GetMerchByID(Convert.ToInt32(Session["merchID"]))); } return View("~/Views/Home/Error.aspx"); }
public ActionResult CreateDemand(int id) { //Session["merchID"] = id; Demand d = new Demand(); return View(d); }
/// <summary> /// Create a new Demand object. /// </summary> /// <param name="no">Initial value of the No property.</param> /// <param name="thickness">Initial value of the Thickness property.</param> /// <param name="color">Initial value of the Color property.</param> /// <param name="date">Initial value of the Date property.</param> /// <param name="quantity">Initial value of the Quantity property.</param> /// <param name="size">Initial value of the Size property.</param> /// <param name="orderNo">Initial value of the OrderNo property.</param> /// <param name="merchID">Initial value of the MerchID property.</param> public static Demand CreateDemand(global::System.Int32 no, global::System.Double thickness, global::System.String color, global::System.DateTime date, global::System.Double quantity, global::System.Double size, global::System.Int32 orderNo, global::System.Int32 merchID) { Demand demand = new Demand(); demand.No = no; demand.Thickness = thickness; demand.Color = color; demand.Date = date; demand.Quantity = quantity; demand.Size = size; demand.OrderNo = orderNo; demand.MerchID = merchID; return demand; }
//Insert public void Add(Demand d) { entities.Demands.AddObject(d); }
/// <summary> /// Deprecated Method for adding a new object to the Demands EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDemands(Demand demand) { base.AddObject("Demands", demand); }