예제 #1
0
        public EUSearch_SRZ()
        {
            InitializeComponent();

            try
            {
                _TblMarka = SqlLiteQuery.GetMarkaUnic();
            }

            catch (Exception exe)
            {
                CLog.WriteException("EUSearch_SRZ.cs", "EUSearch_SRZ", exe.Message);
            }

            try
            {
                _TblStandart = SqlLiteQuery.GetStandartUnic();
            }

            catch (Exception exe)
            {
                CLog.WriteException("EUSearch_SRZ.cs", "EUSearch_SRZ", exe.Message);
            }

            InitUi();
        }
예제 #2
0
        public void ReInitMX(string MX)
        {
            listEU                 = new List <WebReference.Relmuch>();
            _tblEU                 = InitTable();
            this.labelPlace        = MX;
            CMxPlace               = new DataBarCode.WebReference.MXPlace();
            CMxPlace.LABEL         = MX;
            CMxPlace.CODEAUTOMATIC = 5;

            labelCountScan.BeginInvoke(new Action(() =>
            {
                labelCountScan.Text = "0";
            }));

            dataGridEu.BeginInvoke(new Action(() =>
            {
                dataGridEu.DataSource = _tblEU;
            }));

            labelMX.BeginInvoke(new Action(() =>
            {
                labelMX.Text = MX;
            }));

            labelMXMore.BeginInvoke(new Action(() =>
            {
                labelMXMore.Text = SqlLiteQuery.GetNameMX(MX);
            }));
        }
예제 #3
0
        public QueueTaskEU(Intermec.DataCollection.BarcodeReader _bcr, string _RZDN)
        {
            InitializeComponent();

            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            //  ScanOperation = _ScanOperation;
            listEU = new List <string>();

            bcr = _bcr;

            this.RZDN = _RZDN;
            InitTable();
            InitScaner();


            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));

            this.KeyPreview = true;
            //  labelMX.Text += " " + this.RZDN;

            ScanWeigth      = SqlLiteQuery.GetWEIGHTByRZDN(_RZDN);
            details         = SqlLiteQuery.GetDetalisbyRZDN(_RZDN);
            MarkaRZDN       = SqlLiteQuery.GetMarkabyRZDN(_RZDN);
            labelDetal.Text = details;
            MarkaRZDNList   = SqlLiteQuery.GetMarkabyRZDNList(_RZDN);
        }
예제 #4
0
        private void GetDataEUSqlLite(string EU)
        {
            //Загружаем по новому

            try
            {
                using (SQLiteConnection connection = new SQLiteConnection())
                {
                    ;//(SQLiteConnection)factory.CreateConnection();
                    connection.ConnectionString = "Data Source = " + SqLiteDB.pathDBFull_EU;
                    SQLiteCommand command = new SQLiteCommand(connection);
                    SQLiteCommand insert  = new SQLiteCommand("select * from EU e WHERE e.RELMUCH_LABEL = '" + EU + "';", connection);
                    connection.Open();
                    SQLiteDataReader reader = insert.ExecuteReader();
                    while (reader.Read())
                    {
                        lblID.Text              = "ID: " + _getReaderByName(reader, "RELMUCH_PRM");
                        labelMark.Text          = "Марка: " + _getReaderByName(reader, "MARKA_NAME");
                        labelPart.Text          = "Партия: " + _getReaderByName(reader, "RPRT_NOM");
                        labelplav.Text          = "Плавка: " + _getReaderByName(reader, "RPRT_PLVNOM");
                        labelUnitWegth.Text     = "Вес факт: " + _getReaderByName(reader, "RELMUCH_FVES");
                        labelUnitWegthASUP.Text = "Вес АСУП: " + _getReaderByName(reader, "RELMUCH_VES");

                        string Tehuzx_kod = _getReaderByName(reader, "TEHUZ_KOD");

                        if (_getReaderByName(reader, "SIGN") == "1")
                        {
                            //EU.SIGN='1' - Факт
                            //EU.SIGN='2' - План
                            labelFactMX.Text = "Факт МХ: " + SqlLiteQuery.GetNameMXByKod(Tehuzx_kod);
                            labelPlanMX.Text = "План МХ: -";
                        }
                        else
                        {
                            labelFactMX.Text = "Факт МХ: -";
                            labelPlanMX.Text = "План МХ: " + SqlLiteQuery.GetNameMXByKod(Tehuzx_kod);;
                        }
                    }
                    reader.Close();
                    connection.Close();

                    command.Dispose();
                    insert.Dispose();
                    reader.Dispose();
                }
            }

            catch (Exception ex)
            {
                CLog.WriteException("EU_Action.cs", "GetDataEUSqlLite", ex.Message);
            }
        }
