Ejemplo n.º 1
0
        private void DoSave()
        {
            try
            {
                Calbee.WMS.Services.InventoryService.InventoryItem pickup = new Calbee.WMS.Services.InventoryService.InventoryItem();
                pickup.AllLpn          = false;
                pickup.AllLpnSpecified = true;
                pickup.Device          = AppContext.DeviceName;
                pickup.PickBy          = Calbee.Infra.Common.Constants.WConstants.userName;
                pickup.WarehouseCode   = Calbee.Infra.Common.Constants.WConstants.wareHouseDDL;
                pickup.ToLocation      = this.txtLocation.Text.Trim();
                pickup.SubTranType     = Calbee.Infra.Common.Constants.WConstants.ChangeStatusTranType;
                pickup.TransactionType = Calbee.Infra.Common.Constants.WConstants.ChangeStatusTranType;
                pickup.Lpn             = this.txtLPN.Text.Trim();
                pickup.ToLpn           = toLpn;
                pickup.Location        = this.txtLocation.Text.Trim();
                // Select item
                pickup.AllItem           = false;
                pickup.AllItemSpecified  = true;
                pickup.ItemNumber        = this.txtItemNumber.Text.Trim();
                pickup.AllExp            = false;
                pickup.AllExpSpecified   = true;
                pickup.ExpiryDate        = this.dtpExpiryDate.Value.ToString("yyyy-MM-dd");
                pickup.AllLot            = false;
                pickup.AllLotSpecified   = true;
                pickup.LotNumber         = this.txtLotNumber.Text.Trim();
                pickup.Quantity          = Convert.ToDouble(this.txtQuantity.Text.Trim());
                pickup.QuantitySpecified = true;
                pickup.Uom      = this.UOM;
                pickup.Status   = this.cmbItemStatus.SelectedValue.ToString();
                pickup.ToStatus = this.cmbToItemStatus.SelectedValue.ToString();

                Calbee.WMS.Services.InventoryService.Response saveRecevie = Calbee.WMS.Services.Inventory.InventoryServiceProxy.WS.SetPickupPutawayItem(pickup);
                if (saveRecevie != null)
                {
                    if (saveRecevie.StatusCode == 0)
                    {
                        // Success = StatusCode 0
                        MsgBox.DialogInfomation(saveRecevie.Message);
                        DoAfterSave();
                    }
                    else
                    {
                        MsgBox.DialogError(saveRecevie.Message);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    MsgBox.DialogError(ex.InnerException.Message.ToString());
                }
                else
                {
                    MsgBox.DialogError(ex.GetBaseException().ToString());
                }
            }
        }
Ejemplo n.º 2
0
        private void DoSave()
        {
            try
            {
                Calbee.WMS.Services.InventoryService.InventoryItem pickup = new Calbee.WMS.Services.InventoryService.InventoryItem();
                pickup.AllLpn          = false;
                pickup.AllLpnSpecified = true;
                pickup.Device          = AppContext.DeviceName;
                pickup.PickBy          = Calbee.Infra.Common.Constants.WConstants.userName;
                pickup.WarehouseCode   = Calbee.Infra.Common.Constants.WConstants.wareHouseDDL;
                pickup.ToLocation      = Calbee.Infra.Common.Constants.WConstants.forkLiftDDL;
                pickup.SubTranType     = Calbee.Infra.Common.Constants.WConstants.PickupTranType;
                pickup.TransactionType = Calbee.Infra.Common.Constants.WConstants.PickupTranType;
                pickup.Lpn             = this.txtLPN.Text.Trim();
                pickup.ToLpn           = this.txtToLPN.Text.Trim();
                pickup.Location        = this.txtLocation.Text.Trim();
                if (this.txtItemNumber.Text.Trim() == Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL)
                {
                    // Select item number ALL
                    pickup.AllItem          = true;
                    pickup.AllItemSpecified = true;
                    pickup.ItemNumber       = Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL;
                    pickup.PickDate         = Convert.ToDateTime(AppContext.GetDateTimeServerString(Calbee.Infra.Common.Constants.WConstants.formatDateString));
                }
                else
                {
                    // Select item
                    pickup.AllItem           = false;
                    pickup.AllItemSpecified  = true;
                    pickup.ItemNumber        = this.txtItemNumber.Text.Trim();
                    pickup.AllExp            = this.txtExpiryDate.Text.Trim() == Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL ? true : false;
                    pickup.AllExpSpecified   = true;
                    pickup.ExpiryDate        = this.txtExpiryDate.Text.Trim();
                    pickup.AllLot            = this.txtLotNumber.Text.Trim() == Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL ? true : false;
                    pickup.AllLotSpecified   = true;
                    pickup.LotNumber         = this.txtLotNumber.Text.Trim();
                    pickup.Quantity          = Convert.ToDouble(this.txtQuantity.Text.Trim());
                    pickup.QuantitySpecified = true;
                    pickup.Uom    = this.cmbUOM.SelectedValue.ToString();
                    pickup.Status = this.cmbItemStatus.SelectedValue.ToString();
                }

                Calbee.WMS.Services.InventoryService.Response saveRecevie = Calbee.WMS.Services.Inventory.InventoryServiceProxy.WS.SetPickupPutawayItem(pickup);
                if (saveRecevie != null)
                {
                    if (saveRecevie.StatusCode == 0)
                    {
                        // Success = StatusCode 0
                        MsgBox.DialogInfomation(saveRecevie.Message);
                        if (this.txtItemNumber.Text.Trim() == Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL)
                        {
                            DoAfterSave("ALL");
                        }
                        else
                        {
                            DoAfterSave("ITEMS");
                        }
                    }
                    else
                    {
                        MsgBox.DialogError(saveRecevie.Message);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    MsgBox.DialogError(ex.InnerException.Message.ToString());
                }
                else
                {
                    MsgBox.DialogError(ex.GetBaseException().ToString());
                }
            }
        }