Exemple #1
0
        internal void UpdateAllQty()
        {
            List <Shipping> shippingitems = _repository.GetShippingItems(_deliveryOrderTag);
            List <Shipping> fathItems     = _repository.GetFATHItems(_deliveryOrderTag);

            foreach (var row in _dataSet.Tables[0].Select())
            {
                row["FATH Part No."] = "";
                var shippings =
                    from item in shippingitems
                    where item["DO Part No."].ToString() == row["DO Part No."].ToString()
                    select item;
                foreach (var item in shippings)
                {
                    row["Customer Part No."] = item["Customer Part No."];
                    row["Customer Qty."]     = item["Customer Qty."];
                }
                int fathQty = 0;
                var faths   =
                    from items in fathItems
                    where items["FATH Part No."].ToString() == row["DO Part No."].ToString()
                    select items;
                foreach (var item in faths)
                {
                    row["FATH Part No."] = item["FATH Part No."];
                    fathQty += item.FATHQty;
                }
                row["FATH Qty."] = fathQty;

                if (_shipping.CustomerCheckingPoints == 2)
                {
                    row["Pass"] = Convert.ToInt32(row["FATH Qty."]) == Convert.ToInt32(row["DO Qty."]) ? "Y" : "N";
                }
                else
                {
                    row["Pass"] = ((Convert.ToInt32(row["FATH Qty."]) == Convert.ToInt32(row["DO Qty."])) &&
                                   (Convert.ToInt32(row["Customer Qty."]) == Convert.ToInt32(row["DO Qty."]))) ? "Y" : "N";
                }
            }
        }