Esempio n. 1
0
        public Form1()
        {
            //f2 = new Auth(this);
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;
            //f2.ShowDialog();

            fBJAuthorization au = new fBJAuthorization("BJACC");

            au.ShowDialog();
            if (au.User != null)
            {
                bjUser             = au.User;
                this.EmpID         = bjUser.Id;  //dbG.EmpID;
                this.textBox1.Text = bjUser.FIO; //dbG.UserName;
            }
            //Form1.Scanned += new ScannedEventHandler(Form1_Scanned);
            this.bConfirm.Enabled = false;
            this.bCancel.Enabled  = false;
            label4.Text           = "Журнал событий " + DateTime.Now.ToShortDateString() + ":";



            // Formular.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            //   Formular.Columns.Clear();

            port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
            port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
            port.Handshake     = Handshake.RequestToSend;
            port.NewLine       = Convert.ToChar(13).ToString();

            try
            {
                port.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Log();
        }
Esempio n. 2
0
        public Form1()
        {
            // f2 = new Auth(this);
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;
            //f2.ShowDialog();
            fBJAuthorization au = new fBJAuthorization("BJSCC");

            au.ShowDialog();
            if (au.User != null)
            {
                bjUser             = au.User;
                this.EmpID         = bjUser.Id;  //dbG.EmpID;
                this.textBox1.Text = bjUser.FIO; //dbG.UserName;
            }

            this.bConfirm.Enabled = false;
            this.bCancel.Enabled  = false;
            label4.Text           = "Журнал событий " + DateTime.Now.ToShortDateString() + ":";

            port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
            port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
            port.Handshake     = Handshake.RequestToSend;
            port.NewLine       = Convert.ToChar(13).ToString();

            try
            {
                port.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Log();
            dgvLOG.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            dgvLOG.RowTemplate.DefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
        }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            fBJAuthorization fAuth = new fBJAuthorization("BJVVV");

            fAuth.ShowDialog();
            if (fAuth.DialogResult == DialogResult.Cancel || fAuth.User == null)
            {
                Close();
                return;
            }
            user        = fAuth.User;
            label1.Text = $"{user.SelectedUserStatus.DepName} {user.FIO}";
            //для 0 и 4 этажа требования выводить в одну таблицу.
            if (user.SelectedUserStatus.DepId == 8 || user.SelectedUserStatus.DepId == 15)
            {
                this.ForSQL = $" and mhran.ID in (8, 15) ";
            }
            else
            {
                this.ForSQL = $" and mhran.ID =  {user.SelectedUserStatus.DepId}  ";
            }
            db = new DbForEmployee(this.OrderTableType, this.BASE, this);
        }