示例#1
0
文件: BelMES.cs 项目: CoolManSK/SSMR
        public Boolean EmployeeVerification(String EmployeeNumber)
        {
            //this.OperatorNumber = EmployeeNumber;
            try
            {
                this.Emp = this.Emp.EmployeeVerify(EmployeeNumber, this.Env.DB_Resource, this.Env.ESD_DB_Resource);
                if (this.Emp == null)
                {
                    this.Activated = false;
                    if (this.WarningMessages)
                    {
                        MessageBox.Show(String.Concat(this.Emp.strEmployeeCodeInfo, ". Zavolajte prosim testovacieho technika."), "CHYBA", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    this.WriteLogData(EmployeeNumber);
                    return(false);
                }
                else
                {
                    if (this.Emp.shtEmployeeID > 0 && string.IsNullOrEmpty(this.Emp.strEmployeeCodeInfo))
                    {
                        this.Env.Employee = new clEmployee(this.Emp.shtEmployeeID, this.Emp.strEmployeeName, EmployeeNumber, this.Emp.strEmployeeDepartment, this.Emp.strEmployeeProduction, this.Emp.strEmployeeCodeInfo);
                        this.WriteLogData(EmployeeNumber);
                    }
                    else
                    {
                        this.Activated = false;
                        MessageBox.Show(String.Concat(this.Emp.strEmployeeCodeInfo, ". Zavolajte prosim testovacieho technika."), "CHYBA", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.WriteLogData(EmployeeNumber);
                        return(false);
                    }
                }
                return(true);
            }
            catch
            {
                this.WriteLogData(EmployeeNumber);
                this.Activated = false;
                return(false);
            }
        }
示例#2
0
        private bool EmployeeVerify(string strEmpNum, ref string strEmpCodeInfo)
        {
            bool       blnValidEmployee = true;
            clEmployee employee         = new clEmployee();

            this.emp = employee.EmployeeVerify(strEmpNum, env.DB_Resource);
            if (emp == null)
            {
                strEmpCodeInfo = "Employee Number does not exist";
            }
            else
            {
                if (emp.shtEmployeeID > 0 && string.IsNullOrEmpty(emp.strEmployeeCodeInfo))
                {
                    env.Employee     = new clEmployee(emp.shtEmployeeID, emp.strEmployeeName, strEmpNum, emp.strEmployeeDepartment, emp.strEmployeeProduction, emp.strEmployeeCodeInfo);
                    blnValidEmployee = false;
                }
                strEmpCodeInfo = emp.strEmployeeCodeInfo;
            }
            return(blnValidEmployee);
        }
示例#3
0
        public Boolean EmployeeVerification(String EmployeeNumber)
        {
            try
            {
                this.Emp = this.Emp.EmployeeVerify(EmployeeNumber, this.Env.DB_Resource, this.Env.ESD_DB_Resource);
                if (this.Emp == null)
                {
                    this.Activated = false;
                    //MessageBox.Show("Employee Number does not exist");
                    this.WriteLogData(EmployeeNumber);
                    return(false);
                }
                else
                {
                    if (this.Emp.shtEmployeeID > 0 && string.IsNullOrEmpty(this.Emp.strEmployeeCodeInfo))
                    {
                        this.Env.Employee = new clEmployee(this.Emp.shtEmployeeID, this.Emp.strEmployeeName, EmployeeNumber, this.Emp.strEmployeeDepartment, this.Emp.strEmployeeProduction, this.Emp.strEmployeeCodeInfo);
                        this.WriteLogData(EmployeeNumber);
                    }
                    else
                    {
                        this.Activated = false;
                        //MessageBox.Show(this.Emp.strEmployeeCodeInfo);
                        this.WriteLogData(EmployeeNumber);
                        return(false);
                    }
                }

                return(true);
            }
            catch
            {
                this.WriteLogData(EmployeeNumber);
                this.Activated = false;
                return(false);
            }
        }