Ejemplo n.º 1
0
        public ActionResult Create(CommonMenuInfoDTO model)
        {
            try
            {
                var entity = Mapper.Map <CommonMenuInfo>(model);
                entity.Id         = Guid.NewGuid();
                entity.CreateDate = DateTime.Now;
                entity.ModifyDate = null;
                CommonMenuInfoService.Add(entity);

                return(View("jump"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult Edit(CommonMenuInfoDTO model)
        {
            try
            {
                var entity = CommonMenuInfoService.GetModel(model.Id);
                entity.Name = model.Name;
                entity.IsAllowAnonymousAccess = model.IsAllowAnonymousAccess;
                entity.IsEnable   = model.IsEnable;
                entity.Sort       = model.Sort;
                entity.ModifyDate = DateTime.Now;
                CommonMenuInfoService.Modify(entity);

                return(View("jump"));
            }
            catch
            {
                return(View());
            }
        }