private bool ShippingUnit_Edit(PurchaseOrderShippingUnit shippingunit) { try { Assert.IsTrue(shippingunit.LoadOn.SelectByText(_PurchaseOrderShippingUnitData.LoadOn)); Assert.IsTrue(shippingunit.UnitQty.ClearAndEdit(_PurchaseOrderShippingUnitData.UnitQty)); Assert.IsTrue(shippingunit.UnitDimensionsLength.ClearAndEdit(_PurchaseOrderShippingUnitData.Length)); Assert.IsTrue(shippingunit.UnitDimensionWidth.ClearAndEdit(_PurchaseOrderShippingUnitData.Width)); Assert.IsTrue(shippingunit.UnitDimensionHeight.ClearAndEdit(_PurchaseOrderShippingUnitData.Height)); return(true); } catch { return(false); } }
private bool FillCommodity(PurchaseOrderCommodity commodity, bool threshHold, PurchaseOrderShippingUnit shippingUnit) { try { string actQty; if (_MyOrderData.EntityType.ToUpper() == "FACILITY") { if (shippingUnit.OrigQtyHeader.GetText().Trim().Equals("Orig Qty")) { actQty = ((commodity.ExpQtyWhenOriginal.GetText() == "--" || commodity.ExpQtyWhenOriginal.GetText() == null) ? "1" : commodity.ExpQtyWhenOriginal.GetText()); } else { actQty = ((commodity.ExpQtyWhenNoOriginal.GetText() == "--" || commodity.ExpQtyWhenNoOriginal.GetText() == null) ? "1" : commodity.ExpQtyWhenNoOriginal.GetText()); } Assert.IsTrue(commodity.Weight.ClearAndEdit(_PurchaseOrderCommodityData.Weight)); Assert.IsTrue(commodity.ActQty.ClearAndEdit(actQty)); Assert.IsTrue(commodity.ActQty.Edit(Keys.Tab)); } else { if (threshHold) { actQty = (Convert.ToInt32(commodity.ExpQty.GetText(0)) / 2).ToString(); int leftOverQty = (Convert.ToInt32(commodity.ExpQty.GetText(0)) - (Convert.ToInt32(commodity.ExpQty.GetText(0)) / 2)); SetLeftOverQty(commodity, leftOverQty); Random random = new Random(); int randomNumber = random.Next(100, 700); string refNo = commodity.ItemNumber.GetValue() + "_Test-ref-" + randomNumber; Assert.IsTrue(commodity.ItemNumber.ClearAndEdit(refNo)); } else { actQty = (commodity.ExpQty.GetText(0) == "--" ? "10" : commodity.ExpQty.GetText(0)); } Assert.IsTrue(commodity.Description.ClearAndEdit(_PurchaseOrderCommodityData.Description)); Assert.IsTrue(commodity.ItemNumber.ClearAndEdit(_PurchaseOrderCommodityData.ItemNumber)); Assert.IsTrue(commodity.Weight.ClearAndEdit(_PurchaseOrderCommodityData.Weight)); Assert.IsTrue(commodity.ActQty.ClearAndEdit(actQty)); Assert.IsTrue(commodity.ActQty.Edit(Keys.Tab)); Assert.IsTrue(commodity.Value.ClearAndEdit(_PurchaseOrderCommodityData.Value)); Assert.IsTrue(commodity.Packaging.SelectByText(_PurchaseOrderCommodityData.Packaging)); Assert.IsTrue(commodity.Hazmat.SelectByText(_PurchaseOrderCommodityData.Hazmat)); Assert.IsTrue(commodity.UnitNumber.ClearAndEdit(_PurchaseOrderCommodityData.UnitNmuber)); } return(true); } catch { return(false); } }