예제 #5
0
        public QueueTaskEU(Intermec.DataCollection.BarcodeReader _bcr, string _RZDN)
        {
            InitializeComponent();

            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            //  ScanOperation = _ScanOperation;
            listEU = new List <WebReference.Relmuch>();

            bcr = _bcr;

            this.RZDN = _RZDN;
            InitTable();
            InitScaner();


            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));

            this.KeyPreview = true;
            //  labelMX.Text += " " + this.RZDN;

            ScanWeigth   = SqlLiteQuery.GetWEIGHTByRZDN(_RZDN);
            labelMX.Text = "Осталось: " + Math.Round(ScanWeigth, 2).ToString() + " т.";

            if (ScanWeigth <= 0)
            {
                labelMX.ForeColor = Color.White;
            }
            else
            {
                labelMX.ForeColor = Color.Tomato;
            }


            details         = SqlLiteQuery.GetDetalisbyRZDN(_RZDN);
            MarkaRZDN       = SqlLiteQuery.GetMarkabyRZDN(_RZDN);
            labelDetal.Text = details;
            MarkaRZDNList   = SqlLiteQuery.GetMarkabyRZDNList(_RZDN);

            labelCountScan.BeginInvoke(new Action(() =>
            {
                labelCountScan.Text = "0";
            }));
        }
예제 #6
0
        private void comboBoxAgr_SelectedValueChanged(object sender, EventArgs e)
        {
            if ((comboBoxAgr.SelectedIndex != -1) && (comboBoxAgr.Items.Count > 0))
            {
                labelStatus.BeginInvoke(new Action(() =>
                {
                    labelStatus.Text = "";
                }));

                //comboBoxWareHouse.BeginUpdate();
                string SelectedAgr = "";
                SelectedAgr = comboBoxAgr.SelectedValue.ToString();
                try
                {
                    comboBoxWareHouse.Enabled = true;


                    if (SelectedAgr != null)
                    {
                        _TblSelectWareHouse = SqlLiteQuery.GetPlace(SelectedAgr, true);

                        comboBoxWareHouse.DataSource    = _TblSelectWareHouse;
                        comboBoxWareHouse.DisplayMember = "TEHUZ_NAZ";

                        comboBoxWareHouse.ValueMember = "TEHUZ_LABEL";
                    }
                }



                catch (Exception ex)
                {
                    labelStatus.BeginInvoke(new Action(() =>
                    {
                        labelStatus.Text = ex.Message + SelectedAgr;
                    }));
                    CLog.WriteException("WarehouseSel.cs", "comboBoxAgr_SelectedIndexChanged", ex.Message);
                }
                finally
                {
                    comboBoxWareHouse.EndUpdate();
                }
            }
            else
            {
                try
                {
                }
                catch (Exception) { }
            }
        }
예제 #7
0
        public DataScalesFixAndPost()
        {
            InitializeComponent();

            try
            {
                _TblAgr = SqlLiteQuery.GetWareHouse();
            }

            catch (Exception exe)
            {
                CLog.WriteException("WarehouseSel.cs", "WarehouseSel", exe.Message);
            }
            InitUi();
        }
예제 #8
0
        // public delegate void GetDataDelegate();

        public DataScales(Intermec.DataCollection.BarcodeReader _bcr)
        {
            InitializeComponent();
            CLog.WriteInfo("DataScales.cs", "Start Ui");
            set = new Settings("DataBrCode.xml");

            bcr = _bcr;

            InitScaner();

            _TblScales = SqlLiteQuery.GetScales();

            if (_TblScales != null)
            {
                comboBoxScales.DataSource    = _TblScales;
                comboBoxScales.DisplayMember = "VESY_NAME";
                comboBoxScales.ValueMember   = "VESY_NOM";
                // comboBoxAgr.SelectedIndex = -1;
                if (comboBoxScales.Items.Count > 0)
                {
                    comboBoxScales.SelectedIndex = -1;
                    // buttonFix.Enabled = true;
                    comboBoxScales.DropDownStyle = ComboBoxStyle.DropDownList;
                }
                else
                {
                    buttonFix.Enabled = false;
                }
            }


            LabelEU = null;

            GetDataScales       = true;
            GetDataScalesThread = new Thread(ThreadGetDataScales);
            GetDataScalesThread.Start();

            buttonFix.Enabled = false;

            //Тут правим лейбл
            string StatusBD = StatusBar.getSatus();

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;
        }
예제 #9
0
        public EUSearch_Rulon()
        {
            InitializeComponent();

            try
            {
                _TblMarka = SqlLiteQuery.GetMarkaUnic();
            }

            catch (Exception exe)
            {
                CLog.WriteException("EUSearch_Rulon.cs", "EUSearch_Rulon", exe.Message);
            }

            InitUi();
        }
