Esempio n. 1
0
        public bool ValidateToInsertProject(string TeamName, string ProjectName)
        {
            bool Valid = !string.IsNullOrEmpty(ProjectName) && !string.IsNullOrEmpty(TeamName) &&
                         ProjectName.IsAlphaNumeric() && TeamName.IsAlphaNumeric();

            return(Valid ? _ProjectRepository.AddNewProject(TeamName, ProjectName) : false);
        }
Esempio n. 2
0
 public bool AddNewProject(Project project)
 {
     using (DalSession dalSession = new DalSession())
     {
         UnitOfWork unitOfWork = dalSession.UnitOfWork();
         unitOfWork.Begin();
         try
         {
             _projectRepository = new ProjectRepository(unitOfWork);
             int addNewProject = _projectRepository.AddNewProject(project);
             if (addNewProject == 1)
             {
                 unitOfWork.Commit();
                 return(true);
             }
             else
             {
                 unitOfWork.Rollback();
                 return(false);
             }
         }
         catch
         {
             unitOfWork.Rollback();
             throw;
         }
     }
 }