private SysRelationEntity PrepareFormData()
        {
            ddlModule.SelectedValue.InitValidation("模块编号").NotEmpty();
            ddlFuncPoint.SelectedValue.InitValidation("功能点编号").NotEmpty();

            var entity = new SysRelationEntity();
            entity.ModuleId = ddlModule.SelectedValue;
            entity.FuncPointId = ddlFuncPoint.SelectedValue;
            foreach (ListItem li in cblPermission.Items)
            {
                if (li.Selected) entity.Permissions += li.Value + ",";
            }
            if (string.IsNullOrEmpty(entity.Permissions)) throw new ArgumentException("至少选择一个权限点!");
            entity.Permissions = entity.Permissions.Remove(entity.Permissions.Length - 1);
            return entity;
        }
Esempio n. 2
0
 public void AddNewSysRelation(SysRelationEntity entity)
 {
     entity.Insert();
     SetSysRelationListCache();
 }
Esempio n. 3
0
 public void UpdateSysRelation(SysRelationEntity entity)
 {
     ;
     entity.Update();
     SetSysRelationListCache();
 }
Esempio n. 4
0
 public void DeleteSysRelation(string moduleId, string funcPointId)
 {
     SysRelationEntity entity = new SysRelationEntity() {ModuleId = moduleId, FuncPointId = funcPointId};
     EntityExecution.Delete(entity);
     SetSysRelationListCache();
 }