void btnExport_ItemClick(object sender, ItemClickEventArgs e) { var role = gridControlEx1.GetFocusedDataSource <t_role>(); if (role == null) { return; } using (var db = new Database()) { var et = db.FirstOrDefault <t_roleset>("select * from t_roleset where RoleId=@0", role.Id); var roletree = Ultra.Web.Core.Common.ObjectHelper.DeSerialize <List <MenuCtlData> >(et.RoleSetTree); foreach (var j in roletree) { j.ModName = j.CtlType == EnCtlType.ToolBarItems ? "主按钮" : (j.CtlType == EnCtlType.Grids ? "网格" : (j.CtlType == EnCtlType.GridCol ? "网格列" : (j.CtlType == EnCtlType.ButtonItems ? "自定义按钮" : "其他"))); j.ModMD5 = j.IsEnabled ? "是" : "否"; } var vw = new PermitViewExport(); vw.gridControlEx1.DataSource = roletree; var fdlg = new SaveFileDialog(); fdlg.Filter = "*.xlsx|*.xlsx"; if (fdlg.ShowDialog() == DialogResult.OK) { vw.gridControlEx1.ExportToXlsx(fdlg.FileName); if (MsgBox.ShowYesNoMessage("导出成功", "导出成功,是否立即打开?") == DialogResult.Yes) { SystemInvoke.OpenFile(fdlg.FileName); } } //Common.GridExportXls(vw.gridControlEx1); } }
void btnExport_ItemClick(object sender, ItemClickEventArgs e) { var role = gridControlEx1.GetFocusedDataSource <t_role>(); if (role == null) { return; } var rolepremts = Db.Fetch <t_rolepermit>(" where RoleId=@0", role.Id); foreach (var j in rolepremts) { j.AsmName = j.CtlType == (int)EnCtlType.ToolBarItems ? "主按钮" : (j.CtlType == (int)EnCtlType.Grids ? "网格" : (j.CtlType == (int)EnCtlType.GridCol ? "网格列" : (j.CtlType == (int)EnCtlType.ButtonItems ? "自定义按钮" : "其他"))); j.AsmMD5 = j.IsEnabled ? "是" : "否"; } var vw = new PermitViewExport(); vw.gridControlEx1.DataSource = rolepremts; var fdlg = new SaveFileDialog(); fdlg.Filter = "*.xlsx|*.xlsx"; if (fdlg.ShowDialog() == DialogResult.OK) { vw.gridControlEx1.ExportToXlsx(fdlg.FileName); if (MsgBox.ShowYesNoMessage("导出成功", "导出成功,是否立即打开?") == DialogResult.Yes) { SystemInvoke.OpenFile(fdlg.FileName); } } }
void btnExport_ItemClick(object sender, ItemClickEventArgs e) { var role = gridControlEx1.GetFocusedDataSource<t_role>(); if (role == null) return; var rolepremts = Db.Fetch<t_rolepermit>(" where RoleId=@0", role.Id); foreach (var j in rolepremts) { j.AsmName = j.CtlType == (int)EnCtlType.ToolBarItems ? "主按钮" : (j.CtlType == (int)EnCtlType.Grids ? "网格" : (j.CtlType == (int)EnCtlType.GridCol ? "网格列" : (j.CtlType == (int)EnCtlType.ButtonItems ? "自定义按钮" : "其他"))); j.AsmMD5 = j.IsEnabled ? "是" : "否"; } var vw = new PermitViewExport(); vw.gridControlEx1.DataSource = rolepremts; var fdlg = new SaveFileDialog(); fdlg.Filter = "*.xlsx|*.xlsx"; if (fdlg.ShowDialog() == DialogResult.OK) { vw.gridControlEx1.ExportToXlsx(fdlg.FileName); if (MsgBox.ShowYesNoMessage("导出成功", "导出成功,是否立即打开?") == DialogResult.Yes) { SystemInvoke.OpenFile(fdlg.FileName); } } }
void btnExport_ItemClick(object sender, ItemClickEventArgs e) { var role = gridControlEx1.GetFocusedDataSource<t_role>(); if (role == null) return; using (var db = new Database()) { var et = db.FirstOrDefault<t_roleset>("select * from t_roleset where RoleId=@0", role.Id); var roletree = Ultra.Web.Core.Common.ObjectHelper.DeSerialize<List<MenuCtlData>>(et.RoleSetTree); foreach (var j in roletree) { j.ModName = j.CtlType == EnCtlType.ToolBarItems ? "主按钮" : (j.CtlType == EnCtlType.Grids ? "网格" : (j.CtlType == EnCtlType.GridCol ? "网格列" : (j.CtlType == EnCtlType.ButtonItems ? "自定义按钮" : "其他"))); j.ModMD5 = j.IsEnabled ? "是" : "否"; } var vw = new PermitViewExport(); vw.gridControlEx1.DataSource = roletree; var fdlg = new SaveFileDialog(); fdlg.Filter = "*.xlsx|*.xlsx"; if (fdlg.ShowDialog() == DialogResult.OK) { vw.gridControlEx1.ExportToXlsx(fdlg.FileName); if (MsgBox.ShowYesNoMessage("导出成功", "导出成功,是否立即打开?") == DialogResult.Yes) { SystemInvoke.OpenFile(fdlg.FileName); } } //Common.GridExportXls(vw.gridControlEx1); } }