Esempio n. 1
0
        public void fillGrid(string ShipmentNum)
        {
            try
            {
                lscarton = carton.GetCartonByShipmentNumber(ShipmentNum);
                List <Gridclass> lsgrid = new List <Gridclass>();
                foreach (var item in lscarton)
                {
                    Gridclass check = new Gridclass();
                    check.boxnumber = item.BOXNumber;
                    if (item.Printed == 0)
                    {
                        check.Status = "Not Printed";
                    }
                    else
                    {
                        check.Status = "Printed";
                    }
                    lsgrid.Add(check);
                }

                grdContent.ItemsSource = lsgrid;
                txtBoxNumberScanned.Focus();
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("wndBoxInfo - FillGrid", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
            }
        }
Esempio n. 2
0
        private void ShipmentLock(int OverrideMode)
        {
            try
            {
                //save Shipping Infromtaion.
                SaveShippingInformation(Global.ShippingNumber);

                List <cstPackageTbl> lsPacking      = new List <cstPackageTbl>();
                cstPackageTbl        _packingCustom = new cstPackageTbl();
                _packingCustom.ShippingNum      = Global.ShippingNumber;
                _packingCustom.UserID           = Global.ManagerID;
                _packingCustom.StartTime        = DateTime.UtcNow;
                _packingCustom.EndTime          = DateTime.UtcNow;
                _packingCustom.ShippingID       = Global.controller.GetShippingTbl(Global.ShippingNumber).ShippingID;
                _packingCustom.StationID        = Global.controller.GetStationMaster().SingleOrDefault(i => i.StationName == Global.StationName).StationID;
                _packingCustom.ShipmentLocation = Global.controller.ApplicationLocation();
                //Status: 1 - Under Packing Process.
                //Status: 0 - Packing Complete
                _packingCustom.PackingStatus  = 1;
                _packingCustom.MangerOverride = OverrideMode;
                lsPacking.Add(_packingCustom);
                Global.PackingID = Global.controller.SetPackingTable(lsPacking);
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("MainWindow.ShipmentLock()", Ex.ToString());
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Avinash
        /// Split the Time returned from locationsetting File in to hours , Min, Sec
        /// </summary>
        /// <param name="returnHHorMMorSS">String maintion HH to return Hour value same for Min-MM and for Sec value =SS</param>
        /// <returns>String depending on selection</returns>
        private string GetHrorMinorSec(String returnHHorMMorSS)
        {
            String _retuen = "";

            try
            {
                String _Time = Global.controller.ReadFromLocalFile("LogoutTime");
                if (_Time != null || _Time != "")
                {
                    var Str = _Time.Split(new Char[] { ':' });
                    switch (returnHHorMMorSS)
                    {
                    case "HH":
                        _retuen = Str[0];
                        break;

                    case "MM":
                        _retuen = Str[1];
                        break;

                    case "SS":
                        _retuen = Str[2];
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("PgTimeSetting.GetHrorMinorSec()", Ex.ToString());
            }
            return(_retuen);
        }
Esempio n. 4
0
 public void FillLocationCmb()
 {
     try
     {
         List <Locations> _lsLocation = new List <Locations>();
         Locations        _Loc        = new Locations();
         _Loc.LocationID   = 1;
         _Loc.LocationName = "NYWH";
         _lsLocation.Add(_Loc);
         Locations _Loc1 = new Locations();
         _Loc1.LocationID   = 2;
         _Loc1.LocationName = "NYWT";
         _lsLocation.Add(_Loc1);
         Locations _Loc2 = new Locations();
         _Loc2.LocationID   = 3;
         _Loc2.LocationName = "N/A";
         _lsLocation.Add(_Loc2);
         Locations _Loc3 = new Locations();
         _Loc3.LocationID   = 4;
         _Loc3.LocationName = "WH1";
         _lsLocation.Add(_Loc3);
         cmbLocation.ItemsSource = _lsLocation;
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("PgTimeSetting.FillLocationCmb()", Ex.ToString());
     }
 }
Esempio n. 5
0
 public void FillLanguageCombo()
 {
     try
     {
         List <Languages> _lsLanguages = new List <Languages>();
         Languages        _languages   = new Languages();
         _languages.LanguageID = 1;
         _languages.Language   = "English";
         _lsLanguages.Add(_languages);
         Languages _languages1 = new Languages();
         _languages1.LanguageID = 1;
         _languages1.Language   = "Chinese";
         _lsLanguages.Add(_languages1);
         Languages _languages2 = new Languages();
         _languages2.LanguageID = 1;
         _languages2.Language   = "Russian";
         _lsLanguages.Add(_languages2);
         cmbLanguage.ItemsSource = _lsLanguages;
         lblCLanguage.Text       = Global.controller.ReadFromLocalFile("Language");
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("PgTimeSetting.FillLanguageCombo()", Ex.ToString());
     }
 }
Esempio n. 6
0
        private void cvsMain_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                Guid       _UserID = UserInfoPage.UserID;
                model_User User    = new model_User(_UserID);
                List <cstUserMasterTbl> _lsUserMaseter = Global.controller.GetSelcetedUserMaster(_UserID);

                foreach (var _UserItem in _lsUserMaseter)
                {
                    UserID = _UserItem.UserID;
                    lblVUserName.Content     = _UserItem.UserName;
                    txtFullName.Text         = _UserItem.UserFullName;
                    txtAddress.Text          = _UserItem.UserAddress;
                    txtUserName.Text         = _UserItem.UserName;
                    dtpJoiningDate.Text      = _UserItem.JoiningDate.ToShortDateString();
                    lblCRole.Text            = _UserItem.RoleName;
                    cmbRole.Text             = _UserItem.RoleName;
                    lblVUserFullName.Content = _UserItem.UserFullName;
                    lblVJoinigDate.Content   = _UserItem.JoiningDate.ToShortDateString();
                    lblVAddress.Content      = _UserItem.UserAddress;
                }
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("PgUserinfoDisplay.cvsMain_Loaded()", Ex.ToString());
            }
        }
Esempio n. 7
0
 public bool Visit(AST_Root node)
 {
     CurrContext    = new Contexts();
     CurrErrorLoger = new ErrorLoger();
     All_Types      = SemanticType.BuildAllType(node.class_list);
     return(node.class_list.Visit(this));
 }
        /// <summary>
        /// Save shipping Information to shipping table
        /// </summary>
        /// <param name="ShippingNumber">String shipping Number</param>
        private Boolean _saveShippingInformation(String ShippingNumber)
        {
            Boolean _return = false;

            try
            {
                //Get Shipping Information from sage.

                List <cstShippingTbl> lsSageInfo = new List <cstShippingTbl>();

                if (Global.LTLLogin == "LTL")
                {
                    lsSageInfo = Global.controller.GetShippingInfoFromSage(ShippingNumber, Global.LTLLogin);
                }
                else if (Global.LTLLogin == "UPSandFeDex")
                {
                    lsSageInfo = Global.controller.GetShippingInfoFromSage(ShippingNumber, Global.LTLLogin);
                }



                if (lsSageInfo.Count > 0)
                {
                    //Save to local Database.
                    Global.controller.SetShippingTbl(lsSageInfo);
                    _return = true;
                }
            }
            catch (Exception Ex)
            {
                //Log the Error to the Error Log table
                ErrorLoger.save("wndShipmentScanPage - _saveShippingInformation", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
            }
            return(_return);
        }
Esempio n. 9
0
        private void _print()
        {
            try
            {
                PrintDialog printDlg = new System.Windows.Controls.PrintDialog();
                printDlg.PrintTicket.PageMediaSize = new PageMediaSize((Double)395.0, (Double)200.0);
                //printDlg.ShowDialog();

                //get selected printer capabilities
                System.Printing.PrintCapabilities capabilities = printDlg.PrintQueue.GetPrintCapabilities(printDlg.PrintTicket);

                //get scale of the print wrt to screen of WPF visual
                double scale = Math.Min(capabilities.PageImageableArea.ExtentWidth / this.Width, capabilities.PageImageableArea.ExtentHeight / this.Height);

                //Transform the Visual to scale
                this.LayoutTransform = new ScaleTransform(scale, scale);

                //get the size of the printer page
                Size sz = new Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight);

                //update the layout of the visual to the printer page size.
                this.Measure(sz);

                this.Arrange(new Rect(new Point(capabilities.PageImageableArea.OriginWidth, capabilities.PageImageableArea.OriginHeight), sz));

                //now print the visual to printer to fit on the one page.
                printDlg.PrintVisual(this, "BoxSlip_KrausUSA_A");
            }
            catch (Exception ex)
            {
                ErrorLoger.save("Print Canceled: " + EBoxNumber + " ", ex.ToString());
            }
        }
Esempio n. 10
0
        private void SetGlobalFileName(String LanguageString)
        {
            try
            {
                switch (LanguageString)
                {
                case "English":
                    Global.LanguageFileName = Environment.CurrentDirectory + "\\Language\\English_US.sys";
                    break;

                case "Chinese":
                    Global.LanguageFileName = Environment.CurrentDirectory + "\\Language\\Chinese.sys";
                    break;

                case "Russian":
                    Global.LanguageFileName = Environment.CurrentDirectory + "\\Language\\Russian.sys";
                    break;

                default:
                    break;
                }
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("PgTimeSetting.GetGlobalFile()", Ex.ToString());
            }
        }
Esempio n. 11
0
 /// <summary>
 /// Scroll Message show.
 /// </summary>
 /// <param name="Message">String message.</param>
 /// <param name="clr">Color of the message.</param>
 private void _scrollMsg(string Message, Color clr)
 {
     Dispatcher.Invoke(new Action(() =>
     {
         try
         {
             BErrorMsg.Visibility   = System.Windows.Visibility.Hidden;
             BErrorMsg.Visibility   = System.Windows.Visibility.Visible;
             lblErrorMsg.Foreground = new SolidColorBrush(clr);
             lblErrorMsg.Text       = "Login -[" + (DateTime.UtcNow.ToString("hh:mm:ss tt")) + "]▶ " + Message.ToString();
             txtblStack.Inlines.Add(new Run {
                 Text = lblErrorMsg.Text + Environment.NewLine, Foreground = new SolidColorBrush(clr)
             });
             Global.lsScroll.Add(new Run {
                 Text = lblErrorMsg.Text + Environment.NewLine, Foreground = new SolidColorBrush(clr)
             });
             svStack.ScrollToBottom();
         }
         catch (Exception Ex)
         {
             //Log the Error to the Error Log table
             ErrorLoger.save("wndLogin - _scrollMsg", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString());
         }
     }));
 }
Esempio n. 12
0
        /// <summary>
        /// 服务错误触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Server_Error(object sender, ErrorEventArgs e)
        {
            ErrorLoger loger = new ErrorLoger();

            loger.Write(e.Error);

            //写入错误日志
            ServicesProvider.Items.ErrorLogService.AddLog(e.Error, e.Tag);
        }
Esempio n. 13
0
        private void txtBoxNumberScanned_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (txtBoxNumberScanned.Text.Trim() != "" && txtBoxNumberScanned.Text.Trim() != null && e.Key == Key.Enter)
                {
                    //Global.counter = 0;
                    //List<cstPackageDetails> _packingDetails = Global.controller.GetPackingDetailTbl(txtBoxNumberScanned.Text);

                    //foreach (var item in _packingDetails)
                    //{
                    //    Global.BoxNumberScanned = txtBoxNumberScanned.Text;
                    //    wndWayfair wayFairlabel = new wndWayfair();
                    //    wayFairlabel.ShowDialog();
                    //    Global.counter = Global.counter + 1;
                    //}

                    //SavePrinted(txtBoxNumberScanned.Text);

                    btnAddNewPallet.Visibility = Visibility.Visible;

                    cstPalletDetails _palletDetail = new cstPalletDetails();
                    _palletDetail.PalletID       = Global.PalletID;
                    _palletDetail.BoxNumber      = txtBoxNumberScanned.Text;
                    _palletDetail.ShipmentNumber = Global.ShippingNumber;
                    List <cstPalletDetails> lsBox = new List <cstPalletDetails>();
                    lsBox.Add(_palletDetail);
                    Global.PalletDetailID = Global.controller.SetPalletDetails(lsBox);

                    string palletNumber = Global.controller.GetPalletInfoByPalletID(Global.PalletID).PalletNumber;


                    this.Dispatcher.Invoke(new Action(() =>
                    {
                        foreach (DataGridRow row in GetDataGridRows(grdContent))
                        {
                            TextBlock txtBoxNum = grdContent.Columns[0].GetCellContent(row) as TextBlock;
                            if (txtBoxNum.Text == txtBoxNumberScanned.Text)
                            {
                                TextBlock txtstatus = grdContent.Columns[1].GetCellContent(row) as TextBlock;
                                txtstatus.Text      = "Added in" + " - " + palletNumber;
                            }
                        }
                    }));
                    txtBoxNumberScanned.Text = "";
                    if (CanClose())
                    {
                        this.Close();
                    }
                }
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("wndBoxInfo - FillGrid", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
            }
        }
Esempio n. 14
0
        public void Setup()
        {
            target = new ErrorLoger();
            HttpContext mockContext = Mock.Create <HttpContext>();

            Mock.Arrange(() => mockContext.Error).Returns(new Exception(TestError));
            target.Context         = mockContext;
            MockLogger             = new MockILogger();
            target.LoggerInterface = MockLogger;
        }
Esempio n. 15
0
        /// <summary>
        /// KeyPress event of User Name textbox
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtUserName_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.Key == System.Windows.Input.Key.Enter)
                {
                    #region Login enter perssed
                    if (txtUserName.Text != "")
                    {
                        //Same User login for session again. when session expired.
                        if (Global.TimeOutUserName == txtUserName.Text && Global.ISTimerRaised == true)
                        {
                            //Logger add log.
                            SaveUserLogsTbl.logThis(csteActionType.SessionReLogin.ToString());

                            //Session start..
                            SessionManager.StartTime();

                            //Close this window
                            this.Close();
                        }
                        else if ((Global.TimeOutUserName == "" || Global.TimeOutUserName == null) && Global.ISTimerRaised == false)
                        {
                            //if session not expired then login is first time.
                            login_Prorgam();
                        }
                        else
                        {
                            //Worong username or password

                            txtUserName.Text = "";
                            txtMask.Text     = "";

                            //Logger add log.
                            SaveUserLogsTbl.logThis(csteActionType.Login_Invalid_User_00.ToString());

                            //Show msg strip.
                            _scrollMsg(Global.controller.ConvetLanguage("You are not previously logged User.", Global.LanguageFileName), Color.FromRgb(222, 87, 24));
                        }
                    }
                    else
                    {
                        e.Handled = false;
                    }
                    #endregion
                }
            }
            catch (Exception Ex)
            {
                //Log the Error to the Error Log table
                ErrorLoger.save("wndLogin - txtUserName_KeyDown", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString());
            }

            // if key pressed at the textbox is enter the this will go on. - avinash6jun2013
        }
 private void Button_Click_4(object sender, RoutedEventArgs e)
 {
     try
     {
         _saveClick();
     }
     catch (Exception Ex)
     {
         //Log the Error to the Error Log table
         ErrorLoger.save("wndShipmentScanPage - Button_Click_4", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
     }
 }
Esempio n. 17
0
 private void ShowUserListLeft()
 {
     try
     {
         var           _lsUserInfo     = Global.controller.GetUserInfoList();
         List <string> _lsUserFullName = new List <string>();
         grdUserList.ItemsSource = _lsUserInfo;
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("UserManagement.ShowUserListLeft()", Ex.Message.ToString());
     }
 }
Esempio n. 18
0
 /// <summary>
 /// Set Application Langage.
 /// </summary>
 private void _setLanguage()
 {
     try
     {
         String LanguageString = Global.controller.ReadFromLocalFile("Language");
         SetGlobalFileName(LanguageString);
     }
     catch (Exception Ex)
     {
         //Log the Error to the Error Log table
         ErrorLoger.save("wndLogin - _setLanguage", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString());
     }
 }
Esempio n. 19
0
        public bool Visit(AST_Root node)
        {
            All_Types      = SemanticType.BuildAllType(node.class_list);
            CurrErrorLoger = new ErrorLoger();
            hs             = new HashSet <string>();
            var graph = Utils.BuildGraph(All_Types);

            if (!ACycle(graph))
            {
                return(false);
            }
            return(node.class_list.Visit(this));
        }
Esempio n. 20
0
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     try
     {
         fillGrid(Global.ShippingNumber);
         txtBoxNumberScanned.Focus();
         txtWH.Text = CheckWH(Global.ShippingNumber).Trim();
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("wndBoxInfo - Page_load", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
     }
 }
Esempio n. 21
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Log
                SaveUserLogsTbl.logThis(csteActionType.Setting_LocalSettingUpdated.ToString(), Global.ShippingNumber);

                String Location   = "";
                String LogoutTime = lblHoures.Content + ":" + lblMin.Content + ":" + lblSec.Content;
                String Language   = "";
                if (cmbLocation.Text == "" || cmbLocation.Text == null)
                {
                    Location = lblCLocation.Text;
                }
                else
                {
                    Location = cmbLocation.Text;
                }
                if (cmbLanguage.Text == "" || cmbLanguage.Text == null)
                {
                    Language = lblCLanguage.Text;
                }
                else
                {
                    Language = cmbLanguage.Text;
                }

                SetGlobalFileName(Language);

                //Reset the Timer Intervals .
                int _Hour = Convert.ToInt32(lblHoures.Content.ToString());
                int _Min  = Convert.ToInt32(lblMin.Content.ToString());
                int _Sec  = Convert.ToInt32(lblSec.Content.ToString());

                MsgBox.Show("Error", "Update", Environment.NewLine + "To apply the settings application need to restart." + Environment.NewLine + " Are you sure want to restart application?");
                if (Global.MsgBoxResult == "Ok")
                {
                    //Change station location from device location changed
                    UpdateStationLocation(Location);
                    //seve to the text file overrites the existing contents.
                    Boolean _return = Global.controller.WriteStringTofile(Location, LogoutTime, Language, Global.ISBarcodeShow);
                    SessionManager.Autotimer.Interval = new TimeSpan(_Hour, _Min, _Sec);
                    System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
                    Application.Current.Shutdown();
                }
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("PgTimeSetting.UpdateBtn()", Ex.ToString());
            }
        }
