public static PageCommands PageCommandsWith(string pagecode, IPageCommand delegateOwner, bool enable) { PageCommands pageCommands = new PageCommands(); pageCommands.TabCode = pagecode;//页签编码 //新增按钮 XapCommand addCommand = new XapCommand(); addCommand.ImageName = "增加"; addCommand.ToolTip = "增加"; addCommand.Command = "OpDiAddAction"; addCommand.Text = "增加"; addCommand.ExecuteHandler = (sender, e) => { if (delegateOwner != null) { delegateOwner.OnPageCommand(addCommand, e); } }; addCommand.Visible = true; addCommand.Enabled = enable; //删除按钮 XapCommand delCommand = new XapCommand(); delCommand.ImageName = "tab-删除"; delCommand.Text = "删除"; delCommand.ToolTip = "删除"; delCommand.Command = "OpDiDeleteAction"; delCommand.ExecuteHandler = (sender, e) => { if (delegateOwner != null) { delegateOwner.OnPageCommand(delCommand, e); } }; delCommand.Visible = true; delCommand.Enabled = enable; //保存按钮 XapCommand saveCommand = new XapCommand(); saveCommand.ImageName = "保存"; saveCommand.ToolTip = "保存"; saveCommand.Text = "保存"; saveCommand.Command = "OpDiSaveAction"; saveCommand.ExecuteHandler = (sender, e) => { if (delegateOwner != null) { delegateOwner.OnPageCommand(saveCommand, e); } }; saveCommand.Visible = true; saveCommand.Enabled = enable; pageCommands.Commands.AddRange(new XapCommand[] { saveCommand, delCommand, addCommand }); return(pageCommands); }
protected override void ProcessRecord() { base.ProcessRecord(); if (CmdSite == null || CmdPortal == null) { return; } ; WriteVerbose(string.Format("delete-page on {0} portal {1}", CmdSite.Url, CmdPortal.PortalId)); var response = PageCommands.DeletePage(CmdSite, CmdPortal.PortalId, PageId, PageName, ParentId); WriteObject(response); }
protected override void ProcessRecord() { base.ProcessRecord(); if (CmdSite == null || CmdPortal == null) { return; } ; WriteVerbose(string.Format("set-page on {0} portal {1}", CmdSite.Url, CmdPortal.PortalId)); var response = PageCommands.SetPage(CmdSite, CmdPortal.PortalId, PageId, ParentId, PageTitle, PageName, Url, Description, Keywords, Visible); WriteObject(response); }
protected override void ProcessRecord() { base.ProcessRecord(); if (CmdSite == null || CmdPortal == null) { return; } ; WriteVerbose(string.Format("list-pages on {0} portal {1}", CmdSite.Url, CmdPortal.PortalId)); var response = PageCommands.ListPages(CmdSite, CmdPortal.PortalId, ParentId, Deleted, PageName, PageTitle, Path, Skin, Visible, Page, Max); WriteArray(response); }
private void xapFormControl_FormCreated(object sender, EventArgs e) { xapFormControl.SetToilHeight(150); var pageCommands = new PageCommands(); pageCommands.TabCode = "ordlist"; //页签编码"cost";// gv_or = xapFormControl.GetGridView("ordlist"); gv_cost = xapFormControl.GetGridView("cost"); gv_or.DataTable.DataDisplay += tabControl_DataDisplay; gv_cost.ReadOnly = false; gv_or.DataTable.Rows.DefaultHeight = 36; //增加自定义按钮 var pageComds = new PageCommands(); pageComds.TabCode = "cost"; var cmd1 = new XapCommand { Command = "删除", Enabled = false, Visible = false, ExecuteHandler = Ondeletetime, }; pageComds.Commands.Add(cmd1); var cmd = new XapCommand { Command = "新增", Enabled = false, Visible = false, ExecuteHandler = OnAddtime, }; pageComds.Commands.Add(cmd); var cmd2 = new XapCommand { Command = "保存", Enabled = false, Visible = false, ExecuteHandler = OnSavetime, }; pageComds.Commands.Add(cmd2); xapFormControl.SetupCommands(new[] { pageComds }); }
public PageCommands pageCommands1(string pagecode, EventHandler addHandler, EventHandler delHandler, EventHandler printHandler, bool fg_deps) { PageCommands pageCommands = new PageCommands(); pageCommands.TabCode = pagecode;//页签编码 string basePath = Application.StartupPath + "\\res\\Image"; //新增按钮 addCommand = new XapCommand(); //addCommand.NormalImage = Image.FromFile(basePath + "\\Pix256\\common\\增加-1.png"); //addCommand.HoverImage = Image.FromFile(basePath + "\\Pix256\\common\\增加-2.png"); //addCommand.DownImage = Image.FromFile(basePath + "\\Pix256\\common\\增加-3.png"); //addCommand.DisableImage = Image.FromFile(basePath + "\\Pix256\\common\\增加-4.png"); addCommand.ImageName = "增加"; addCommand.ToolTip = "增加"; addCommand.Command = "增加"; //TODO xiaoying 业务处理 addCommand.ExecuteHandler = addHandler; addCommand.Visible = fg_deps; addCommand.Enabled = fg_deps; //删除按钮 delCommand = new XapCommand(); //delCommand.NormalImage = Image.FromFile(basePath + "\\Pix256\\common\\删除-1.png"); //delCommand.HoverImage = Image.FromFile(basePath + "\\Pix256\\common\\删除-2.png"); //delCommand.DownImage = Image.FromFile(basePath + "\\Pix256\\common\\删除-3.png"); //delCommand.DisableImage = Image.FromFile(basePath + "\\Pix256\\common\\删除-4.png"); delCommand.ImageName = "tab-删除"; delCommand.ToolTip = "删除"; delCommand.Command = "移除"; //TODO xiaoying 业务处理 delCommand.ExecuteHandler = delHandler; delCommand.Visible = fg_deps; delCommand.Enabled = fg_deps; //打印按钮 by yzh 2017-08-17 19:42:46 printCommand = new XapCommand(); printCommand.ImageName = "打印床位卡"; printCommand.ToolTip = "打印"; printCommand.Command = "打印"; //业务处理 by yzh 2017-08-17 19:42:40 printCommand.ExecuteHandler = printHandler; printCommand.Visible = fg_deps; printCommand.Enabled = fg_deps; pageCommands.Commands.AddRange(new XapCommand[] { printCommand, addCommand, delCommand }); return(pageCommands); }
private void xapFormControl_FormCreated(object sender, EventArgs e) { gv_cost = xapFormControl.GetGridView(gvcost); gv_cost.ReadOnly = false; //增加自定义按钮 var pageComds = new PageCommands(); pageComds.TabCode = gvcost; var cmd1 = new XapCommand { Command = "删除", Enabled = false, Visible = false, ExecuteHandler = Ondeletetime, }; pageComds.Commands.Add(cmd1); var cmd = new XapCommand { Command = "新增", Enabled = false, Visible = false, ExecuteHandler = OnAddtime, }; pageComds.Commands.Add(cmd); var cmd2 = new XapCommand { Command = "保存", Enabled = false, Visible = false, ExecuteHandler = OnSavetime, }; pageComds.Commands.Add(cmd2); xapFormControl.SetupCommands(new[] { pageComds }); }