示例#1
0
        /// <summary>
        /// 转换为OpenXml的WorkBook
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        public static WorkBook ToExcelWorkBook(this SOARole role)
        {
            role.NullCheck("role");

            WorkBook workBook = WorkBook.CreateNew();

            FillFileInfo(workBook, role);

            WorkSheet workSheet = workBook.Sheets[WorkBook.DefaultSheetName];

            workSheet.Name = "Matrix";

            Row titleRow = new Row(1)
            {
                Height = 30d
            };

            titleRow.Style.Fill.SetBackgroundColor(Color.LightGray, ExcelFillStyle.Solid);
            titleRow.Style.Font.Size = 20;
            workSheet.Rows.Add(titleRow);

            workSheet.Cells[titleRow.Index, 1].Value = "角色属性";

            CreateHeaderRow(role, workSheet);

            FillSheetData(role, workSheet);

            return(workBook);
        }
        public void Delete(SOARole role)
        {
            role.NullCheck("role");

            this.Delete(role.ID);
        }
        public void Update(SOARole role)
        {
            role.NullCheck("role");

            Update(role.ID, role.Rows);
        }
        public void Delete(SOARole role)
        {
            role.NullCheck("role");

            this.Delete(role.ID);
        }
        public void Update(SOARole role)
        {
            role.NullCheck("role");

            Update(role.ID, role.Rows);
        }