Esempio n. 22
0
 public void SavePrinted(String BoxNumber)
 {
     try
     {
         cmdCartonInfo car        = new cmdCartonInfo();
         cstCartonInfo _cartonBox = Global.controller.GetAllCartonInfoByBoxNumber(BoxNumber).FirstOrDefault();
         _cartonBox.Printed = 1;
         car.UpdateCartonInfo(_cartonBox);
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("wndBoxInfo - SavePrinted", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
     }
 }
 private void btnReports_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         wndReports report = new wndReports();
         this.Close();
         report.ShowDialog();
     }
     catch (Exception Ex)
     {
         //Log the Error to the Error Log table
         ErrorLoger.save("wndShipmentScanPage - btnReports_Click", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
     }
 }
Esempio n. 24
0
 private void btnNewUser_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         //log
         SaveUserLogsTbl.logThis(csteActionType.UserManagement_NewUserClicked.ToString());
         NewUserRegistration _pgNewUser = new NewUserRegistration();
         frmMain.Content = _pgNewUser;
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("UserManagement.btnNewUser_Click()", Ex.Message.ToString());
     }
 }
        /// <summary>
        /// Shipment Lock is add value to the package information to the package table. with its override mode.
        /// </summary>
        /// <param name="OverrideMode">Mode of override if 1: Manager Override. 2: Self override. 0: No override.</param>
        /// <returns>Boolean tru or false.</returns>
        private Boolean _shipmentLock(int OverrideMode)
        {
            Boolean _return = false;

            this.Dispatcher.Invoke(new Action(() =>
            {
                try
                {
                    //save Shipping Infromtaion.
                    _return = _saveShippingInformation(txtShipmentId.Text);

                    List <cstPackageTbl> lsPacking  = new List <cstPackageTbl>();
                    cstPackageTbl _packingCustom    = new cstPackageTbl();
                    _packingCustom.ShippingNum      = txtShipmentId.Text;
                    _packingCustom.UserID           = Global.LoggedUserModel.UserInfo.UserID;
                    _packingCustom.StartTime        = DateTime.UtcNow;
                    _packingCustom.EndTime          = DateTime.UtcNow;
                    _packingCustom.StationID        = Global.controller.GetStationMasterByName(Global.StationName).StationID;
                    _packingCustom.ShippingID       = Global.controller.GetShippingTbl(txtShipmentId.Text).ShippingID;
                    _packingCustom.ShipmentLocation = Global.controller.ApplicationLocation();

                    //Status: 1 - Under Packing Process.
                    //Status: 0 - Packing Complete
                    _packingCustom.PackingStatus = 1;

                    //Status: 0 - Not Manger override packing
                    //Status: 1 - Manger Override packing
                    //Status: 2 - Same User Repacking
                    _packingCustom.MangerOverride = OverrideMode;

                    lsPacking.Add(_packingCustom);
                    if (OverrideMode == 2)
                    {
                        //No save No update just pass the old Packing Id to next operations.
                        Global.PackingID = Global.SameUserpackingID;
                    }
                    else
                    {
                        Global.PackingID = Global.controller.SetPackingTable(lsPacking);
                    }
                }
                catch (Exception Ex)
                {
                    //Log the Error to the Error Log table
                    ErrorLoger.save("wndShipmentScanPage - _shipmentLock", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
                }
            }));
            return(_return);
        }
        /// <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);
            }
        }
 //Load Previous Scroll messages in Sroll messgae stack of this page.
 private void _showListStrings()
 {
     try
     {
         foreach (Run r in Global.lsScroll)
         {
             txtblStack.Inlines.Add(r);
         }
     }
     catch (Exception Ex)
     {
         //Log the Error to the Error Log table
         ErrorLoger.save("wndShipmentScanPage - _showListStrings", " [" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
     }
 }
Esempio n. 28
0
 private void txtFullName_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         //string _input = (sender as TextBox).Text;
         //                if (_input.CharOnly())
         //{
         //    e.Handled = true;
         //}
     }
     catch (Exception Ex)
     {
         ErrorLoger.save("PgUserinfoDisplay.txtFullName_KeyDown()", Ex.ToString());
     }
 }
