Пример #1
0
        public async Task <IActionResult> LanguageDelete(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);

            ViewBag.menuItems = await a.TopMenu(DefaultLanguageID);

            SqlParameter parameter = new SqlParameter("@LId", Id);
            SuClassificationPageLanguageEditGetModel ClassificationPageLanguage = _context.ZdbClassificationPageLanguageEditGet.FromSql("ClassificationPageLanguageEditGet @LId", parameter).First();

            return(View(ClassificationPageLanguage));
        }
        public async Task <IActionResult> LanguageEdit(SuClassificationPageLanguageEditGetModel FromForm)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);

            ViewBag.menuItems = await a.TopMenu(DefaultLanguageID);


            SqlParameter[] parameters =
            {
                new SqlParameter("@LId",              FromForm.LId),
                new SqlParameter("@ModifierId",       CurrentUser.Id),
                new SqlParameter("@Name",             FromForm.Name),
                new SqlParameter("@Description",      FromForm.Description),
                new SqlParameter("@MouseOver",        FromForm.MouseOver),
                new SqlParameter("@MenuName",         FromForm.MenuName),
                new SqlParameter("@TitleName",        FromForm.TitleName),
                new SqlParameter("@titleDescription", FromForm.TitleDescription)
            };

            _context.Database.ExecuteSqlCommand("ClassificationPageSectionLanguageEditPost " +
                                                "@LId" +
                                                ", @ModifierId" +
                                                ", @Name" +
                                                ", @Description" +
                                                ", @MouseOver" +
                                                ", @MenuName" +
                                                ", @TitleName" +
                                                ", @TitleDescription", parameters);
            return(RedirectToAction("LanguageIndex", new { Id = FromForm.OId.ToString() }));
        }