예제 #10
0
        private void initRZDNForPGA()
        {
            using (SQLiteConnection connection = new SQLiteConnection())
            {
                string SQL = "SELECT EU.TEHUZ_KOD, EU.RPRT_NOM FROM EU,  TaskList, RZDN_MARKA WHERE EU.MARKA_NAME = RZDN_MARKA.MARKA AND EU.RELMUCH_THICKNESS = TaskList.TASK_THICKNESS AND EU.RELMUCH_WIDTH= TaskList.TASK_WIDTH AND TaskList.RZDN_PRM = '" + RZDN + "' AND RZDN_MARKA.RZDN_PRM = TaskList.RZDN_PRM AND EU.SIGN <> '2'";
                // SQL += "AND TaskList.RZDN_PRM = '" + RZDN + "'";

                /*
                 * SELECT EU.TEHUZ_KOD, EU.RPRT_NOM FROM EU,  TaskList, RZDN_MARKA WHERE
                 * EU.MARKA_NAME = RZDN_MARKA.MARKA
                 * AND EU.RELMUCH_THICKNESS = TaskList.TASK_THICKNESS
                 * AND EU.RELMUCH_WIDTH= TaskList.TASK_WIDTH
                 * AND TaskList.RZDN_PRM = "234557"
                 * AND RZDN_MARKA.RZDN_PRM = TaskList.RZDN_PRM
                 * AND EU.SIGN <> "2"
                 * */

                ;//(SQLiteConnection)factory.CreateConnection();
                connection.ConnectionString = "Data Source = " + SqLiteDB.pathDBFull_EU;
                SQLiteCommand command = new SQLiteCommand(connection);
                SQLiteCommand insert  = new SQLiteCommand(SQL, connection);
                connection.Open();
                SQLiteDataReader reader = insert.ExecuteReader();
                while (reader.Read())
                {
                    DataRow row1 = _tblEU.NewRow();
                    //Запроск К БД
                    string TEHUZ = SqlLiteQuery.getReaderByName(reader, "TEHUZ_KOD");
                    row1["УЕ"]    = SqlLiteQuery.getReaderByName(reader, "RPRT_NOM");
                    row1["MX"]    = SqlLiteQuery.GetNameMXByKod(TEHUZ, false);
                    row1["Склад"] = SqlLiteQuery.GetNameAgrByMX(TEHUZ);
                    _tblEU.Rows.Add(row1);
                }
                reader.Close();
                connection.Close();

                command.Dispose();
                insert.Dispose();
                reader.Dispose();
            }

            dataGridEu.BeginInvoke(new Action(() =>
            {
                dataGridEu.DataSource = _tblEU;
            }));
        }
예제 #11
0
        public WarehouseSel(Intermec.DataCollection.BarcodeReader _bcr, string _LoginUser, string _Date, string _Sm, ListScanOperation _ScanOperation)
        {
            InitializeComponent();
            bcr = _bcr;

            ScanOperation = _ScanOperation;

            this.LoginUser = _LoginUser;
            this.Text      = _LoginUser + " Смена:" + _Sm;

            try
            {
                _TblAgr = SqlLiteQuery.GetWareHouse();
            }

            catch (Exception exe)
            {
                CLog.WriteException("WarehouseSel.cs", "WarehouseSel", exe.Message);
            }
            InitUi();
            InitScaner();



            labelStatus.Text = "";

            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));

            this.KeyPreview = true;
        }
예제 #12
0
        public WareHouseView(string _LabelMX)
        {
            InitializeComponent();
            this.LabelMX     = _LabelMX;
            labelMX.Text     = _LabelMX;
            labelMXMore.Text = SqlLiteQuery.GetNameMX(_LabelMX);

            InitGrid();

            //Выводим инфушку
            try
            {
                string StatusBD = StatusBar.getSatus();

                labelBD.BeginInvoke(new Action(() =>
                {
                    labelBD.Text      = StatusBD;
                    labelBD.ForeColor = StatusBar.GetColorLabel();
                }));
            }

            catch (Exception) { }
            this.KeyPreview = true;
        }
