Exemplo n.º 1
0
        public SecurityForm()
        {
            _staffTable        = new Access_control_in_OneWire.StaffDataTable();
            _staffTableAdapter = new StaffTableAdapter();
            _staffTableAdapter.ClearBeforeFill = true;
            _staffTableAdapter.Fill(_staffTable);

            _eventLogAdapter = new JoinedEventLogAdapter();
            _eventLogAdapter.ClearBeforeFill = true;
            _eventLogAdapter.Adapter.InsertCommand.Connection = _eventLogAdapter.Connection;

            _shAdapter.ClearBeforeFill = true;
            _shTable = new Access_control_in_OneWire.ScheduleDataTable();
            //try{
            _dialog = new UIDCOMDialog(Properties.Settings.Default.COMName, Properties.Settings.Default.BaudRate, 8, _listener_UIDReceived);
            //}
            //catch(Exception)
            //{
            //	MessageBox.Show(this, "Не удалось получить доступ к COM-порту.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //	this.Close();
            ///	return;
            //}

            InitializeComponent();
            this.CenterToScreen();
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ITODataSet.StaffDataTable staffTbl = new ITODataSet.StaffDataTable();
            StaffTableAdapter dAdapt = new StaffTableAdapter();
            dAdapt.Fill(staffTbl);

            dataGridView1.DataSource = staffTbl;
        }
Exemplo n.º 3
0
        public static void LoadData()
        {
            var userAdapter = new UserTableAdapter();
            var userData    = userAdapter.GetData();

            foreach (var row in userData)
            {
                var newRow = DataSet.User.NewUserRow();

                newRow.ID         = row.ID;
                newRow.LastName   = row.LastName;
                newRow.FirstName  = row.FirstName;
                newRow.MiddleName = row.IsMiddleNameNull() ? "" : row.MiddleName;
                newRow.Type       = row.Type;

                DataSet.User.AddUserRow(newRow);
            }

            var machineAdapter = new MachineTableAdapter();
            var machineData    = machineAdapter.GetData();

            foreach (var row in machineData)
            {
                var newRow = DataSet.Machine.NewMachineRow();

                newRow.ID              = row.ID;
                newRow.IsFinalized     = row.IsFinalized;
                newRow.IsResultsViewed = row.IsResultsViewed;
                newRow.Name            = row.IsNameNull() ? "" : row.Name;

                DataSet.Machine.AddMachineRow(newRow);
            }

            var staffAdapter = new StaffTableAdapter();
            var staffData    = staffAdapter.GetData();

            foreach (var row in staffData)
            {
                var newRow = DataSet.Staff.NewStaffRow();

                newRow.UserRow  = DataSet.User.FindByID(row.UserID);
                newRow.Username = row.Username;
                newRow.Password = row.Password;

                DataSet.Staff.AddStaffRow(newRow);
            }

            var voterAdapter = new VoterTableAdapter();
            var voterData    = voterAdapter.GetData();

            foreach (var row in voterData)
            {
                var newRow = DataSet.Voter.NewVoterRow();

                newRow.ID            = row.ID;
                newRow.GradeLevel    = row.GradeLevel;
                newRow.StrandSection = row.StrandSection;
                newRow.IsMale        = row.IsMale;
                newRow.Birthday      = row.Birthday;
                newRow.VoterID       = row.VoterID;
                newRow.IsForeign     = row.IsForeign;
                newRow.MachineRow    = DataSet.Machine.FindByID(row.MachineID);

                DataSet.Voter.AddVoterRow(newRow);
            }
        }
Exemplo n.º 4
0
        public void FilllbStaff(string DepID)
        {
            lbStaff.Items.Clear();

            StaffTableAdapter dAdapt = new StaffTableAdapter();

            ITO_DAL.dsITO.StaffDataTable staffTbl = new dsITO.StaffDataTable();

            dAdapt.Fill(staffTbl);

            string filterString = "DepartmentID=" + DepID;

            DataRow[] staff = staffTbl.Select(filterString);

            //Отбражаем организационные единицы верхнего уровня UpDepID NULL
            for (int i = 0; i < staff.Length; i++)
            {
                ListElement le = new ListElement(staff[i]["UserID"].ToString(), staff[i]["LastName"].ToString() + " " +
                        staff[i]["Name"].ToString() + " " + staff[i]["SecondName"].ToString());

                lbStaff.Items.Add(le);

                //lbStaff.Items
                //  lvStaff.Items.Add(staff[i]["UserID"].ToString(), staff[i]["LastName"].ToString() + " " +
                // staff[i]["Name"].ToString() + " " + staff[i]["SecondName"].ToString(),0);
            }
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            checkedListBox1.Items.Clear();
            ADMethodsAccountManagement ADcon = new ADMethodsAccountManagement();

            StaffTableAdapter dAdapt = new StaffTableAdapter();

            ITO_DAL.dsITO.StaffDataTable staffTbl = new dsITO.StaffDataTable();

            dAdapt.Fill(staffTbl);

            string filterString = "State > 0";

            // DataRow[] staff = staffTbl.Select(filterString);
            DataRow[] staff = staffTbl.Select(filterString);

            //Отбражаем организационные единицы верхнего уровня UpDepID NULL
            for (int i = 0; i < staff.Length; i++)
            {
                if (!ADcon.IsUserExisiting(staff[i]["Login"].ToString()))
                {
                    listBox1.Items.Add(staff[i]["Login"].ToString() + " " +
                                       staff[i]["LastName"].ToString() + " " +
                                       staff[i]["Name"].ToString() + " " +
                                       staff[i]["SecondName"].ToString() + " not exist");

                    checkedListBox1.Items.Add(staff[i]["Login"].ToString());
                }
                // staff[i]["Login"].ToString()

                //lbStaff.Items
                //  lvStaff.Items.Add(staff[i]["UserID"].ToString(), staff[i]["LastName"].ToString() + " " +
                // staff[i]["Name"].ToString() + " " + staff[i]["SecondName"].ToString(),0);
            }
        }
Exemplo n.º 6
0
 public EmployeeModelController(MainForm mainForm)
 {
     this.mainForm     = mainForm;
     staffTableAdapter = new StaffTableAdapter();
 }