public IHttpActionResult PutOrder_Line(int id, Order_Line order_Line) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != order_Line.Line_ID) { return(BadRequest()); } db.Entry(order_Line).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Order_LineExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { Order_Line order_Line = db.Order_Line.Find(id); db.Order_Line.Remove(order_Line); db.SaveChanges(); return(RedirectToAction("Index")); }
public void RunTests() { session = NHSessionHelper.OpenSession(); transaction = session.BeginTransaction(); orderLine = session.CreateCriteria(typeof(Order_Line)) .Add(Restrictions.Eq("OrderID", 10250)) .Add(Restrictions.Eq("ProductID", 51)) .UniqueResult<Order_Line>(); }
public void RunTests() { session = NHSessionHelper.OpenSession(); transaction = session.BeginTransaction(); orderLine = session.CreateCriteria(typeof(Order_Line)) .Add(Restrictions.Eq("OrderID", 10250)) .Add(Restrictions.Eq("ProductID", 51)) .UniqueResult <Order_Line>(); }
protected void btnItemAdd_Click(object sender, EventArgs e) { // for the first item, make the item panel visibl if (pItem.Visible == false) { pItem.Visible = true; } // get the inventory price from the dataset daInvPrice.Fill(dsSale.getInvPrice, int.Parse(lbInventory.SelectedValue)); // make a new order_line to fill with data from the textboxes and dataset Order_Line line = new Order_Line(); line.orlQuantity = int.Parse(txtQuantityItem.Text); line.inventoryID = int.Parse(lbInventory.SelectedValue); line.orlPrice = daInvPrice.GetData(line.inventoryID)[0].invPrice; line.orlNote = (txtItemNote.Text.Length > 0) ? txtItemNote.Text : ""; if (rblItemPaid.SelectedValue == "yes") { line.orlOrderReq = false; } else { line.orlOrderReq = true; } //add this line item to the list of line items olList.Add(line); // empty tablerow to put into each look so it may be used TableRow row; // clear total variables iTotal = 0; sTotal = 0; gTotal = 0; foreach (Service_Order servOrd in servList) { MakeServiceRow(servOrd, out row); serviceTable.Rows.Add(row); } foreach (Order_Line orderLine in olList) { MakeItemRow(orderLine, out row); itemTable.Rows.Add(row); } // put total values into their labels itemTotal.Text = iTotal.ToString("c"); serviceTotal.Text = sTotal.ToString("c"); grandTotal.Text = gTotal.ToString("c"); }
public IHttpActionResult GetOrder_Line(int id) { Order_Line order_Line = db.Order_Line.Find(id); if (order_Line == null) { return(NotFound()); } return(Ok(order_Line)); }
public IHttpActionResult PostOrder_Line(Order_Line order_Line) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Order_Line.Add(order_Line); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = order_Line.Line_ID }, order_Line)); }
public ActionResult Edit([Bind(Include = "BookingBookingID,OlCarID,ReturnDate,ReturnStatus")] Order_Line order_Line) { if (ModelState.IsValid) { db.Entry(order_Line).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BookingBookingID = new SelectList(db.Bookings, "BookingID", "Contact_PhoneNumber", order_Line.BookingBookingID); ViewBag.OlCarID = new SelectList(db.Cars, "CarID", "CarVin", order_Line.OlCarID); return(View(order_Line)); }
public ActionResult Edit([Bind(Include = "orderlineID,orderID,productID,orderQuantity")] Order_Line order_Line) { if (ModelState.IsValid) { db.Entry(order_Line).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.orderID = new SelectList(db.Orders, "orderID", "customerID", order_Line.orderID); ViewBag.productID = new SelectList(db.Products, "productID", "productDescription", order_Line.productID); return(View(order_Line)); }
public IHttpActionResult PostOrderL(Order_Line order) { db.Configuration.ProxyCreationEnabled = false; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Order_Line.Add(order); db.SaveChanges(); return(Ok(1)); }
public ActionResult Edit([Bind(Include = "InvSuppOrder_ID,Inventory_ID,SuppOrder_Status_ID,Quanity,Line_Total,Date")] Order_Line order_Line) { if (ModelState.IsValid) { db.Entry(order_Line).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Inventory_ID = new SelectList(db.Inventories, "Inventory_ID", "Inventory_Name", order_Line.Inventory_ID); ViewBag.InvSuppOrder_ID = new SelectList(db.Inventory_Supplier_Order, "InvSuppOrder_ID", "InvSuppOrder_ID", order_Line.InvSuppOrder_ID); ViewBag.SuppOrder_Status_ID = new SelectList(db.Order_Status, "SuppOrder_Status_ID", "Order_Status_Description", order_Line.SuppOrder_Status_ID); return(View(order_Line)); }
public IHttpActionResult DeleteOrder_Line(int id) { Order_Line order_Line = db.Order_Line.Find(id); if (order_Line == null) { return(NotFound()); } db.Order_Line.Remove(order_Line); db.SaveChanges(); return(Ok(order_Line)); }
// GET: Order_Line/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Order_Line order_Line = db.Order_Line.Find(id); if (order_Line == null) { return(HttpNotFound()); } return(View(order_Line)); }
// GET: Order_Line/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Order_Line order_Line = db.Order_Line.Find(id); if (order_Line == null) { return(HttpNotFound()); } ViewBag.BookingBookingID = new SelectList(db.Bookings, "BookingID", "Contact_PhoneNumber", order_Line.BookingBookingID); ViewBag.OlCarID = new SelectList(db.Cars, "CarID", "CarVin", order_Line.OlCarID); return(View(order_Line)); }
// GET: Order_Line/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Order_Line order_Line = db.Order_Line.Find(id); if (order_Line == null) { return(HttpNotFound()); } ViewBag.orderID = new SelectList(db.Orders, "orderID", "customerID", order_Line.orderID); ViewBag.productID = new SelectList(db.Products, "productID", "productDescription", order_Line.productID); return(View(order_Line)); }
// GET: Order_Line/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Order_Line order_Line = db.Order_Line.Find(id); if (order_Line == null) { return(HttpNotFound()); } ViewBag.Inventory_ID = new SelectList(db.Inventories, "Inventory_ID", "Inventory_Name", order_Line.Inventory_ID); ViewBag.InvSuppOrder_ID = new SelectList(db.Inventory_Supplier_Order, "InvSuppOrder_ID", "InvSuppOrder_ID", order_Line.InvSuppOrder_ID); ViewBag.SuppOrder_Status_ID = new SelectList(db.Order_Status, "SuppOrder_Status_ID", "Order_Status_Description", order_Line.SuppOrder_Status_ID); return(View(order_Line)); }