예제 #13
0
        private void SetShip()
        {
            WebReference.WebSDataBrCode BrServer = new WebReference.WebSDataBrCode();
            BrServer.SoapVersion   = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
            BrServer.Url           = set.AdressAppServer;
            BrServer.BrHeaderValue = CBrHeader.GetHeader();
            BrServer.Credentials   = new NetworkCredential(CBrHeader.Login, CBrHeader.Password);
            //Найдем задание
            string RZDN = SqlLiteQuery.GetRZDNForLabel(TN);

            //Необходимо перенести список на этап сканирования
            ////Спискок ЕУ запилим

            //listEU = new List<WebReference.Relmuch>();

            //for (int i = 0; i < _tblEU.Rows.Count; i++)
            //{
            //    if (_tblEU.Rows[i]["Select"].ToString() == "1")
            //    {
            //        //Вот тут то и дичка
            //        listEU.Add(_tblEU.Rows[i]["Label"].ToString());
            //    }

            //}


            if (BufferToBD.ModeNetTerminalB)
            {//Если мы в Онлайне
                try
                {
                    DataTable result = BrServer.POST_EU_LIST_SHIP_TYPE(listEU.ToArray(), RZDN, null);

                    dataGridEu.BackColor = Color.LightGray;
                    OpenNETCF.Media.SystemSounds.Beep.Play();

                    ////Далее нужен алгоритм обработки ответа

                    //foreach (DataRow dr in dataGridEu.Rows)
                    //{

                    //}
                    SetColorBackGround(StatusScan.Ok);
                }

                catch (System.Net.WebException ex)
                {
                    dataGridEu.BackColor = Color.LemonChiffon;

                    BufferToBD.ModeNetTerminalB = false;
                    CLog.WriteException("EUSHip.cs", "SetShip", ex.ToString());
                    //Отправляем в буфер
                    BufferOper_POST_EU_LIST_SHIP Oper = new BufferOper_POST_EU_LIST_SHIP(RZDN, listEU.ToArray());
                    BufferToBD.BufferAdd(new BufferOperation(TypeClassBuffer.POST_EU_LIST_SHIP, Oper));
                    OpenNETCF.Media.SystemSounds.Beep.Play();
                    Thread.Sleep(100);
                    OpenNETCF.Media.SystemSounds.Beep.Play();

                    SetColorBackGround(StatusScan.Buffer);
                }

                catch (System.Net.Sockets.SocketException ex)
                {//На случай если во время выполнения сломается связть
                    dataGridEu.BackColor = Color.LemonChiffon;

                    BufferToBD.ModeNetTerminalB = false;
                    CLog.WriteException("EUSHip.cs", "SetShip", ex.ToString());
                    //Отправляем в буфер
                    BufferOper_POST_EU_LIST_SHIP Oper = new BufferOper_POST_EU_LIST_SHIP(RZDN, listEU.ToArray());
                    BufferToBD.BufferAdd(new BufferOperation(TypeClassBuffer.POST_EU_LIST_SHIP, Oper));
                    OpenNETCF.Media.SystemSounds.Beep.Play();
                    Thread.Sleep(100);
                    OpenNETCF.Media.SystemSounds.Beep.Play();

                    SetColorBackGround(StatusScan.Buffer);
                }
            }
            else
            {//Если мы в Офлайне
                BufferOper_POST_EU_LIST_SHIP Oper = new BufferOper_POST_EU_LIST_SHIP(RZDN, listEU.ToArray());
                BufferToBD.BufferAdd(new BufferOperation(TypeClassBuffer.POST_EU_LIST_SHIP, Oper));

                dataGridEu.BackColor = Color.LemonChiffon;
                OpenNETCF.Media.SystemSounds.Beep.Play();
                Thread.Sleep(100);
                OpenNETCF.Media.SystemSounds.Beep.Play();

                SetColorBackGround(StatusScan.Buffer);
            }
            //Анализируем результат, и подсветку делаем строк
        }
