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);
        }
Beispiel #2
0
        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");
                }
            }
        }