// // GET: /RequestItemServices/Create public ActionResult Create(int requestItemId) { ViewBag.RequestItem_id = new SelectList(db.RequestItems, "Id", "Serial_num"); ViewBag.Service_id = new SelectList(db.Services, "Id", "Name"); var requestitemservices = new RequestItemService(); requestitemservices.RequestItem_id = requestItemId; return View(requestitemservices); }
public ActionResult Create(RequestItemService requestitemservice) { if (ModelState.IsValid) { db.RequestItemServices.AddObject(requestitemservice); db.SaveChanges(); return RedirectToAction("Edit", "RequestItems", new { @id = requestitemservice.RequestItem_id }); } ViewBag.RequestItem_id = new SelectList(db.RequestItems, "Id", "Serial_num", requestitemservice.RequestItem_id); ViewBag.Service_id = new SelectList(db.Services, "Id", "Name", requestitemservice.Service_id); return View(requestitemservice); }
public ActionResult Edit(RequestItemService requestitemservice) { if (ModelState.IsValid) { db.RequestItemServices.Attach(requestitemservice); db.ObjectStateManager.ChangeObjectState(requestitemservice, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Edit", "RequestItems", new { @id = requestitemservice.RequestItem_id }); } ViewBag.RequestItem_id = new SelectList(db.RequestItems, "Id", "Serial_num", requestitemservice.RequestItem_id); ViewBag.Service_id = new SelectList(db.Services, "Id", "Name", requestitemservice.Service_id); return View(requestitemservice); }
/// <summary> /// Deprecated Method for adding a new object to the RequestItemServices EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRequestItemServices(RequestItemService requestItemService) { base.AddObject("RequestItemServices", requestItemService); }
/// <summary> /// Create a new RequestItemService object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="requestItem_id">Initial value of the RequestItem_id property.</param> /// <param name="service_id">Initial value of the Service_id property.</param> /// <param name="price">Initial value of the Price property.</param> public static RequestItemService CreateRequestItemService(global::System.Int32 id, global::System.Int32 requestItem_id, global::System.Int32 service_id, global::System.Decimal price) { RequestItemService requestItemService = new RequestItemService(); requestItemService.Id = id; requestItemService.RequestItem_id = requestItem_id; requestItemService.Service_id = service_id; requestItemService.Price = price; return requestItemService; }