예제 #14
0
        void bcr_BarcodeReadWarehousePost(object sender, BarcodeReadEventArgs bre)
        {
            try
            {
                string EU = bre.strDataBuffer;
                LabelEU = EU;
                ///Тут Алгоритм разбора что мы все-таки считали
                ///Для начала считаем по-умолчанию что считываем мы только ЕУ и пишем алгоритм
                ///Открытия формы

                if (EU.IndexOf("MX") == 0)
                {//
                    //Проверим все ли ЕУ заквитированы
                    if (_tblEU == null)
                    {
                        ReInitMX(EU);
                    }
                    else if (_tblEU.Rows.Count == 0)
                    {
                        ReInitMX(EU);
                    }
                    else
                    {//Проверим на квитацию.
                        int counterEU = 0;
                        for (int i = 0; i < _tblEU.Rows.Count; i++)
                        {
                            if ((_tblEU.Rows[i]["Commit"].ToString() == "0") || (_tblEU.Rows[i]["Commit"].ToString() == "-1"))
                            {
                                counterEU++;
                            }
                        }
                        if (counterEU == 0)
                        {
                            ReInitMX(EU);
                        }
                        else
                        {
                            Sound.PlaySoundExclamationVolumeVeryHIGH();
                            Thread.Sleep(100);
                            Sound.PlaySoundExclamationVolumeVeryHIGH();
                            return;
                        }
                    }
                    return;
                }

                //Проверим есть ли данная ЕУ в списке
                if (ValidateList.CheckEUByListType(listEU, LabelEU))
                {
                    //ЕУ уже в списке
                    Sound.PlaySoundWarning();
                    //Vibration.PlayVibration(2000);
                    return;
                }


                //Удалим все УЕ которые закоммитилист.
                switch (ScanOperation)
                {
                case ListScanOperation.EuInAgr:
                {
                    CleanCommitEU(5);
                    break;
                }

                case ListScanOperation.EuInAgrTESA:
                {
                    CleanCommitEU(3);
                    if (CheckEuInAgrTESA())
                    {
                        Sound.PlaySoundExclamationVolumeVeryHIGH();
                        Thread.Sleep(100);
                        Sound.PlaySoundExclamationVolumeVeryHIGH();
                        return;
                    }

                    break;
                }

                default:
                    break;
                }

                //Очистка звершена.

                dataGridEu.BeginInvoke(new Action(() =>
                {
                    dataGridEu.BackColor = Color.White;
                }));

                //Тут делаем таблицу и выводим инфу
                DataRow row1 = _tblEU.NewRow();
                row1["Label"] = EU;


                //WebReference.WebSDataBrCode BrServer = new WebReference.WebSDataBrCode();
                //BrServer.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
                //BrServer.Url = set.AdressAppServer;
                //DataTable result = BrServer.EU_GetData(EU);


                using (SQLiteConnection connection = new SQLiteConnection())
                {
                    ;//(SQLiteConnection)factory.CreateConnection();
                    connection.ConnectionString = "Data Source = " + SqLiteDB.pathDBFull_EU;
                    SQLiteCommand command = new SQLiteCommand(connection);
                    SQLiteCommand insert  = new SQLiteCommand("select * from EU e WHERE e.RELMUCH_LABEL = '" + EU + "';", connection);
                    connection.Open();
                    SQLiteDataReader reader = insert.ExecuteReader();
                    while (reader.Read())
                    {
                        //Запроск К БД
                        row1["УЕ"]     = _getReaderByName(reader, "RPRT_NOM");
                        row1["Марка"]  = _getReaderByName(reader, "MARKA_NAME");
                        row1["Размер"] = _getReaderByName(reader, "RELMUCH_THICKNESS") + "х" + _getReaderByName(reader, "RELMUCH_WIDTH");
                        row1["Вес"]    = SqlLiteQuery.getReaderByName(reader, "RELMUCH_VES");
                    }
                    reader.Close();
                    connection.Close();

                    command.Dispose();
                    insert.Dispose();
                    reader.Dispose();
                }
                _tblEU.Rows.InsertAt(row1, 0);

                WebReference.Relmuch EUT = new WebReference.Relmuch();
                EUT.LABEL         = EU;
                EUT.CODEAUTOMATIC = 5;
                listEU.Add(EUT);

                labelCountScan.BeginInvoke(new Action(() =>
                {
                    labelCountScan.Text = listEU.Count.ToString();
                }));

                dataGridEu.BeginInvoke(new Action(() =>
                {
                    dataGridEu.DataSource = _tblEU;
                }));
            }
            catch (Exception exp)
            {
                CLog.WriteException("WarehousePost.cs", "bcr_BarcodeReadWarehousePost", exp.Message);
                //MessageBox.Show(exp.Message);
            }
        }
예제 #15
0
        public void InitForms(Intermec.DataCollection.BarcodeReader _bcr, string LabelPlace, ListScanOperation _ScanOperation)
        {
            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            ScanOperation = _ScanOperation;
            listEU        = new List <string>();

            bcr = _bcr;

            this.labelPlace = LabelPlace;
            InitTable();
            InitScaner();

            labelMX.Text = LabelPlace;

            //Выгрузим подробную инфу по месту хранения
            //labelMXMore.Text = getValueDataTableColumnRow(_TblWarehouse, "TEHUZ_LABEL", LabelPlace, "TEHUZ_NAME");
            if (LabelPlace == "MX0000")
            {
                labelMXMore.Text = "ТЭСА";
            }
            else
            {
                labelMXMore.Text = SqlLiteQuery.GetNameMX(LabelPlace);
            }



            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;



            switch (ScanOperation)
            {
            case ListScanOperation.MXSet:
            {
                this.Text = "Размещение ЕУ";
                break;
            }


            case ListScanOperation.EUTaskMove:
            {
                this.Text = "Перемещение ЕУ";
                break;
            }

            case ListScanOperation.EuInAgr:
            {
                this.Text = "ЕУ в агрегат";
                break;
            }

            case ListScanOperation.InventoryTask:
            {
                this.Text = "Инвентаризация МХ: " + labelMXMore.Text;
                break;
            }
            }
            labelCountScan.Text = "0";
        }
