Exemplo n.º 1
0
 public ProposalService()
 {
     _flowService = new FlowService();
     _userRepository = new UserRepository();
     _proposalRepository = new ProposalRepository();
     _notifyMessageRepository = new NotifyMessageRepository();
     _log = new DefaultLoggerFactory().GetLogger();
 }
Exemplo n.º 2
0
        public void ProposalRepository_CanStore()
        {
            var repo     = new ProposalRepository();
            var proposal = new Proposal("мое славное предложение");
            var section  = new Section("секция 1", new Subsection("первый подраздел"));

            proposal.Add(section);
            repo.Store(proposal); // without error
        }
 public PhaseOneController(
     ProposalRepository proposalRepository,
     UserRepository userRepository,
     ConferenceRepository conferenceRepository,
     RoleRepository roleRepository
     )
 {
     this.proposalRepository   = proposalRepository;
     this.userRepository       = userRepository;
     this.conferenceRepository = conferenceRepository;
     this.roleRepository       = roleRepository;
 }
Exemplo n.º 4
0
 public void Initialize()
 {
     proposalRepository = ApplicationFactory.getProposalRepository();
     userRepository     = ApplicationFactory.getUserRepository();
     proposal           = new Proposal();
     user                   = new User();
     proposal.Title         = "Test";
     proposal.AbstractPaper = "Test";
     user.FirstName         = "Test";
     user.Email             = "*****@*****.**";
     proposal.Authors.Add(user);
 }
Exemplo n.º 5
0
 public List <Proposal> FindAll()
 {
     try
     {
         ProposalRepository proposalRepository = new ProposalRepository();
         return(proposalRepository.FindAll());
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 6
0
 public void Initialize()
 {
     reviewRepository   = ApplicationFactory.getReviewRepository();
     proposalRepository = ApplicationFactory.getProposalRepository();
     review             = new Review();
     proposal           = new Proposal();
     review.DateCreated = DateTime.Now;
     review.Comment     = "Test";
     review.Qualifier   = "Reject";
     proposal.Title     = "Ceva test";
     review.Proposal    = proposal;
 }
Exemplo n.º 7
0
 public void Insert(Proposal obj)
 {
     try
     {
         ProposalRepository proposalRepository = new ProposalRepository();
         obj.Value = new Random().Next(1, 5000);
         proposalRepository.Insert(obj);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 8
0
        public void ProposalRepository_CanRetrieve()
        {
            var repo     = new ProposalRepository();
            var proposal = new Proposal("мое славное предложение");
            var section  = new Section("секция 1", new Subsection("первый подраздел"));

            proposal.Add(section);
            repo.Store(proposal); // without error

            var actual = repo.Retrieve(proposal.Id);

            Assert.AreEqual(proposal, actual);
        }
        public ActionResult GetProposals(string Uname)
        {
            if (Uname != (string)Session["UserName"])
            {
                return(Content("<script language = 'javascript' type = 'text/javascript'>alert('Sorry, Session Expired!!'); window.location.href = 'login'</script>"));
            }
            Institute       i = (Institute)Session["Institute"];
            string          Curr_Institute = (string)i.Name;
            List <Proposal> All_Proposals  = new ProposalRepository().GetProposals(Curr_Institute);
            ProposalList    p = new ProposalList();

            p.PList = All_Proposals;
            return(View(p));
        }
 public PhaseTwoController(
     ReviewRepository reviewRepo,
     ProposalRepository proposalRepo,
     UserRepository userRepo,
     ConferenceRepository conferenceRepository,
     UserRoleRepository userRoleRepo,
     RoleRepository roleRepository
     )
 {
     this.reviewRepo           = reviewRepo;
     this.proposalRepo         = proposalRepo;
     this.userRepo             = userRepo;
     this.conferenceRepository = conferenceRepository;
     this.userRoleRepo         = userRoleRepo;
     this.roleRepository       = roleRepository;
 }
 public void Initialize()
 {
     sectionRepository  = ApplicationFactory.GetSectionRepository();
     proposalRepository = ApplicationFactory.getProposalRepository();
     userRepository     = ApplicationFactory.getUserRepository();
     user                     = new User();
     newUser                  = new User();
     section                  = new Section();
     newSection               = new Section();
     section.SectionLeader    = null;
     newSection.SectionLeader = null;
     proposal                 = new Proposal();
     section.Name             = "Test";
     section.Room             = "Test room";
     proposal.Title           = "Test proposal";
     user.FirstName           = "User test";
     newUser.FirstName        = "Newuser test";
     newSection.Name          = "New section";
     newSection.Room          = null;
 }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            IProposalRepository repository = new ProposalRepository();

            for (var index = 0; index < 13; index++)
            {
                var strIndex    = index.ToString().PadLeft(3, '0');
                var inputLines  = File.ReadAllLines($"Assets/input{strIndex}.txt");
                var outputLines = File.ReadAllLines($"Assets/output{strIndex}.txt");

                var result = Solution.Instance(repository).ProcessMessages(inputLines);
                if (outputLines[0] == result)
                {
                    Console.WriteLine($"Test #{index + 1}/#13 - Passed");
                }
                else
                {
                    Console.WriteLine($"Test #{index + 1}/#13 - Failed");
                }
            }
        }
Exemplo n.º 13
0
        public ActionResult ProposalIndex(int?page, Int64?providerId, string vl, string prm = null)
        {
            TempData["providerId"] = providerId;
            ProposalVM         proposalVM         = new ProposalVM();
            ProposalRepository proposalRepository = new ProposalRepository();

            try
            {
                Search search = new Search();
                search            = SetValue(page, vl, prm);
                search.ProviderID = (Int64)providerId;


                int pageSize   = 15;
                int pageNumber = (page ?? 1);

                proposalVM.Search            = search;
                proposalVM.Search.pageSize   = pageSize;
                proposalVM.Search.pageNumber = pageNumber;
                proposalVM.ProviderID        = search.ProviderID;
                proposalVM.RProposalList     = proposalRepository.SW_GePropsals(proposalVM.Search);

                proposalVM.ListCount = proposalRepository.SW_GePropsalssCount(proposalVM.Search);
                int[] pc = new int[proposalVM.ListCount];

                proposalVM.Paging = pc.ToPagedList(pageNumber, pageSize);

                //  viewModel.vehicleId = vehicleId;

                return(Request.IsAjaxRequest()
              ? (ActionResult)PartialView("ProposalPartialIndex", proposalVM)
              : View(proposalVM));
            }
            catch (Exception ex)
            {
                return(View("Error", new HandleErrorInfo(ex, "Error", "Error")));
            }
        }
 public ProposalController()
 {
     ProposalRepo = new ProposalRepository();
 }
Exemplo n.º 15
0
 public ProposalCommands(ProposalRepository repository)
 {
     _repository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Exemplo n.º 16
0
 public static IProposalRepository GetProposalRepository()
 {
     var m = new Mock<IDatabaseFactory>();
     var repo = new ProposalRepository(m.Object);
     return repo;
 }
Exemplo n.º 17
0
 public ProposalCommands(ProposalRepository repository)
 {
     this.repository = repository;
 }