private void DoSave() { try { Calbee.WMS.Services.OutboundService.PickItem putstaging = new Calbee.WMS.Services.OutboundService.PickItem(); putstaging.Device = AppContext.DeviceName; putstaging.PickingListNumber = this.txtPickingListNo.Text.Trim(); putstaging.WarehouseCode = Calbee.Infra.Common.Constants.WConstants.wareHouseDDL; putstaging.Location = Calbee.Infra.Common.Constants.WConstants.forkLiftDDL; putstaging.PickBy = Calbee.Infra.Common.Constants.WConstants.userName; putstaging.PickDate = Convert.ToDateTime(AppContext.GetDateTimeServerString(Calbee.Infra.Common.Constants.WConstants.formatDateString)); putstaging.PickDateSpecified = true; putstaging.ToLocation = this.txtToLocation.Text.Trim(); Calbee.WMS.Services.OutboundService.Response savePutToStaging = Calbee.WMS.Services.Outbound.OutboundServiceProxy.WS.PutToStaging(putstaging); if (savePutToStaging != null) { if (savePutToStaging.StatusCode == 0) { // Success = StatusCode 0 MsgBox.DialogInfomation(savePutToStaging.Message); } else { MsgBox.DialogError(savePutToStaging.Message); } } } catch (Exception ex) { if (ex.InnerException != null) { MsgBox.DialogError(ex.InnerException.Message.ToString()); } else { if (Calbee.Infra.Common.Constants.IConstants.CatchFlag.Equals("Y")) { // Show error description detail MsgBox.DialogError(ex.GetBaseException().ToString()); } else { // Show message error MsgBox.DialogError(ex.Message.ToString()); } } } }
private void txtLPN_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (string.IsNullOrEmpty(this.txtLPN.Text.Trim())) { MsgBox.DialogWarning("Please scan lpn"); this.txtLPN.Focus(); this.txtLPN.SelectAll(); return; } else { try { Calbee.WMS.Services.OutboundService.PickItem lpnResult = Calbee.WMS.Services.Outbound.OutboundServiceProxy.WS.GetOutboundPickingListLpn(string.Empty, this.txtPickingListNo.Text.Trim(), string.Empty, this.txtLPN.Text.Trim()); if (lpnResult != null) { this.txtItemNumber.Text = string.IsNullOrEmpty(lpnResult.ItemNumber) ? string.Empty : lpnResult.ItemNumber; entPickItem.itemNumber = string.IsNullOrEmpty(lpnResult.ItemNumber) ? string.Empty : lpnResult.ItemNumber; this.txtDescription.Text = string.IsNullOrEmpty(lpnResult.ItemName) ? string.Empty : lpnResult.ItemName; this.txtLotNumber.Text = string.IsNullOrEmpty(lpnResult.LotNumber) ? string.Empty : lpnResult.LotNumber; entPickItem.lotNumber = string.IsNullOrEmpty(lpnResult.LotNumber) ? string.Empty : lpnResult.LotNumber; this.txtExpiryDate.Text = string.IsNullOrEmpty(lpnResult.ExpiryDate) ? string.Empty : lpnResult.ExpiryDate; entPickItem.expiryDate = string.IsNullOrEmpty(lpnResult.ExpiryDate) ? string.Empty : lpnResult.ExpiryDate; this.txtQuantity.Text = string.IsNullOrEmpty(lpnResult.QuantityPlan.ToString()) ? string.Empty : lpnResult.QuantityPlan.ToString(); entPickItem.quantityPlan = lpnResult.QuantityPlan; ComboBoxBinding.BindEntityToCombobox(AppContext.UOMDDLBinding(this.txtItemNumber.Text.Trim()), this.cmbUOM, "Uom", "Uom", ""); this.cmbUOM.SelectedValue = string.IsNullOrEmpty(lpnResult.Uom) ? string.Empty : lpnResult.Uom; entPickItem.uom = string.IsNullOrEmpty(lpnResult.Uom) ? string.Empty : lpnResult.Uom; this.txtItemStatus.Text = string.IsNullOrEmpty(lpnResult.Status) ? string.Empty : lpnResult.Status; entPickItem.status = string.IsNullOrEmpty(lpnResult.Status) ? string.Empty : lpnResult.Status; entPickItem.location = string.IsNullOrEmpty(lpnResult.Location) ? string.Empty : lpnResult.Location; this.txtToLPN.Text = this.txtLPN.Text.Trim(); this.lblResultCounter.Text = lpnResult.CompletedPalletQty + "/" + lpnResult.PlanPalletQty; this.txtQuantity.Focus(); this.txtQuantity.SelectAll(); } else { MsgBox.DialogWarning("Null LPN : " + this.txtLPN.Text.Trim() + " in system"); this.txtLPN.Focus(); this.txtLPN.SelectAll(); return; } } catch (Exception ex) { if (ex.InnerException != null) { MsgBox.DialogError(ex.InnerException.Message.ToString()); } else { if (Calbee.Infra.Common.Constants.IConstants.CatchFlag.Equals("Y")) { // Show error description detail MsgBox.DialogError(ex.GetBaseException().ToString()); } else { // Show message error MsgBox.DialogError(ex.Message.ToString()); } } } } } }
private void DoSave() { try { Calbee.WMS.Services.OutboundService.PickItem pickitem = new Calbee.WMS.Services.OutboundService.PickItem(); pickitem.Device = AppContext.DeviceName; pickitem.PickBy = Calbee.Infra.Common.Constants.WConstants.userName; pickitem.WarehouseCode = Calbee.Infra.Common.Constants.WConstants.wareHouseDDL; pickitem.Location = entPickItem.location; pickitem.ToLocation = this.txtSTGLocation.Text.Trim(); pickitem.Lpn = this.txtLPN.Text.Trim(); pickitem.ToLpn = this.txtToLPN.Text.Trim(); pickitem.PickDate = Convert.ToDateTime(AppContext.GetDateTimeServerString(Calbee.Infra.Common.Constants.WConstants.formatDateString)); pickitem.PickDateSpecified = true; pickitem.PickingListNumber = this.txtPickingListNo.Text.Trim(); pickitem.CarLicense = this.txtCarLicense.Text.Trim(); if (this.txtItemNumber.Text.Trim() == Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL) { // Select item number ALL pickitem.ItemNumber = Calbee.Infra.Common.Constants.WConstants.defaultDropdownALL; } else { // Select item pickitem.ItemNumber = this.txtItemNumber.Text.Trim(); pickitem.LotNumber = this.txtLotNumber.Text.Trim(); pickitem.ExpiryDate = this.txtExpiryDate.Text.Trim(); pickitem.QuantityPick = Convert.ToDouble(this.txtQuantity.Text.Trim()); pickitem.QuantityPickSpecified = true; pickitem.Uom = this.cmbUOM.SelectedValue.ToString(); pickitem.Status = string.IsNullOrEmpty(this.txtItemStatus.Text.Trim()) ? Calbee.Infra.Common.Constants.WConstants.defaultItemStatus : this.txtItemStatus.Text.Trim(); } Calbee.WMS.Services.OutboundService.Response saveShortPickItem = Calbee.WMS.Services.Outbound.OutboundServiceProxy.WS.SetPickItem(pickitem); if (saveShortPickItem != null) { if (saveShortPickItem.StatusCode == 0) { // Success = StatusCode 0 MsgBox.DialogInfomation(saveShortPickItem.Message); string[] arrayCouter = this.lblResultCounter.Text.Split('/'); if (arrayCouter[1].ToString() == "0") { this.lblResultCounter.Text = "0/0"; } else { string tempQuantity = string.IsNullOrEmpty(this.txtQuantity.Text) ? "0" : this.txtQuantity.Text.Trim(); string tempArray = string.IsNullOrEmpty(arrayCouter[0].ToString()) ? "0" : arrayCouter[0].ToString().Trim(); string tempTotal = string.IsNullOrEmpty(arrayCouter[1].ToString()) ? "0" : arrayCouter[1].ToString().Trim(); string[] arrayCountInt = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(1)).Split('.'); if (arrayCountInt.Length == 2) { if (arrayCountInt[1].ToString() == "0") { this.lblResultCounter.Text = arrayCountInt[0].ToString() + "/" + tempTotal; } else { this.lblResultCounter.Text = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(1)) + "/" + tempTotal; } } else { this.lblResultCounter.Text = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(1)) + "/" + tempTotal; } } DoAfterSave(); } else { MsgBox.DialogError(saveShortPickItem.Message); } } } catch (Exception ex) { if (ex.InnerException != null) { MsgBox.DialogError(ex.InnerException.Message.ToString()); } else { if (Calbee.Infra.Common.Constants.IConstants.CatchFlag.Equals("Y")) { // Show error description detail MsgBox.DialogError(ex.GetBaseException().ToString()); } else { // Show message error MsgBox.DialogError(ex.Message.ToString()); } } } }
private void DoSave() { try { Calbee.WMS.Services.OutboundService.PickItem loaditem = new Calbee.WMS.Services.OutboundService.PickItem(); loaditem.CarLicense = this.txtCarLicense.Text.Trim(); loaditem.ContainerNo = this.txtContanierNo.Text.Trim(); loaditem.Device = AppContext.DeviceName; loaditem.ExpiryDate = this.txtExpiryDate.Text.Trim(); loaditem.ExpiryDateControl = entLoadItem.expiryDateControl; loaditem.ExpiryDateControlSpecified = true; loaditem.ItemNumber = this.txtItemNumber.Text.Trim(); loaditem.Location = this.txtStagingLocation.Text.Trim(); loaditem.ToLocation = this.txtDockDoor.Text.Trim(); loaditem.LotControl = entLoadItem.lotControl; loaditem.LotControlSpecified = true; loaditem.LotNumber = this.txtLotNumber.Text.Trim(); loaditem.Lpn = this.txtLPN.Text.Trim(); loaditem.ToLpn = this.txtLPN.Text.Trim(); loaditem.OrderNumber = this.txtOrderNumber.Text.Trim(); loaditem.QuantityLoad = Convert.ToDouble(this.txtQuantity.Text); loaditem.QuantityLoadSpecified = true; loaditem.Status = this.txtItemStatus.Text.Trim(); loaditem.Uom = this.cmbUOM.SelectedValue.ToString(); loaditem.PickBy = Calbee.Infra.Common.Constants.WConstants.userName; loaditem.PickDate = AppContext.GetDateTimeServer(); loaditem.WarehouseCode = Calbee.Infra.Common.Constants.WConstants.wareHouseDDL; Calbee.WMS.Services.OutboundService.Response saveLoad = Calbee.WMS.Services.Outbound.OutboundServiceProxy.WS.SetLoadItem(loaditem); if (saveLoad != null) { if (saveLoad.StatusCode == 0) { // Success = StatusCode 0 MsgBox.DialogInfomation(saveLoad.Message); string[] arrayCouter = this.lblResultCounter.Text.Split('/'); if (arrayCouter[1].ToString() == "0") { this.lblResultCounter.Text = "0/0"; } else { string tempQuantity = string.IsNullOrEmpty(this.txtQuantity.Text) ? "0" : this.txtQuantity.Text.Trim(); string tempArray = string.IsNullOrEmpty(arrayCouter[0].ToString()) ? "0" : arrayCouter[0].ToString().Trim(); string tempTotal = string.IsNullOrEmpty(arrayCouter[1].ToString()) ? "0" : arrayCouter[1].ToString().Trim(); // string[] arrayCountInt = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(tempQuantity)).Split('.'); string[] arrayCountInt = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(1)).Split('.'); if (arrayCountInt.Length == 2) { if (arrayCountInt[1].ToString() == "0") { this.lblResultCounter.Text = arrayCountInt[0].ToString() + "/" + tempTotal; } else { this.lblResultCounter.Text = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(1)) + "/" + tempTotal; } } else { this.lblResultCounter.Text = Convert.ToString(Convert.ToDecimal(tempArray) + Convert.ToDecimal(1)) + "/" + tempTotal; } } DoAfterSave(); } else { MsgBox.DialogError(saveLoad.Message); } } } catch (Exception ex) { if (ex.InnerException != null) { MsgBox.DialogError(ex.InnerException.Message.ToString()); } else { if (Calbee.Infra.Common.Constants.IConstants.CatchFlag.Equals("Y")) { // Show error description detail MsgBox.DialogError(ex.GetBaseException().ToString()); } else { // Show message error MsgBox.DialogError(ex.Message.ToString()); } } } }