예제 #16
0
        //public void TestAdd(string EU)
        //{


        //    try
        //    {
        //        LabelEU = EU;
        //        ///Тут Алгоритм разбора что мы все-таки считали
        //        ///Для начала считаем по-умолчанию что считываем мы только ЕУ и пишем алгоритм
        //        ///Открытия формы

        //        if (EU.IndexOf("MX") == 0)
        //        {//
        //            //labelStatus.BeginInvoke(new Action(() =>
        //            //{
        //            //    labelStatus.Text = "Считано место хранения: " + EU;
        //            //}));
        //            return;
        //        }

        //        //labelStatus.BeginInvoke(new Action(() =>
        //        //{
        //        //    labelStatus.Text = "Label: " + EU;
        //        //}));

        //        //MessageBox.Show(EU);

        //        // GetDataEU(EU);


        //        dataGridEu.BeginInvoke(new Action(() =>
        //        {
        //            dataGridEu.BackColor = Color.White;
        //        }));

        //        //Тут делаем таблицу и выводим инфу
        //        DataRow row1 = _tblEU.NewRow();
        //        row1["Label"] = EU;


        //        //WebReference.WebSDataBrCode BrServer = new WebReference.WebSDataBrCode();
        //        //BrServer.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
        //        //BrServer.Url = set.AdressAppServer;
        //        //DataTable result = BrServer.EU_GetData(EU);


        //        using (SQLiteConnection connection = new SQLiteConnection())
        //        {

        //            ;//(SQLiteConnection)factory.CreateConnection();
        //            connection.ConnectionString = "Data Source = " + SqLiteDB.pathDBFull_EU;
        //            SQLiteCommand command = new SQLiteCommand(connection);
        //            SQLiteCommand insert = new SQLiteCommand("select e.RPRT_NOM, e.MARKA_NAME, e.RELMUCH_THICKNESS, e.RELMUCH_WIDTH from EU e WHERE e.RELMUCH_LABEL = '" + EU + "';", connection);
        //            connection.Open();
        //            SQLiteDataReader reader = insert.ExecuteReader();
        //            while (reader.Read())
        //            {
        //                //Запроск К БД
        //                row1["УЕ"] = _getReaderByName(reader, "RPRT_NOM");
        //                row1["Марка"] = _getReaderByName(reader, "MARKA_NAME");
        //                row1["Размер"] = _getReaderByName(reader, "RELMUCH_THICKNESS") + "х" + _getReaderByName(reader, "RELMUCH_WIDTH");
        //                // row1["S"] = "";
        //                /*
        //                 * CREATE TABLE [EU] (
        //                            [RELMUCH_LABEL] char(20) NOT NULL,
        //                            [RELMUCH_PRM] char(20),
        //                            [RELMUCH_VES] char(20),
        //                            [RELMUCH_FVES] char(20),
        //                            [RELMUCH_WIDTH] char(20),
        //                            [RELMUCH_THICKNESS] char(20),
        //                            [RPRT_NOM] char(20),
        //                            [RPRTTYP_NAME] char(20),
        //                            [RPRT_TOL] char(20),
        //                            [RPRT_SHRN] char(20),
        //                            [RPRT_PLVNOM] char(20),
        //                            [MARKA_NAME] char(20),
        //                            [MARKA_GOST] char(20),
        //                            [FACT_STORAGE_CODE] char(20),
        //                            [TEHUZ_LABEL] char(20),
        //                            [FACT_PLACE_NAME] char(20),
        //                            [INTRV_TMBEG] char(20))
        //                 * */
        //            }
        //            reader.Close();
        //            connection.Close();
        //            command.Dispose();
        //            insert.Dispose();
        //            reader.Dispose();
        //        }



        //        _tblEU.Rows.Add(row1);

        //        listEU.Add(EU);

        //        labelCountScan.Text = listEU.Count.ToString();

        //        dataGridEu.BeginInvoke(new Action(() =>
        //        {
        //            dataGridEu.DataSource = _tblEU;
        //        }));


        //    }
        //    catch (Exception exp)
        //    {
        //        CLog.WriteException("WarehousePost.cs", "TestAdd", exp.Message);
        //        MessageBox.Show(exp.Message);
        //    }
        //}

        void bcr_BarcodeReadWarehousePost(object sender, BarcodeReadEventArgs bre)
        {
            try
            {
                string EU = bre.strDataBuffer;
                LabelEU = EU;
                ///Тут Алгоритм разбора что мы все-таки считали
                ///Для начала считаем по-умолчанию что считываем мы только ЕУ и пишем алгоритм
                ///Открытия формы

                if (EU.IndexOf("MX") == 0)
                {//
                    //labelStatus.BeginInvoke(new Action(() =>
                    //{
                    //    labelStatus.Text = "Считано место хранения: " + EU;
                    //}));
                    return;
                }

                //Проверим есть ли данная ЕУ в списке
                if (ValidateList.CheckEUByList(listEU, LabelEU))
                {
                    //ЕУ уже в списке
                    Sound.PlaySoundWarning();
                    //Vibration.PlayVibration(2000);
                    return;
                }



                dataGridEu.BeginInvoke(new Action(() =>
                {
                    dataGridEu.BackColor = Color.White;
                }));

                //Тут делаем таблицу и выводим инфу
                DataRow row1 = _tblEU.NewRow();
                row1["Label"] = EU;


                //WebReference.WebSDataBrCode BrServer = new WebReference.WebSDataBrCode();
                //BrServer.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
                //BrServer.Url = set.AdressAppServer;
                //DataTable result = BrServer.EU_GetData(EU);


                using (SQLiteConnection connection = new SQLiteConnection())
                {
                    ;//(SQLiteConnection)factory.CreateConnection();
                    connection.ConnectionString = "Data Source = " + SqLiteDB.pathDBFull_EU;
                    SQLiteCommand command = new SQLiteCommand(connection);
                    SQLiteCommand insert  = new SQLiteCommand("select * from EU e WHERE e.RELMUCH_LABEL = '" + EU + "';", connection);
                    connection.Open();
                    SQLiteDataReader reader = insert.ExecuteReader();
                    while (reader.Read())
                    {
                        //Запроск К БД
                        row1["УЕ"]     = _getReaderByName(reader, "RPRT_NOM");
                        row1["Марка"]  = _getReaderByName(reader, "MARKA_NAME");
                        row1["Размер"] = _getReaderByName(reader, "RELMUCH_THICKNESS") + "х" + _getReaderByName(reader, "RELMUCH_WIDTH");
                        row1["Вес"]    = SqlLiteQuery.getReaderByName(reader, "RELMUCH_VES");
                        // row1["S"] = "";

                        /*
                         * CREATE TABLE [EU] (
                         *          [RELMUCH_LABEL] char(20) NOT NULL,
                         *          [RELMUCH_PRM] char(20),
                         *          [RELMUCH_VES] char(20),
                         *          [RELMUCH_FVES] char(20),
                         *          [RELMUCH_WIDTH] char(20),
                         *          [RELMUCH_THICKNESS] char(20),
                         *          [RPRT_NOM] char(20),
                         *          [RPRTTYP_NAME] char(20),
                         *          [RPRT_TOL] char(20),
                         *          [RPRT_SHRN] char(20),
                         *          [RPRT_PLVNOM] char(20),
                         *          [MARKA_NAME] char(20),
                         *          [MARKA_GOST] char(20),
                         *          [FACT_STORAGE_CODE] char(20),
                         *          [TEHUZ_LABEL] char(20),
                         *          [FACT_PLACE_NAME] char(20),
                         *          [INTRV_TMBEG] char(20))
                         * */
                    }
                    reader.Close();
                    connection.Close();

                    command.Dispose();
                    insert.Dispose();
                    reader.Dispose();
                }
                _tblEU.Rows.InsertAt(row1, 0);

                listEU.Add(EU);
                labelCountScan.BeginInvoke(new Action(() =>
                {
                    labelCountScan.Text = listEU.Count.ToString();
                }));

                dataGridEu.BeginInvoke(new Action(() =>
                {
                    dataGridEu.DataSource = _tblEU;
                }));
            }
            catch (Exception exp)
            {
                CLog.WriteException("WarehousePost.cs", "bcr_BarcodeReadWarehousePost", exp.Message);
                //MessageBox.Show(exp.Message);
            }
        }
