Exemplo n.º 1
0
 protected bool Logout()
 {
     //Пишем команду logout!
     Dictionary<string, object> DataMapWrite = new Dictionary<string, object>();
     DataMapWrite["Спр.СинхронизацияДанных.ДатаСпрВход1"] = SS.ExtendID(FEmployer.ID, "Спр.Сотрудники");
     DataMapWrite["Спр.СинхронизацияДанных.ДатаВход1"] = DeviceID.GetDeviceName();
     if (!SS.ExecCommandNoFeedback("Logout", DataMapWrite))
     {
         return false;
     }
     SS.ExecuteWithoutRead("exec IBS_Finalize");
     return true;
 }
Exemplo n.º 2
0
 protected bool Login()
 {
     if (!SS.UpdateProgram())
     {
         return false;
     }
     if (!SS.SynhDateTime())
     {
         return false;
     }
     if (!SS.IBS_Inicialization(Employer))
     {
         return false;
     }
     Dictionary<string, object> DataMapWrite = new Dictionary<string, object>();
     DataMapWrite["Спр.СинхронизацияДанных.ДатаСпрВход1"] = SS.ExtendID(Employer.ID, "Спр.Сотрудники");
     DataMapWrite["Спр.СинхронизацияДанных.ДатаВход1"] = DeviceID.GetDeviceName();
     if (!SS.ExecCommandNoFeedback("Login", DataMapWrite))
     {
         return false;
     }
     return true;
 }
Exemplo n.º 3
0
        } // InitSS
        /// <summary>
        /// Здесь будем все инициализировать (форма уже отстроена, только не видно ее)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FMainOnLoad(object sender, EventArgs e)
        {
            //Text = "zhopa";
            //return;
            InicializeFont();
            CurrWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
            //СОЗДАЕМ ПАНЕЛИ
            pnlCurrent = new ExPanel();
            //pnlCurrent.BackColor = SystemColors.ActiveBorder;
            pnlCurrent.BackColor = Color.White;
            pnlCurrent.Location = new Point(0, 16);
            pnlCurrent.Name = "pnlCurrent";
            pnlCurrent.Size = new Size(CurrWidth - 2, 185);
            this.Controls.Add(pnlCurrent);
            pnlCurrent.BringToFront();
            //pnlSections.BackColor = System.Drawing.SystemColors.ActiveBorder;

            //ИНИЦИАЛИЗАЦИЮ РАЗМЕСТИМ ЗДЕСЬ
            DGCellChange = false;
            Text = "WPM " + Vers;
            WindowState = FormWindowState.Maximized;
            ViewMode = Mode.None;
            Screan = 0;
            Br = new Barcode(this, 200);
            Br.BarcodeRead += ReactionBarcode;
            Br.HotKeyEvent += HotKeyEvent;

            //MessageBox.Show();
            //string[] names = Assembly.GetExecutingAssembly().GetModules

            //MessageBox.Show(Assembly.GetExecutingAssembly().Location);
            //MessageBox.Show(Path.GetFullPath(FileName));
            //return;
            //MessageBox.Show("Hyper");
            int CountServers = 2;
            string[] NamesOfServers;
            NamesOfServers = new string[CountServers];
            NamesOfServers[0] = @"192.168.8.4,57068";
            NamesOfServers[1] = @"192.168.8.5,57068";
            //NamesOfServers[0] = @"192.168.8.11\sqlcl1";
            //NamesOfServers[1] = @"192.168.8.12\sqlcl1";
            //DO NOT FORGOT CHANGE PARAMETR: CountServers!!!

            if (false)
            {
                //ТЕСТ ЭКРАНА
                pnlCurrent.Controls.Clear();
                ABaseMode Obj = new Waiting(SS, null);
                //RefillSet_view();
                RefillLayout_view();
                foreach (Control Ctrl in pnlCurrent.Controls)
                {
                    if (Ctrl.GetType().Equals(typeof(Label)))
                    {
                        (Ctrl as Label).Text = "00000000000000000000000000000000000000";
                    }
                    else if (Ctrl.GetType().Equals(typeof(DataGrid)))
                    {
                        (Ctrl as DataGrid).Visible = false;
                    }
                }
                return;
            }



            string FirstServName = GetServName(NamesOfServers[0]);
            InitSS(FirstServName);

            if (!SS.Initialize())
            {
                for (int i = 0; i < CountServers; ++i)
                {
                    if (FirstServName == NamesOfServers[i])
                    {
                        continue;
                    }

                    InitSS(NamesOfServers[i]);
                    if (SS.Initialize())
                    {
                        SaveServName(NamesOfServers[i]);
                        break;
                    }
                }
            }
            if (!SS.Connect)
            {
                MessageBox.Show("Не удалось синхронизовать (версия: " + Vers + ")! ОШИБКА: " + SS.ExcStr);
                Close();
                return;
            }
            View();
            if (SS.DeviceName == null || SS.DeviceName.Trim() == "")
            {
                lblName.Text = Helper.SuckDigits(DeviceID.GetDeviceName());
            }
            else
            {
                lblName.Text = Helper.SuckDigits(SS.DeviceName);
            }
            pnlCurrent.GetLabelByName("lblResult").Text = "";
            lblAction.Width = CurrWidth - 2;
            //lblAction.Font = new Font("Tahoma", CurrWidth < 320 ? 11 : 14, FontStyle.Bold);
            lblName.Location = new Point(CurrWidth - 24, 0);
            lblState.Width = CurrWidth - 2;
            lblState.Font = CurrWidth < 320 ? FontTahoma8Bold : FontTahoma10Bold;
        }