Exemplo n.º 1
0
        public bool CheckManagerExisted(Employee employee)
        {
            Guid managerRankID = new RankDAL().GetRankIDByRankName("Manager");
            Guid staffRankID   = new RankDAL().GetRankIDByRankName("Staff");

            if (staffRankID == employee.RankID)
            {
                return(false);
            }
            else if (managerRankID == employee.RankID)
            {
                bool managerExisted = new DepartmentDAL().CheckManagerExisted(employee.DepartmentID);
                if (managerExisted)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public Department[] listAssignedDepartment(Project prj)
        {
            DataTable dtDptID = SqlHelper.ExecuteDataTable(@"select departmentID 
            from T_PrjDptParticipation where projectID=@prjID",
                                                           new SqlParameter("@prjID", prj.projectID));

            Department[] dpts = new Department[dtDptID.Rows.Count];
            for (int i = 0; i < dtDptID.Rows.Count; i++)
            {
                dpts[i] = new DepartmentDAL().getByID((Guid)dtDptID.Rows[i][0]);
            }
            return(dpts);
        }