示例#1
0
        public async Task <IActionResult> Edit(SuContentTypeClassificationEditGetModelWithListModel 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("@Id",       FromForm.Classification.Id),
                new SqlParameter("@StatusId", FromForm.Classification.StatusId)
            };
            _context.Database.ExecuteSqlCommand("ContentTypeClassificationEditPost " +
                                                "@Id" +
                                                ", @StatusID", parameters);

            return(RedirectToAction("Index", new { Id = FromForm.Classification.ContentTypeId }));
        }
示例#2
0
        public async Task <IActionResult> Edit(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[] parameters =
            {
                new SqlParameter("@LanguageId", CurrentUser.DefaultLanguageId)
                ,                               new SqlParameter("@Id", Id)
            };

            var parameter = new SqlParameter("@LanguageId", CurrentUser.DefaultLanguageId);

            var ContentTypeClassificationEditGet           = _context.ZdbContentTypeClassificationEditGet.FromSql("ContentTypeClassificationEditGet @LanguageId, @Id", parameters).First();
            var ContentTypeClassificationEditGetStatusList = _context.ZdbContentTypeClassificationEditGetStatusList.FromSql("ContentTypeClassificationEditGetStatusList @LanguageId", parameter).ToList();
            var TypeClassList = new List <SelectListItem>();

            foreach (var ContentTypeClassificationEditGetStatus in ContentTypeClassificationEditGetStatusList)
            {
                TypeClassList.Add(new SelectListItem
                {
                    Text  = ContentTypeClassificationEditGetStatus.Name,
                    Value = ContentTypeClassificationEditGetStatus.Id.ToString()
                });
            }
            SuContentTypeClassificationEditGetModelWithListModel ContentTypeClassificationWithList = new SuContentTypeClassificationEditGetModelWithListModel
            {
                Classification = ContentTypeClassificationEditGet,
                StatusList     = TypeClassList
            };

            return(View(ContentTypeClassificationWithList));
        }