Пример #1
0
        public virtual bool Create(SysModuleModel model)
        {
            try
            {
                tbl_SysModule entity = m_Rep.GetById(model.Id);
                if (entity != null)
                {
                    return(false);
                }
                entity            = new tbl_SysModule();
                entity.Id         = model.Id;
                entity.ModuleId   = model.ModuleId;
                entity.ModuleName = model.ModuleName;
                entity.ParentId   = model.ParentId;
                entity.ModuleURL  = model.ModuleURL;
                entity.IsShow     = model.IsShow;
                entity.IsLast     = model.IsLast;


                if (m_Rep.Create(entity))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Пример #2
0
        public virtual SysModuleModel GetById(string id)
        {
            if (IsExists(id))
            {
                tbl_SysModule  entity = m_Rep.GetById(id);
                SysModuleModel model  = new SysModuleModel();
                model.Id         = entity.Id;
                model.ModuleId   = entity.ModuleId;
                model.ModuleName = entity.ModuleName;
                model.ParentId   = entity.ParentId;
                model.ModuleURL  = entity.ModuleURL;
                model.IsShow     = entity.IsShow;
                model.IsLast     = entity.IsLast;

                return(model);
            }
            else
            {
                return(null);
            }
        }