Esempio n. 1
0
        public ListMaintenance.ListEmployeeDataTable GetListEmployee(bool withNewRow)
        {
            ListEmployeeTableAdapter listEmployeeTableAdapter = new ListEmployeeTableAdapter();

            ListMaintenance.ListEmployeeDataTable listEmployeeDataTable = listEmployeeTableAdapter.GetData();

            if (withNewRow)
            {
                listEmployeeDataTable.AddListEmployeeRow("", DateTime.Now, "", "", -1, -1, (int)GlobalEnum.EntryStatusID.IsNew);
            }
            return(listEmployeeDataTable);
        }
Esempio n. 2
0
        public bool CheckPasswordSuccessful(int employeeID, string password)
        {
            ListEmployeeTableAdapter listEmployeeTableAdapter = new ListEmployeeTableAdapter();

            ListMaintenance.ListEmployeeDataTable listEmployeeDataTable = listEmployeeTableAdapter.GetDataByEmployeeID(employeeID);
            if (listEmployeeDataTable.Rows.Count > 0)
            {
                return(listEmployeeDataTable.Rows[0]["Password"].ToString() == password);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        private void PublicApplicationLogon_Load(object sender, EventArgs e)
        {
            try
            {
                this.comboBoxImageS8PortName.DataSource  = System.IO.Ports.SerialPort.GetPortNames();
                this.comboBoxAutonicsPortName.DataSource = System.IO.Ports.SerialPort.GetPortNames();

                if (this.comboBoxImageS8PortName.Items.Count == 0)
                {
                    this.comboBoxImageS8PortName.DataSource = null;
                    this.comboBoxImageS8PortName.Items.Add("COM 0");

                    this.comboBoxAutonicsPortName.DataSource = null;
                    this.comboBoxAutonicsPortName.Items.Add("COM 0");
                }

                DataTable dataTablePublicPrinterProperties = SQLDatabase.GetDataTable("SELECT TOP 1 * FROM PublicPrinterProperties");
                if (dataTablePublicPrinterProperties.Rows.Count > 0)
                {
                    this.comboBoxImageS8PortName.Text  = (string)dataTablePublicPrinterProperties.Rows[0]["ImageS8PortName"];
                    this.comboBoxAutonicsPortName.Text = (string)dataTablePublicPrinterProperties.Rows[0]["AutonicsPortName"];
                }


                string stringEmployeeID = GlobalRegistry.Read("EmployeeID"); int employeeID = -1;

                if (stringEmployeeID == null || stringEmployeeID.Length <= "string".Length || !int.TryParse(stringEmployeeID.Substring("string".Length), out employeeID))
                {
                    employeeID = 1;
                }
                this.EmployeeID = employeeID; this.buttonListEmployee.Visible = this.EmployeeID == 1;

                this.commonMetaList = new CommonMetaList();

                ListMaintenance.ListEmployeeDataTable listEmployeeDataTable = this.commonMetaList.GetListEmployee();
                this.comboBoxEmployeeID.DataSource    = listEmployeeDataTable;
                this.comboBoxEmployeeID.DisplayMember = listEmployeeDataTable.DescriptionColumn.ColumnName;
                this.comboBoxEmployeeID.ValueMember   = listEmployeeDataTable.EmployeeIDColumn.ColumnName;
                this.employeeIDBinding = this.comboBoxEmployeeID.DataBindings.Add("SelectedValue", this, "EmployeeID", true, DataSourceUpdateMode.OnPropertyChanged);

                this.employeeIDBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }