public ActionResult Create_Post()
 {
     if (ModelState.IsValid)
     {
         JobSearcher jobSearcher = new JobSearcher();
         UpdateModel <JobSearcher>(jobSearcher);
         jobSearcherRepository.Add(jobSearcher);
         TempData["Message"] = "Added successfully";
         return(RedirectToAction("Index"));
     }
     return(View());
 }
        public ActionResult Update()
        {
            JobSearcher job = new JobSearcher();

            if (ModelState.IsValid)
            {
                TryUpdateModel <JobSearcher>(job);
                jobSearcherRepository.Update(job);
                TempData["Message"] = "Updated succesfully";
                return(RedirectToAction("Index"));
            }
            return(View("Edit", job));
        }
        public ActionResult Edit(int id)
        {
            JobSearcher search = jobSearcherRepository.GetJobSearchersById(id);

            return(View(search));
        }
        public MainForm()
        {
            InitializeComponent();
            if (DesignMode || AppRunMode.DesignMode)
            {
                return;
            }

            _updateStatusDeferredAction = new DeferredAction(updateStatus)
            {
                MinNextActionTime = TimeSpan.FromSeconds(1), ReExecuteOnAbortSuspended = false, ReExecuteOnError = false
            };

            _asyncProcessorr              = new AsyncProcessor(5);
            _asyncProcessorr.ActionBegin += _asyncProcessorr_ActionsChanged;
            _asyncProcessorr.ActionEnd   += _asyncProcessorr_ActionsChanged;
            _asyncProcessorr.ActionError += _asyncProcessorr_ActionsChanged;

            jobSearcher           = new JobSearcher(_asyncProcessorr);
            formStateSaver        = new FormStateSaver(this, true, "Reserve");
            jobSearcher.Modified += jobSearcher_Modified;

            _deferredAsyncProcessor = new DeferredAsyncProcessor(new AsyncProcessor(10));

            objectEditor1.DeferredAsyncProcessor = _deferredAsyncProcessor;
            resultList1.DeferredAsyncProcessor   = _deferredAsyncProcessor;
            resultList2.DeferredAsyncProcessor   = _deferredAsyncProcessor;
            resultList3.DeferredAsyncProcessor   = _deferredAsyncProcessor;
            resultList4.DeferredAsyncProcessor   = _deferredAsyncProcessor;

            resultList1.JobSearcher = jobSearcher;
            resultList2.JobSearcher = jobSearcher;
            resultList3.JobSearcher = jobSearcher;
            resultList4.JobSearcher = jobSearcher;

            resultList1.Results = jobSearcher.Results;
            resultList2.Results = jobSearcher.Favorites;
            resultList3.Results = jobSearcher.Favorites2;
            resultList4.Results = jobSearcher.BlockedResults;

            resultList1.BlockCompanies += resultList1_BlockCompanies;
            resultList2.BlockCompanies += resultList1_BlockCompanies;
            resultList3.BlockCompanies += resultList1_BlockCompanies;
            resultList4.BlockCompanies += resultList1_BlockCompanies;

            IDictionaryChangedDict <ICollectionChangedList <Result>, string> resultsDict = new SortDict <ICollectionChangedList <Result>, string>(CompareUtils.CompareHashCode);

            resultList1.ResultsDict = resultsDict;
            resultsDict.Add(jobSearcher.Results, "Results");
            resultList2.ResultsDict = resultsDict;
            resultsDict.Add(jobSearcher.Favorites, "Favorites");
            resultList3.ResultsDict = resultsDict;
            resultsDict.Add(jobSearcher.Favorites2, "Not sure");
            resultsDict.Add(jobSearcher.BlockedResults, "Blocked");
            resultList4.ResultsDict = resultsDict;

            objectEditor1.SetBindObject(jobSearcher.Sites);

            checkTextBox1.CheckTextChanged += checkTextBox1_CheckTextChanged;
            checkTextBox2.CheckTextChanged += checkTextBox1_CheckTextChanged;
        }