Beispiel #1
0
        public IActionResult LanguageCreate(SuTermLanguageCreateGetWithListModel FromForm)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id", FromForm.TermLanguage.Id)
                ,                       new SqlParameter("@LanguageId", FromForm.TermLanguage.LanguageId)
                ,                       new SqlParameter("@Customization", FromForm.TermLanguage.Customization)
            };

            _context.Database.ExecuteSqlCommand("UITermLanguageCreatePost @Id, @LanguageId, @Customization", parameters);


            return(RedirectToAction("LanguageIndex", new { Id = FromForm.TermLanguage.Id.ToString() }));
        }
Beispiel #2
0
        public IActionResult LanguageCreate(int Id)
        {
            SqlParameter CountryList = new SqlParameter("@Id", Id);

            var Languages = _context.ZDbLanguageList.FromSql("UITermLanguageCreateGetLanguages @Id",
                                                             CountryList
                                                             ).ToList();


            if (Languages.Count() == 0)
            {
                return(RedirectToAction("Index", new { Id }));
            }
            List <SelectListItem> LanguageList = new List <SelectListItem>();

            foreach (var x in Languages)
            {
                LanguageList.Add(new SelectListItem {
                    Value = x.Id.ToString(), Text = x.Name
                });
            }
            SuTermLanguageCreateGetModel TermLanguage = new SuTermLanguageCreateGetModel
            {
                Id = Id
            };

            ViewBag.Id = Id.ToString();
            var TermLanguageWithList = new SuTermLanguageCreateGetWithListModel
            {
                TermLanguage = TermLanguage
                ,
                LanguageList = LanguageList
            };

            return(View(TermLanguageWithList));
        }