Esempio n. 1
0
        public ActionResult Insert(bool isNav = true)
        {
            var model = new NavNodeUpdateModel()
            {
                IsLayoutNavNode = isNav
            };

            return(PartialView(model));
        }
Esempio n. 2
0
        public async Task <JsonResult> Update(NavNodeUpdateModel model)
        {
            bool   result = false;
            string mesage = string.Empty;

            if (ModelState.IsValid)
            {
                var dto = _mapper.Map <NavNodeDto>(model);
                //dto.Status = CommonValues.NavNode.NavNodeStatus.Public;
                dto.ModifiedBy = User.Identity.Name;
                result         = await this.UpdateAsync(dto);

                if (!result)
                {
                    mesage = "Cập nhật không thành công";
                }
            }
            return(Json(new { status = result, msg = mesage }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public async Task <ActionResult> Update(Guid id)
        {
            var model  = new NavNodeUpdateModel();
            var iquery = await _navNodeService.GetByIdAsync(id);

            if (iquery != null)
            {
                model = new NavNodeUpdateModel
                {
                    Id         = iquery.Id,
                    Name       = iquery.Name,
                    Areas      = iquery.Areas,
                    Controller = iquery.Controller,
                    Action     = iquery.Action,
                    Params     = iquery.Params,
                    ModeAction = CommonValues.Action.Update
                };
                StringBuilder _display = new StringBuilder();
                if (!string.IsNullOrEmpty(iquery.Areas))
                {
                    _display.Append(string.Concat("/", iquery.Areas));
                }
                if (!string.IsNullOrEmpty(iquery.Controller))
                {
                    _display.Append(string.Concat("/", iquery.Controller));
                }
                if (!string.IsNullOrEmpty(iquery.Action))
                {
                    _display.Append(string.Concat("/", iquery.Action));
                }
                if (!string.IsNullOrEmpty(iquery.Params))
                {
                    _display.Append(string.Concat("?", iquery.Params));
                }
                model.Link = _display.ToString();
            }
            return(PartialView(model));
        }