Exemplo n.º 1
0
    private static ProjectActionStatus Validate(string Project, actionType act)
    {
        ProjectBLL     ProjectBLL = new ProjectBLL();
        List <Project> Projects   = ProjectBLL.GetProjectByFilter(Project.Trim());

        if (Projects.Count > 0 && act == actionType.insert)
        {
            return(ProjectActionStatus.Duplicate);
        }
        else
        {
            return(ProjectActionStatus.Success);
        }
    }
Exemplo n.º 2
0
    private static ProjectActionStatus Validate(string scientificName, actionType act)
    {
        ProjectBLL     scientificNameBLL = new ProjectBLL();
        List <Project> scientificNames   = scientificNameBLL.GetProjectByFilter(scientificName.Trim());

        if (scientificNames.Count > 0 && act == actionType.insert)
        {
            return(ProjectActionStatus.Duplicate);
        }
        else if (scientificNames.Count > 0 && scientificNames[0].ProjectName == scientificName && act == actionType.update)
        {
            return(ProjectActionStatus.Duplicate);
        }
        else
        {
            return(ProjectActionStatus.Success);
        }
    }
Exemplo n.º 3
0
    private static ProjectActionStatus Validate(string Project, actionType act)
    {
        ProjectBLL     ProjectBLL = new ProjectBLL();
        List <Project> Projects   = ProjectBLL.GetProjectByFilter(Project.Trim());

        if (Projects.Count > 0 && act == actionType.insert)
        {
            UserBLL userBLL = new UserBLL();
            Eisk.BusinessEntities.User user = userBLL.GetUserByUserName((HttpContext.Current.User.Identity).Name);

            foreach (var item in Projects)
            {
                if (item.Group_Projects.First().GroupID == user.Group_Users.First().GroupID)
                {
                    return(ProjectActionStatus.Duplicate);
                }
            }
            return(ProjectActionStatus.Success);
        }
        else
        {
            return(ProjectActionStatus.Success);
        }
    }