Пример #1
0
 public void StartOperation(String AdressAppServer)
 {
     WebReference.WebSDataBrCode BrServer = new WebReference.WebSDataBrCode();
     BrServer.SoapVersion   = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
     BrServer.Url           = AdressAppServer;
     BrServer.BrHeaderValue = CBrHeader.GetHeader();
     BrServer.Credentials   = new NetworkCredential(CBrHeader.Login, CBrHeader.Password);
     DataTable result = BrServer.POST_EU_IN_AGR(label, Agr, TimeOperation);
 }
Пример #2
0
        private void EUInAgr()
        {
            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);
            if (BufferToBD.ModeNetTerminalB)
            {//Если мы в Онлайне
                try
                {
                    DataTable result = BrServer.POST_EU_IN_AGR(listEU.ToArray(), labelPlace, null);

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


                    //Меняем статус на нужный
                    for (int ii = 0; ii < _tblEU.Rows.Count; ii++)
                    {
                        _tblEU.Rows[ii]["Commit"] = "1";
                    }

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

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

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


                    //Меняем статус на нужный
                    for (int ii = 0; ii < _tblEU.Rows.Count; ii++)
                    {
                        _tblEU.Rows[ii]["Commit"] = "3";
                    }

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

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

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


                    //Меняем статус на нужный
                    for (int ii = 0; ii < _tblEU.Rows.Count; ii++)
                    {
                        _tblEU.Rows[ii]["Commit"] = "3";
                    }

                    dataGridEu.BeginInvoke(new Action(() =>
                    {
                        dataGridEu.DataSource = _tblEU;
                    }));
                }
            }
            else
            {//Если мы в Офлайне
                BufferOper_POST_EU_IN_AGR Oper = new BufferOper_POST_EU_IN_AGR(labelPlace, listEU.ToArray());
                BufferToBD.BufferAdd(new BufferOperation(TypeClassBuffer.POST_EU_IN_AGR, Oper));

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


                //Меняем статус на нужный
                for (int ii = 0; ii < _tblEU.Rows.Count; ii++)
                {
                    _tblEU.Rows[ii]["Commit"] = "3";
                }

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