Esempio n. 29
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //ComboBoxItem _CmbStatio = (ComboBoxItem)ddlStation.SelectedItem;

                List <cstUserMasterTbl> _lsUserMaster = new List <cstUserMasterTbl>();
                cstUserMasterTbl        _userInfo     = new cstUserMasterTbl();
                _userInfo.UserName    = txtUserName.Text;
                _userInfo.UserAddress = txtAddress.Text;
                _userInfo.Password    = txtPass.Password.ToString();
                _userInfo.JoiningDate = Convert.ToDateTime(dtpJoiningDate.Text);
                if (cmbRole.Text == "" || cmbRole.Text == null)
                {
                    _userInfo.RoleName = lblCRole.Text;//if Role Combobox not selected.
                }
                else
                {
                    _userInfo.RoleName = cmbRole.Text;//if Role Combobox  selected.
                }
                _userInfo.UserFullName = txtFullName.Text;
                if (cmbRole.SelectedItem != null)
                {
                    cstRoleTbl Role = (cstRoleTbl)cmbRole.SelectedItem;
                    _userInfo.Role = Role.RoleId;
                }
                else
                {
                    _userInfo.Role = Guid.Empty;
                }

                _lsUserMaster.Add(_userInfo);
                Boolean _return = Global.controller.SetUserMaster(_lsUserMaster, UserID);
                if (_return == true)
                {
                    MsgBox.Show("Ok", "Update", Environment.NewLine + "Record updated successfully!");
                    ClearAllForms();
                }
                else
                {
                    MsgBox.Show("Warning", "Update", Environment.NewLine + "Record update fail.");
                }
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("PgUserinfoDisplay.btnUpdate_Click()", Ex.ToString());
            }
        }
Esempio n. 30
0
 public bool Visit(AST_Root node)
 {
     CurrErrorLoger = new ErrorLoger();
     Types          = new HashSet <string>();
     ReservedWords  = new HashSet <string>(new List <string>()
     {
         "class", "else", "fi", "if", "in", "inherits",
         "isvoid", "let", "loop", "pool", "then", "while",
         "case", "esac", "new", "of", "not",
         "Class", "Else", "Fi", "If", "In", "Inherits",
         "Isvoid", "Let", "Loop", "Pool", "Then", "While",
         "Case", "Esac", "New", "Of", "Not", "true", "false",
         "Int", "Bool", "Object", "String", "IO"
     });
     return(node.class_list.Visit(this));
 }