Exemplo n.º 1
0
 public ArticlesViewModel(string keyword, string practice, string contributor, string country, string city, string page, List <City> cities, List <Country> countries)
 {
     this.FoundArticles       = ArticleCore.GetFilteredArticles(keyword, practice, contributor, country, city, page);
     this.RelatedContributors = ContributorCore.GetContributorsById(FoundArticles.Select(x => x.ContributorID).ToList());
     this.RelatedAreas        = PracticeAreaCore.GetPracticeAreasById(FoundArticles.Select(x => x.PracticeAreaID).ToList());
     this.Cities    = cities;
     this.Countries = countries;
     this.Keyword   = keyword;
 }
Exemplo n.º 2
0
 public IActionResult AddPracticeArea(string id)
 {
     if (!string.IsNullOrEmpty(id))
     {
         PracticeArea practiceArea = PracticeAreaCore.GetPracticeAreasById(id);
         if (practiceArea != null)
         {
             return(View(new PracticeAreaAddEditModel(practiceArea)));
         }
     }
     return(View(new PracticeAreaAddEditModel()));
 }
Exemplo n.º 3
0
        public IActionResult AddUserPost(PracticeAreaAddEditModel model)
        {
            Result result = new Result("Kullanıcı kaydedildi", true, "");

            try
            {
                PracticeAreaCore.AddEditPracticeArea(model);
            }
            catch (Exception ex)
            {
                result = new Result("Kullanıcı kaydedilirken bir hata oluştu", false, ex.Message);
            }
            return(Json(result));
        }
Exemplo n.º 4
0
        public IActionResult RemovePracticeArea(string id, string page = "1")
        {
            Result result = new Result("Disiplin silindi", true, "");

            try
            {
                PracticeAreaCore.RemovePracticeArea(id);
            }
            catch (Exception ex)
            {
                result = new Result("Disiplin silinirken bir hata oluştu", false, ex.Message);
            }
            return(RedirectToAction("PracticeAreas", new { id = id, page = page }));
        }
Exemplo n.º 5
0
        public IActionResult PracticeAreas(string q = "")
        {
            if (string.IsNullOrEmpty(q))
            {
                q = "";
            }
            List <SelectRow> options = new List <SelectRow>();

            foreach (PracticeArea area in PracticeAreaCore.GetPracticeAreasByName(q))
            {
                options.Add(new SelectRow(area.ID, area.Name));
            }
            return(Json(new { results = options }));
        }
Exemplo n.º 6
0
 public IActionResult AddArticle(string id)
 {
     if (!string.IsNullOrEmpty(id))
     {
         Article article = ArticleCore.GetArticleByArticleId(id);
         if (article != null)
         {
             Contributor         contributor  = ContributorCore.GetContributorsById(article.ContributorID);
             PracticeArea        practiceArea = PracticeAreaCore.GetPracticeAreasById(article.PracticeAreaID);
             List <ArticlePiece> pieces       = ArticleCore.GetArticlePiecesByArticleId(article.ID);
             return(View(new ArticleAddEditModel(article, pieces, contributor, practiceArea)));
         }
     }
     return(View(new ArticleAddEditModel()));
 }
Exemplo n.º 7
0
 public PracticeAreasViewModel(string keyword, string page)
 {
     this.FoundPracticeAreas = PracticeAreaCore.GetFilteredPracticeAreas(keyword, page);
     this.Keyword            = keyword;
 }