protected void SaveButton_Click(object sender, EventArgs e) { //need to use MessageUserControl? //traverse gridview collecting info //send in list of picklist, pickerid and orderid to orderlistscontroller OrderLists_Picking OrderListsController sysmgr = new OrderListsController(); List <PickList> pickedList = new List <PickList>(); IEnumerable <GridViewRow> rows = PickList.Rows.Cast <GridViewRow>(); pickedList = (from x in rows select new PickList { OrderListID = int.Parse((x.FindControl("OrderListID") as Label).Text), ProductDescription = (x.FindControl("ProductDescription") as Label).Text, Quantity = double.Parse((x.FindControl("Quantity") as Label).Text), Comment = (x.FindControl("Comment") as Label).Text, QuantityPicked = float.Parse((x.FindControl("QuantityPicked") as TextBox).Text), PickIssue = (x.FindControl("PickIssue") as TextBox).Text }).ToList(); //foreach(GridViewRow row in PickList.Rows) //{ // PickList picklist = new PickList(); // picklist.OrderListID = int.Parse((row.FindControl("OrderListID") as Label).Text); // picklist.ProductDescription = (row.FindControl("ProductDescription") as Label).Text; // picklist.Quantity = double.Parse((row.FindControl("Quantity") as Label).Text); // picklist.Comment = (row.FindControl("Comment") as Label).Text; // picklist.QuantityPicked = double.Parse((row.FindControl("QuantityPicked") as TextBox).Text); // picklist.PickIssue = (row.FindControl("PickIssue") as TextBox).Text; // pickedList.Add(picklist); //} sysmgr.OrderLists_Picking(int.Parse(PickerDLL.SelectedValue), int.Parse(OrderDLL.SelectedValue), pickedList); }
protected void FetchButton_Click(object sender, EventArgs e) { //need to use MessageUserControl? //fill in customer name and phone labels OrderListsController sysmgr = new OrderListsController(); //error handling? Customer customer = sysmgr.Customers_Get(int.Parse(OrderDLL.SelectedValue)); CustomerName.Text = customer.FullName; CustomerPhone.Text = customer.Phone; }
protected void SaveButton_Click(object sender, EventArgs e) { int orderid = int.Parse(OrderDDL.SelectedValue); int pickerid = int.Parse(PickerDDL.SelectedValue); List <PickList> picklist = new List <PickList>(); int emptycheck = 0; for (int rowindex = 0; rowindex < OrderList.Rows.Count; rowindex++) { PickList templist = new PickList(); templist.ProductDescription = (OrderList.Rows[rowindex].FindControl("ProductDescription") as Label).Text; templist.QtyOrdered = double.Parse((OrderList.Rows[rowindex].FindControl("QtyOrdered") as Label).Text); templist.Comment = (OrderList.Rows[rowindex].FindControl("Comment") as Label).Text; templist.Picked = double.Parse((OrderList.Rows[rowindex].FindControl("Picked") as TextBox).Text); if (templist.Picked >= 1) { emptycheck++; } templist.PickIssue = (OrderList.Rows[rowindex].FindControl("PickIssue") as TextBox).Text; picklist.Add(templist); } if (OrderList.Rows.Count == 0) { MessageUserControl.ShowInfo("Please pick an order"); } else { if (emptycheck == 0) { MessageUserControl.ShowInfo("Please pick the order"); } else { MessageUserControl.TryRun(() => { OrderListsController sysmgr = new OrderListsController(); sysmgr.OrderLists_Picking(pickerid, orderid, picklist); }, "Complete", "Your Order has been picked"); } } }
protected void FetchButton_Click(object sender, EventArgs e) { int orderid = int.Parse(OrderDDL.SelectedValue); MessageUserControl.TryRun(() => { OrderListsController sysmgr = new OrderListsController(); CustomerController sysmgr2 = new CustomerController(); List <PickList> results = sysmgr.OrderLists_OrderPickList(orderid); Customer result = sysmgr2.Customer_Get(orderid); Customername.Text = result.FullName; Phonenumber.Text = result.Phone; OrderList.DataSource = results; OrderList.DataBind(); }); }