예제 #17
0
        private void Search()
        {
            string searchText = textBoxScan.Text;

            //Для поиска
            if (searchText.Length < 3)
            {
                MessageBox.Show("Введите более 3-х символов");
                return;
            }

            _tblEU.Clear();
            //Тут запилим поиск
            //select EU.RELMUCH_LABEL, EU.RPRT_NOM,  EU.MARKA_NAME, EU.RELMUCH_THICKNESS, EU.RELMUCH_WIDTH  FROM EU WHERE EU.RPRT_NOM  LIKE '%325%'LIMIT 100

            using (SQLiteConnection connection = new SQLiteConnection())
            {
                //Тут делаем таблицу и выводим инфу



                ;//(SQLiteConnection)factory.CreateConnection();
                connection.ConnectionString = "Data Source = " + SqLiteDB.pathDBFull_EU;
                SQLiteCommand command = new SQLiteCommand(connection);
                SQLiteCommand insert  = new SQLiteCommand("select EU.RELMUCH_LABEL, EU.RPRT_NOM,  EU.MARKA_NAME, EU.RELMUCH_THICKNESS, EU.RELMUCH_WIDTH, EU.RELMUCH_VES  FROM EU WHERE EU.RPRT_NOM  LIKE '%" + searchText + "%' LIMIT 100;", connection);
                connection.Open();
                SQLiteDataReader reader = insert.ExecuteReader();
                while (reader.Read())
                {
                    DataRow row1 = _tblEU.NewRow();
                    //Запроск К БД
                    row1["Label"]  = SqlLiteQuery.getReaderByName(reader, "RELMUCH_LABEL");
                    row1["УЕ"]     = SqlLiteQuery.getReaderByName(reader, "RPRT_NOM");
                    row1["Марка"]  = SqlLiteQuery.getReaderByName(reader, "MARKA_NAME");
                    row1["Размер"] = SqlLiteQuery.getReaderByName(reader, "RELMUCH_THICKNESS") + "х" + SqlLiteQuery.getReaderByName(reader, "RELMUCH_WIDTH");
                    row1["Вес"]    = SqlLiteQuery.getReaderByName(reader, "RELMUCH_VES");

                    _tblEU.Rows.Add(row1);
                    //listEU.Add(EU);
                }
                reader.Close();
                connection.Close();

                command.Dispose();
                insert.Dispose();
                reader.Dispose();
            }


            dataGridEu.BeginInvoke(new Action(() =>
            {
                dataGridEu.DataSource = _tblEU;
            }));

            if (_tblEU.Rows.Count > 0)
            {
                dataGridEu.BeginInvoke(new Action(() =>
                {
                    dataGridEu.Select(0);
                }));

                SelectLabel  = dataGridEu[dataGridEu.CurrentRowIndex, 3].ToString();
                SelectYE     = dataGridEu[dataGridEu.CurrentRowIndex, 0].ToString();
                SelectMarka  = dataGridEu[dataGridEu.CurrentRowIndex, 1].ToString();
                SelectRazmer = dataGridEu[dataGridEu.CurrentRowIndex, 2].ToString();

                //
                try
                {
                    SelectWeight = Double.Parse(dataGridEu[dataGridEu.CurrentRowIndex, 4].ToString());
                }

                catch (Exception) { }
            }
        }
