Beispiel #1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (sendDataMode == SendDataMode.Online)
            {
                RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Comm\FTPD", true);
                key.SetValue("AllowAnonymous", 0);
            }
            timerCheckAS.Enabled = false;
            timerCheckAS.Dispose();

            FileInfo f = new FileInfo(path + @"\Database\STOCKTAKING_HHT.sdf");

            if (firstLastSize != f.Length)
            {
                Loading2.OpenLoading();
                DatabaseModule.Instance.Init();
                Loading2.CloseLoading();
            }
            else
            {
                DatabaseModule.Instance.InitWithOutRefresh();
            }

            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
Beispiel #2
0
        public static void OpenLoading()
        {
            t = new Thread(delegate()
            {
                Loading2 loading2 = new Loading2();
                loading2.ShowDialog();
            });

            t.Start();
        }
Beispiel #3
0
        private void ScanProduct(string barcode)
        {
            tempSKUModel = new SKUModel();
            if (!isHaveSKUData)
            {
                tbBarcode.Text = barcode;

                tempSKUModel.Barcode        = barcode;
                tempSKUModel.BrandCode      = null;
                tempSKUModel.ExBarcode      = null;
                tempSKUModel.InBarcode      = null;
                tempSKUModel.Description    = null;
                tempSKUModel.SKUCode        = null;
                tempSKUModel.DepartmentCode = null;
                tempSKUModel.IsNew          = true;
            }
            else
            {
                Loading2.OpenLoading();
                SKUModel result = DatabaseModule.Instance.QueryProductFromScan(barcode);
                if (result != null)
                {
                    tbBarcode.Text = barcode;

                    tempSKUModel.Barcode        = barcode;
                    tempSKUModel.BrandCode      = result.BrandCode;
                    tempSKUModel.ExBarcode      = result.ExBarcode;
                    tempSKUModel.InBarcode      = result.InBarcode;
                    tempSKUModel.Description    = result.Description;
                    tempSKUModel.SKUCode        = result.SKUCode;
                    tempSKUModel.DepartmentCode = result.DepartmentCode;
                    tempSKUModel.IsNew          = false;
                }
                else
                {
                    tbBarcode.Text = barcode;

                    tempSKUModel.Barcode        = barcode;
                    tempSKUModel.BrandCode      = null;
                    tempSKUModel.ExBarcode      = null;
                    tempSKUModel.InBarcode      = null;
                    tempSKUModel.Description    = null;
                    tempSKUModel.SKUCode        = null;
                    tempSKUModel.DepartmentCode = null;
                    tempSKUModel.IsNew          = true;
                }
                Loading2.CloseLoading();
            }
        }
Beispiel #4
0
        private void SendDataFTP_Load(object sender, EventArgs e)
        {
            Loading2.OpenLoading();

            string distinctLocation = DatabaseModule.Instance.QuerySelectDistinctLocationCodeFromSendData(mode);

            if (distinctLocation.Length != 0)
            {
                allCheckBox = new CheckBox();

                allCheckBox.Location = new Point(5, 5);

                allCheckBox.Size = new Size(80, 20);
                allCheckBox.Text = "All";
                allCheckBox.CheckStateChanged += AllCheckBox_CheckStateChanged;
                panel1.Controls.Add(allCheckBox);

                string[] splitLocation = distinctLocation.Split(',');
                for (int i = 0; i < splitLocation.Length; i++)
                {
                    CheckBox tempCheckBox = new CheckBox();

                    if (i % 2 == 1)
                    {
                        tempCheckBox.Location = new Point(90, ((i / 2) * 25) + 30);
                    }
                    else
                    {
                        tempCheckBox.Location = new Point(5, ((i / 2) * 25) + 30);
                    }

                    tempCheckBox.Size = new Size(80, 20);
                    tempCheckBox.Text = splitLocation[i];
                    tempCheckBox.CheckStateChanged += ComponentCheckBox_CheckStateChanged;

                    panel1.Controls.Add(tempCheckBox);
                }
            }

            Loading2.CloseLoading();
        }
Beispiel #5
0
        private void ScanLocation(string barcode)
        {
            if (!isHaveLocationData)
            {
                ClearScreen();

                currentBrand    = null;
                currentLocation = barcode;

                tbLocation.Text = barcode;

                tempLocationModel.BrandCode    = null;
                tempLocationModel.ScanMode     = 1;
                tempLocationModel.LocationCode = barcode;

                Program.LastScannedLocationFront = barcode;
            }
            else
            {
                Loading2.OpenLoading();

                LocationModel result = DatabaseModule.Instance.QueryLocationFromScan(barcode, 1);
                if (result != null)
                {
                    ClearScreen();

                    if (result.SectionCode.Equals(result.BrandCode))
                    {
                        currentBrand    = result.BrandCode;
                        currentLocation = result.LocationCode;

                        tbLocation.Text = result.LocationCode;

                        tempLocationModel.BrandCode    = result.BrandCode;
                        tempLocationModel.ScanMode     = result.ScanMode;
                        tempLocationModel.LocationCode = result.LocationCode;
                    }
                    else
                    {
                        currentBrand    = null;
                        currentLocation = result.LocationCode;

                        tbLocation.Text = result.LocationCode;

                        tempLocationModel.BrandCode    = null;
                        tempLocationModel.ScanMode     = result.ScanMode;
                        tempLocationModel.LocationCode = result.LocationCode;
                    }

                    Program.LastScannedLocationFront = barcode;
                }
                else
                {
                    result = DatabaseModule.Instance.QueryLocationFromScan(barcode, 4);
                    if (result != null)
                    {
                        Loading2.CloseLoading();
                        MessageBox.Show("Location code not found", "Warning", MessageBoxButtons.OK,
                                        MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    }
                    else
                    {
                        Loading2.CloseLoading();
                        MessageBox.Show("Your HHT can not audit this location code", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    }
                }
            }
        }