/// <summary> /// Lock the Screen and show shipment window. /// </summary> private void _show_Shipment() { try { Boolean _return = false; //lock the shipment that is under packing process. if (Global.Mode == "SameUser") { _return = _shipmentLock(2); } else if (Global.Mode == "Override") { _return = _shipmentLock(1); } else { _return = _shipmentLock(0); } if (_return) { //Start please wait screen in saprate thread. WindowThread.start(); //Set the Global Shiment Number Global.ShippingNumber = txtShipmentId.Text.ToUpper(); ShipmentScreen shipmentScreen = new ShipmentScreen(); //loger add log. SaveUserLogsTbl.logThis(csteActionType.ShipmentID_Scan.ToString(), Global.ShippingNumber.ToString()); _scrollMsg("Valid Shipment Scanned. Shipment ID =" + Global.ShippingNumber, Color.FromRgb(38, 148, 189)); shipmentScreen.Show(); //close thi screen. this.Close(); } else { _scrollMsg("Warning: shipping information not available. Please scan another shipment.", Color.FromRgb(222, 87, 24)); txtShipmentId.Text = ""; } } catch (Exception Ex) { //Log the Error to the Error Log table ErrorLoger.save("wndShipmentScanPage - _show_Shipment", " [" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId); } }
/// <summary> /// manager Override Option Result /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtUserName_KeyDown(object sender, KeyEventArgs e) { //Logout expire timer RE-start SessionManager.StartTime(); try { if (e.Key == Key.Enter) { if (txtUserName.Text != "") { List <cstUserMasterTbl> _lsUser = Global.controller.GetSelcetedUserMaster(txtUserName.Text); if (Global.controller.CanOverrideShipment(_lsUser[0].UserID)) { Global.ManagerID = _lsUser[0].UserID; Global.ManagerName = _lsUser[0].UserFullName; Global.Mode = "Override"; SessionManager.Autotimer.Stop(); //wait screen; WindowThread.start(); ShipmentLock(1); ShipmentScreen _ShipmentScreen = new ShipmentScreen(); _ShipmentScreen.Show(); App.Current.Windows[0].Close(); this.Close(); } else { Global.ManagerName = ""; LblTitle.Content = Global.controller.ConvetLanguage("Access Denied.", Global.LanguageFileName); lblmsg.Text = Environment.NewLine + Environment.NewLine + Global.controller.ConvetLanguage(" You are not authorized to override. ", Global.LanguageFileName); txtUserName.Text = ""; btnCancel.Visibility = System.Windows.Visibility.Hidden; btnOK.Visibility = System.Windows.Visibility.Visible; btnOK.Focus(); } } else { lblmsg.Text = Environment.NewLine + Environment.NewLine + Global.controller.ConvetLanguage(" Please rescan badge. ", Global.LanguageFileName); txtUserName.Text = ""; } } } catch (Exception) { } }