Exemple #1
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)
            };
            SqlParameter parameter = new SqlParameter("@Id", Id);
            SuClassificationValueEditGetModel      ClassificationValueEditGet      = _context.ZdbClassificationValueEditGet.FromSql("ClassificationValueEditGet @LanguageId, @Id", parameters).First();
            SuClassificationValueEditGetLevelModel ClassificationValueEditGetLevel = _context.ZdbClassificationValueEditGetLevel.FromSql("ClassificationValueEditGetLevel @Id", parameter).First();

            ClassificationValueEditGet.DateLevel  = ClassificationValueEditGetLevel.DateLevel;
            ClassificationValueEditGet.InDropDown = ClassificationValueEditGetLevel.InDropDown;

            return(View(ClassificationValueEditGet));
        }
Exemple #2
0
        public async Task <IActionResult> Create(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);


            SuClassificationValueEditGetModel NewValue = new SuClassificationValueEditGetModel
            {
                //ClassificationId
                PId = Convert.ToInt32(HttpContext.Request.Query["CId"]),
                //ParentValueId
                ParentId = Id
            };

            SqlParameter[] parameters =
            {
                new SqlParameter("@ParentId", NewValue.ParentId)
                ,                             new SqlParameter("@PId", NewValue.PId)
            };

            SuClassificationValueEditGetLevelModel ClassificationValueEditGetLevel = _context.ZdbClassificationValueEditGetLevel.FromSql("ClassificationValueCreateGetLevel @ParentId, @PId", parameters).First();

            NewValue.InDropDown = ClassificationValueEditGetLevel.InDropDown;
            NewValue.DateLevel  = ClassificationValueEditGetLevel.DateLevel;


            return(View(NewValue));
        }