private void appContextUOMBinding(string itemNumber) { try { ComboBoxBinding.BindEntityToCombobox(AppContext.UOMDDLBinding(itemNumber), this.cmbUOM, "Uom", "Uom", ""); } 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 txtItemNumber_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { try { var itemResult = Calbee.WMS.Services.Count.CountServiceProxy.WS.GetCountDetail(Calbee.Infra.Common.Constants.WConstants.wareHouseDDL, this.cmbCountNumner.SelectedValue.ToString(), this.txtLocation.Text.Trim(), this.txtLPN.Text.Trim(), this.txtItemNumber.Text.Trim()); if (itemResult != null) { if (itemResult.Count() > 0) { this.txtDescription.Text = string.IsNullOrEmpty(itemResult.FirstOrDefault().ItemName) ? string.Empty : itemResult.FirstOrDefault().ItemName; this.txtLotNumber.Text = string.IsNullOrEmpty(itemResult.FirstOrDefault().LotNumber) ? string.Empty : itemResult.FirstOrDefault().LotNumber; this.txtExpiryDate.Text = string.IsNullOrEmpty(itemResult.FirstOrDefault().ExpiryDate) ? string.Empty : itemResult.FirstOrDefault().ExpiryDate; this.txtQuantity.Text = string.IsNullOrEmpty(itemResult.FirstOrDefault().CountQty.ToString()) ? string.Empty : itemResult.FirstOrDefault().CountQty.ToString(); ComboBoxBinding.BindEntityToCombobox(AppContext.UOMDDLBinding(this.txtItemNumber.Text.Trim()), this.cmbUOM, "Uom", "Uom", ""); this.cmbUOM.SelectedValue = string.IsNullOrEmpty(itemResult.FirstOrDefault().Uom) ? string.Empty : itemResult.FirstOrDefault().Uom; defaultItemStatusBinding(string.IsNullOrEmpty(itemResult.FirstOrDefault().ItemStatus) ? string.Empty : itemResult.FirstOrDefault().ItemStatus); } else { MsgBox.DialogWarning("Not found item number : " + this.txtItemNumber.Text.Trim() + " in system"); this.txtItemNumber.Focus(); this.txtItemNumber.SelectAll(); return; } } else { MsgBox.DialogWarning("Not found item number : " + this.txtItemNumber.Text.Trim() + " in system"); this.txtItemNumber.Focus(); this.txtItemNumber.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 defaultItemStatusBinding(string statusName) { try { List <Calbee.WMS.Services.MasterService.tbc_Status> _listItemStatus = new List <Calbee.WMS.Services.MasterService.tbc_Status>(); Calbee.WMS.Services.MasterService.tbc_Status _master; _listItemStatus = Calbee.WMS.Services.Masters.MasterServiceProxy.WS.GetStatus(Calbee.Infra.Common.Constants.WConstants.reciveItemStatusType).ToList(); if (_listItemStatus != null) { /*แสดงแบบ ถ้ามีข้อมูลเพียง Record เดียวให้ แสดงค่ามาเลย*/ if (string.IsNullOrEmpty(statusName)) { if (_listItemStatus.Count() > 1) { _master = new Calbee.WMS.Services.MasterService.tbc_Status(); _master.StatusName = Calbee.Infra.Common.Constants.WConstants.defaultDropdownSelect; _listItemStatus.Insert(0, _master); ComboBoxBinding.BindEntityToCombobox(_listItemStatus, this.cmbItemStatus, "StatusName", "StatusName", ""); } else { ComboBoxBinding.BindEntityToCombobox(_listItemStatus, this.cmbItemStatus, "StatusName", "StatusName", ""); } } else { ComboBoxBinding.BindEntityToCombobox(_listItemStatus, this.cmbItemStatus, "StatusName", "StatusName", ""); this.cmbItemStatus.Text = statusName; } } else { this.cmbItemStatus.DataSource = null; } } 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 ItemStatusBinding() { try { List <Calbee.WMS.Services.MasterService.tbc_Status> _listItemStatus = new List <Calbee.WMS.Services.MasterService.tbc_Status>(); //Calbee.WMS.Services.MasterService.tbc_Status _master; _listItemStatus = Calbee.WMS.Services.Masters.MasterServiceProxy.WS.GetStatus(Calbee.Infra.Common.Constants.WConstants.reciveItemStatusType).ToList(); if (_listItemStatus != null) { if (_listItemStatus.Count() == 1) { // Default value ReceiveNumber ComboBoxBinding.BindEntityToCombobox(_listItemStatus, this.cmbToItemStatus, "StatusName", "StatusName", ""); } else if (_listItemStatus.Count() > 1) { // Binding dropdowm ComboBoxBinding.BindEntityToCombobox(_listItemStatus, this.cmbToItemStatus, "StatusName", "StatusName", ""); } else { this.cmbToItemStatus.DataSource = null; } } else { this.cmbToItemStatus.DataSource = null; } } 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 ScanItemNumber(string itemNumber) { try { // var itemResult = Calbee.WMS.Services.Count.CountLocationServiceProxy.WS.GetCountDetail(Calbee.Infra.Common.Constants.WConstants.wareHouseDDL, this.cmbCountNumner.SelectedValue.ToString(), this.txtLocation.Text.Trim(), string.Empty, itemNumber); var itemResult = Calbee.WMS.Services.Count.CountLocationServiceProxy.WS.GetCountDetail(Calbee.Infra.Common.Constants.WConstants.wareHouseDDL, this.txtCountNumber.Text.Trim(), this.txtLocation.Text.Trim(), string.Empty, itemNumber); if (itemResult != null) { this.txtDescription.Text = string.IsNullOrEmpty(itemResult.FirstOrDefault().ItemName) ? string.Empty : itemResult.FirstOrDefault().ItemName; this.txtCtcCode.Text = string.IsNullOrEmpty(itemResult.FirstOrDefault().CTCCode) ? string.Empty : itemResult.FirstOrDefault().CTCCode; ComboBoxBinding.BindEntityToCombobox(AppContext.UOMDDLSingleBinding(this.cmbItemNumber.SelectedValue.ToString()), this.cmbUOM, "Uom", "Uom", ""); defaultItemStatusBinding(this.cmbItemNumber.SelectedValue.ToString(), string.Empty); this.txtQuantity.Text = itemResult.FirstOrDefault().StockQty.HasValue == false ? "0" : itemResult.FirstOrDefault().StockQty.Value.ToString(); this.cmbUOM.Focus(); } else { this.cmbItemNumber.Text = string.Empty; this.cmbItemNumber.DataSource = null; this.cmbUOM.Text = string.Empty; this.cmbUOM.DataSource = null; this.cmbItemStatus.Text = string.Empty; this.cmbItemStatus.DataSource = null; } } 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 ScanItemNumber() { try { var itemResult = Calbee.WMS.Services.Inventory.InventoryServiceProxy.WS.GetInventory(Calbee.Infra.Common.Constants.WConstants.wareHouseDDL, this.txtLocation.Text.Trim(), string.Empty, this.txtLPN.Text.Trim(), this.txtItemNumber.Text.Trim()); if (itemResult != null) { this.txtLotNumber.Enabled = itemResult.LotControl; if (itemResult.LotControl) { // Lotcontrol = true lotNumberBinding(this.txtLocation.Text.Trim(), this.txtLPN.Text.Trim(), this.txtItemNumber.Text.Trim()); } this.txtExpiryDate.Enabled = itemResult.ExpiryDateControl; if (itemResult.ExpiryDateControl) { // ExpiryDateControl = true expiryDateBinding(this.txtLocation.Text.Trim(), this.txtLPN.Text.Trim(), this.txtItemNumber.Text.Trim()); } this.txtDescription.Text = string.IsNullOrEmpty(itemResult.ItemName) ? string.Empty : itemResult.ItemName; ComboBoxBinding.BindEntityToCombobox(AppContext.UOMDDLBinding(this.txtItemNumber.Text.Trim()), this.cmbUOM, "Uom", "Uom", ""); this.cmbUOM.SelectedValue = itemResult.UOM; defaultItemStatusBinding(this.txtItemNumber.Text.Trim(), itemResult.StatusName); } } 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 UOMBinding(string itemNumber) { try { List <Calbee.WMS.Services.MasterService.ItemUom> _listUOM = new List <Calbee.WMS.Services.MasterService.ItemUom>(); Calbee.WMS.Services.MasterService.ItemUom _master; _listUOM = Calbee.WMS.Services.Masters.MasterServiceProxy.WS.GetItemUoms(itemNumber, string.Empty).ToList(); if (_listUOM != null) { _master = new Calbee.WMS.Services.MasterService.ItemUom(); _master.Uom = Calbee.Infra.Common.Constants.WConstants.defaultDropdownSelect; _listUOM.Insert(0, _master); ComboBoxBinding.BindEntityToCombobox(_listUOM, this.cmbUOM, "Uom", "ItemUomId", ""); } else { this.cmbUOM.DataSource = null; } } 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 warehouseBinding() { try { List <Calbee.WMS.Services.MasterService.Warehouse> _listWarehouse = new List <Calbee.WMS.Services.MasterService.Warehouse>(); Calbee.WMS.Services.MasterService.Warehouse _master; _listWarehouse = Calbee.WMS.Services.Masters.MasterServiceProxy.WS.GetWarehousesUser(AppContext.CurrentUser.UserId, true).ToList(); if (_listWarehouse != null) { _master = new Calbee.WMS.Services.MasterService.Warehouse(); _master.WarehouseCode = Calbee.Infra.Common.Constants.WConstants.defaultDropdownSelect; _listWarehouse.Insert(0, _master); ComboBoxBinding.BindEntityToCombobox(_listWarehouse, this.cmbWarehouse, "WarehouseCode", "WarehouseCode", ""); } else { this.cmbWarehouse.DataSource = null; } } 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 forkLiftBinding(string warehouseCode) { try { /* * List<Calbee.WMS.Services.MasterService.Location> _listForkLift = new List<Calbee.WMS.Services.MasterService.Location>(); * Calbee.WMS.Services.MasterService.Location _master; * _listForkLift = Calbee.WMS.Services.Masters.MasterServiceProxy.WS.GetLocations(warehouseCode, string.Empty, string.Empty, Calbee.Infra.Common.Constants.WConstants.locationType).ToList(); * if (_listForkLift != null) * { * if (_listForkLift.Count() == 1) * { * ComboBoxBinding.BindEntityToCombobox(_listForkLift, this.cmbForklift, "LocationCode", "LocationCode", ""); * } * else * { * _master = new Calbee.WMS.Services.MasterService.Location(); * _master.LocationCode = Calbee.Infra.Common.Constants.WConstants.defaultDropdownSelect; * _listForkLift.Insert(0, _master); * ComboBoxBinding.BindEntityToCombobox(_listForkLift, this.cmbForklift, "LocationCode", "LocationCode", ""); * } * } * else * { * this.cmbWarehouse.DataSource = null; * } */ List <Calbee.WMS.Services.MasterService.Location> _listForkLift = new List <Calbee.WMS.Services.MasterService.Location>(); Calbee.WMS.Services.MasterService.Location _master; string forkliftLocation = Calbee.WMS.Services.Masters.MasterServiceProxy.WS.GetWarehousesUserLocation(Calbee.Infra.Common.Constants.WConstants.userId, true, warehouseCode); if (!string.IsNullOrEmpty(forkliftLocation)) { _master = new Calbee.WMS.Services.MasterService.Location(); _master.LocationCode = forkliftLocation; _listForkLift.Insert(0, _master); ComboBoxBinding.BindEntityToCombobox(_listForkLift, this.cmbForklift, "LocationCode", "LocationCode", ""); } else { // MsgBox.ShowExclamation("Not found forklift by This Warehouse : " + this.cmbWarehouse.Text); this.cmbForklift.DataSource = null; } } 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()); } } } }