예제 #18
0
        public WarehousePost(Intermec.DataCollection.BarcodeReader _bcr, string LabelPlace, ListScanOperation _ScanOperation, int MxCodeAutomation)
        {
            InitializeComponent();
            FormActive = true;
            set        = new Settings("DataBrCode.xml");

            ScanOperation = _ScanOperation;
            listEU        = new List <WebReference.Relmuch>();

            bcr = _bcr;

            this.labelPlace = LabelPlace;
            _tblEU          = InitTable();

            CreateColumn("УЕ", "УЕ", 180, 0);
            CreateColumn("Марка", "Марка", 120, 1);
            CreateColumn("Вес", "Вес", 100, 2);
            CreateColumn("Размер", "Размер", 140, 3);
            CreateColumn("Label", "Label", 400, 4);
            dataGridEu.DataSource = _tblEU;

            InitScaner();

            labelMX.Text = LabelPlace;

            //Выгрузим подробную инфу по месту хранения
            //labelMXMore.Text = getValueDataTableColumnRow(_TblWarehouse, "TEHUZ_LABEL", LabelPlace, "TEHUZ_NAME");
            labelMXMore.Text = SqlLiteQuery.GetNameMX(LabelPlace);

            CMxPlace               = new DataBarCode.WebReference.MXPlace();
            CMxPlace.LABEL         = LabelPlace;
            CMxPlace.CODEAUTOMATIC = MxCodeAutomation;


            //Тут правим лейбл
            string StatusBD = "БД: " + SqLiteDB.UpdateDateTime + ". Операции: " + BufferToBD.CountBuffer;

            labelBD.BeginInvoke(new Action(() =>
            {
                labelBD.Text = StatusBD;
            }));
            this.KeyPreview = true;



            switch (ScanOperation)
            {
            case ListScanOperation.MXSet:
            {
                this.Text = "Размещение ЕУ";
                break;
            }


            case ListScanOperation.EUTaskMove:
            {
                this.Text = "Перемещение ЕУ";
                break;
            }

            case ListScanOperation.EuInAgr:
            {
                this.Text = "ЕУ в агрегат";
                break;
            }

            case ListScanOperation.EuInAgrTESA:
            {
                this.Text      = "ЕУ в агрегат ТЭСА";
                addManualFirst = true;
                break;
            }

            case ListScanOperation.InventoryTask:
            {
                this.Text = "Инвентаризация МХ: " + labelMXMore.Text;
                break;
            }
            }
            labelCountScan.Text = "0";
        }