Beispiel #1
0
        public static bool AddEmployee(EmployeeMaster addEmp)
        {
            bool addedEmployee = false;

            try
            {
                using (TeamSixEntity ent = new TeamSixEntity())
                {
                    EmployeeMaster empIo = new EmployeeMaster();
                    empIo.Designation        = addEmp.Designation;
                    empIo.EmployeeID         = addEmp.EmployeeID;
                    empIo.FirstName          = addEmp.FirstName;
                    empIo.MiddleName         = addEmp.MiddleName;
                    empIo.LastName           = addEmp.LastName;
                    empIo.Location           = addEmp.Location;
                    empIo.ReimbursementAccNo = addEmp.ReimbursementAccNo;
                    empIo.UserName           = addEmp.UserName;
                    empIo.PasswordHASH       = addEmp.PasswordHASH;
                    ent.EmployeeMasters.Add(empIo);
                    ent.SaveChanges();
                    addedEmployee = true;
                }
            }
            catch (EmpException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(addedEmployee);
        }
Beispiel #2
0
        public static bool CheckEmployeeLogin(string userName, string Password)
        {
            bool ckLoginStat = false;

            using (TeamSixEntity ent = new TeamSixEntity()) {
                var q = from res in ent.EmployeeMasters
                        where res.UserName == userName && res.PasswordHASH == comPuteHash(Password)

                        select res;
                if (q != null)
                {
                    ckLoginStat = true;
                }
            }

            return(ckLoginStat);
        }
Beispiel #3
0
        public static bool chngPassword(string emplEmail, int empID)
        {
            bool isSucess = false;

            using (TeamSixEntity ent = new TeamSixEntity())
            {
                var q = from emp in ent.EmployeeMasters
                        where emp.EmployeeID == empID
                        select emp;
                if (q != null)
                {
                    isSucess = true;
                }
            }
            if (isSucess)
            {
            }
            return(isSucess);
        }