private NetAction AddASubButton(StateButton subButton, IActionDelegate actionDelegate, NetAction action) { if (subButton.Key == string.Empty) { return(null); } NetAction subAction = new NetAction(subButton.Key, subButton.Key == "ViewStyle" ? null : actionDelegate); subAction.Text = subButton.Caption; subAction.IsEnabled = subButton.IsEnable; subAction.IsVisible = subButton.Visible; subAction.ToolTipText = subButton.ToolTip; subAction.Image = subButton.Image; subAction.SetGroup = subButton.SetGroup; subAction.Catalog = subButton.Category; subAction.Style = subButton.ButtonStyle; subAction.IsChecked = subButton.IsChecked; if (subAction.Id == this.ReportViewControl.CurrentID) { subAction.IsChecked = true; } subAction.Tag = action; subButton.VisibleChanged -= new VisibleChangedHandler(StateButtonVisibleChanged); subButton.VisibleChanged += new VisibleChangedHandler(StateButtonVisibleChanged); action.Actions.Add(subAction); return(subAction); }
private void CreateToolBar(UIStateManager manager) { if (manager == null || this.ReportViewControl == null || this.ReportViewControl.Report == null) { int count = this.ReportFormInput.Actions.Count; for (int i = 0; i < count; i++) { NetAction action = this.ReportFormInput.Actions[i] as NetAction; //action.Style = (int)Proxy.UFPortalProxy.ToolButtonSyle.DropDown; //if(action.Id!="Help") // action.IsVisible = false; action.IsEnabled = false; } if (count > 0) { this.ReportFormInput.FireActionsChange(ButtonChangeType.Modify); } return; } this.ReportFormInput.Actions.Clear(); IActionDelegate actionDelegate = new ReportActionDelegate(this.ReportViewControl); foreach (StateButton sb in manager.CurrentState.Buttons) { NetAction action = new NetAction(sb.Key, actionDelegate); action.Text = sb.Caption; action.IsEnabled = sb.IsEnable; action.ToolTipText = sb.ToolTip; action.Image = sb.Image; action.Tag = null; action.Catalog = sb.Category; action.RowSpan = sb.RowSpan; action.ActionType = (sb.Category == "编辑" ? NetAction.NetActionType.Edit : NetAction.NetActionType.Normal); action.Style = sb.ButtonStyle; action.SetGroup = sb.SetGroup; action.IsChecked = sb.IsChecked; action.IsVisible = sb.Visible; sb.Tag = action; sb.VisibleChanged -= new VisibleChangedHandler(StateButtonVisibleChanged); sb.VisibleChanged += new VisibleChangedHandler(StateButtonVisibleChanged); AddSubButtons(sb, actionDelegate, action); this.ReportFormInput.Actions.Add(sb.Key, action); if (!UserToolbarStateManager.ReportActionsState.ContainsKey(this.ReportViewControl.ClientReportContext.GetReportId())) { UserToolbarStateManager.ReportActionsState.Add(this.ReportViewControl.ClientReportContext.GetReportId(), this.ReportFormInput.Actions); } else { UserToolbarStateManager.ReportActionsState[this.ReportViewControl.ClientReportContext.GetReportId()] = this.ReportFormInput.Actions; } } this.ReportFormInput.FormInputExtend.IsSmallButton = manager.CurrentState.Buttons.IsSmallButton; this.ReportFormInput.FireActionsChange(ButtonChangeType.Add); this.ReportFormInput.Text = this.GetObjectName(); (this.ReportEditorPart as NetEditor).Refresh(this.ReportFormInput); this.ReportViewControl.Focus(); }
private void ReportViewControl_RefreshViewsToolbarEvent() { AbstractFormInput.ActionHashtable actions = UserToolbarStateManager.ReportActionsState[this.ReportViewControl.ClientReportContext.GetReportId()]; NetAction viewAcs = actions["View"] as NetAction; viewAcs.Actions.Clear(); StateButtons buttons = UserToolbarStateManager.ReportButtonState[this.ReportViewControl.ClientReportContext.GetReportId()]; StateButton viewSbs = buttons["View"]; IActionDelegate actionDelegate = new ReportActionDelegate(this.ReportViewControl); foreach (StateButton subButton in viewSbs.Buttons) { if (subButton.Key == string.Empty) { return; } NetAction subAction = new NetAction(subButton.Key, subButton.Key == "ViewStyle" ? null : actionDelegate); subAction.Text = subButton.Caption; subAction.IsEnabled = subButton.IsEnable; subAction.IsVisible = subButton.Visible; subAction.ToolTipText = subButton.ToolTip; subAction.Image = subButton.Image; subAction.SetGroup = subButton.SetGroup; subAction.Catalog = subButton.Category; subAction.Style = subButton.ButtonStyle; subAction.IsChecked = subButton.IsChecked; subAction.Tag = subButton; subButton.VisibleChanged -= new VisibleChangedHandler(StateButtonVisibleChanged); subButton.VisibleChanged += new VisibleChangedHandler(StateButtonVisibleChanged); viewAcs.Actions.Add(subAction); } }
private void AddSubButtons(StateButton sb, IActionDelegate actionDelegate, NetAction action) { foreach (StateButton subButton in sb.Buttons) { NetAction subaction = AddASubButton(subButton, actionDelegate, action); AddSubButtons(subButton, actionDelegate, subaction); } }
public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(clsLogin login) { //IActionDelegate nsd = new NetSampleDelegate(); //NetAction ac = new NetAction("about", nsd); //NetAction[] aclist; //aclist = new NetAction[1]; //ac.Text = "关于"; //aclist[0] = ac; NetAction[] aclist; aclist = new NetAction[1]; aclist[0] = null; return(aclist); }
/// <summary> /// 处理过滤的互斥 /// </summary> /// <param name="action"></param> private void HandleFilterstyle(IAction action) { AbstractFormInput.ActionHashtable actions = UserToolbarStateManager.ReportActionsState[this.ReportViewControl.ClientReportContext.GetReportId()]; NetAction filterstyle = actions["filterstyle"] as NetAction; foreach (NetAction ac in filterstyle.Actions) { if (action.Id == ac.Id) { ac.IsChecked = true; continue; } ac.IsChecked = false; } }
private void CheckThisID(IAction action, NetAction parentAction) { action.IsChecked = true; ArrayList pas = parentAction.Actions; for (int i = 0; i < pas.Count; i++) { NetAction na = pas[i] as NetAction; if (na.Id != action.Id && (na.Id == "MergeCell" || na.Id == "Collapse" || na.Id == "Plat")) { na.IsChecked = false; } } this.ReportViewControl.ChangeViewStyle(action.Id); }
/// <summary> /// 处理视图的互斥 /// </summary> /// <param name="action"></param> private void HandleView(IAction action) { AbstractFormInput.ActionHashtable actions = UserToolbarStateManager.ReportActionsState[this.ReportViewControl.ClientReportContext.GetReportId()]; NetAction columnStyle = actions["View"] as NetAction; foreach (NetAction ac in columnStyle.Actions) { if (action.Id == ac.Id) { action.IsChecked = true; continue; } else if (ac.SetGroup == "View") { ac.IsChecked = false; } } }
/// <summary> /// 处理打印情况 /// </summary> /// <param name="action"></param> private void HandlePrint(IAction action) { string reportId = this.ReportViewControl.ClientReportContext.GetReportId(); AbstractFormInput.ActionHashtable actions = UserToolbarStateManager.ReportActionsState[reportId]; string id = action.Id.Substring(7); IAction bSetAction = UserToolbarStateManager.FindActionByKey(reportId, id); string defaultText = "(" + String4Report.GetString("U8.UAP.Report.默认") + ")"; NetAction columnStyle = actions["PrintParent"] as NetAction; foreach (NetAction ac in columnStyle.Actions) { if (ac.Text.Contains(defaultText)) { ac.Text = ac.Text.Replace(defaultText, string.Empty); } } if (bSetAction != null) { bSetAction.Text = bSetAction.Text + defaultText; } IAction setPrintDefault = UserToolbarStateManager.FindActionByKey(reportId, "SetPrintDefault"); if (setPrintDefault != null) { foreach (NetAction ac in ((NetAction)setPrintDefault).Actions) { if (ac.Id != action.Id) { ac.IsChecked = false; } else { ac.IsChecked = true; } } } SetPrintUserUIState(action); }
/// <summary> /// 处理列的互斥 /// </summary> /// <param name="action"></param> private void HandleColumnStyle(IAction action) { AbstractFormInput.ActionHashtable actions = UserToolbarStateManager.ReportActionsState[this.ReportViewControl.ClientReportContext.GetReportId()]; NetAction columnStyle = actions["ColumnStyle"] as NetAction; if (action.Id == ContextMenuMetaAssigner.MenuKeyAlignLeft || action.Id == ContextMenuMetaAssigner.MenuKeyAlignCenter || action.Id == ContextMenuMetaAssigner.MenuKeyAlignRight) { foreach (NetAction ac in columnStyle.Actions) { if (ac.Id == ContextMenuMetaAssigner.MenuKeyAlignLeft || ac.Id == ContextMenuMetaAssigner.MenuKeyAlignCenter || ac.Id == ContextMenuMetaAssigner.MenuKeyAlignRight) { ac.IsChecked = false; } if (action.Id == ac.Id) { action.IsChecked = true; } } } if (action.Id == ContextMenuMetaAssigner.MenuKeyFixCol || action.Id == ContextMenuMetaAssigner.MenuKeyUnFixCol) { foreach (NetAction ac in columnStyle.Actions) { if (ac.Id == ContextMenuMetaAssigner.MenuKeyFixCol || ac.Id == ContextMenuMetaAssigner.MenuKeyUnFixCol) { ac.IsChecked = false; } if (action.Id == ac.Id) { action.IsChecked = true; } } } }
public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login) { IActionDelegate nsd = new NetSampleDelegate(); ////string skey = "mynewcontrol"; NetAction[] aclist; aclist = new NetAction[11]; NetAction ac = new NetAction("query", nsd); //aclist = new NetAction[1]; ac.Text = "查询"; ac.Tag = usercontrol; ac.Image = Properties.Resources.filter; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "查询"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[0] = ac; ac = new NetAction("gengxin", nsd); ac.Text = "新增批记录"; ac.Tag = usercontrol; ac.Image = Properties.Resources.add; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "手动更新"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[1] = ac; ac = new NetAction("daochu", nsd); ac.Text = "日志记录"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Increment; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "重新导入"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; aclist[2] = ac; ac = new NetAction("daoru", nsd); ac.Text = "重新导入U8"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Add_a_row; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "重新导入"; ac.SetGroupRow = 1; ac.RowSpan = 3; ac.IsVisible = false; aclist[3] = ac; ac = new NetAction("del", nsd); //aclist = new NetAction[1]; ac.Text = "标记删除"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Adjust_write_off; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "删行"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; ac.IsVisible = false; aclist[4] = ac; ac = new NetAction("ShenHe", nsd); //aclist = new NetAction[1]; ac.Text = "更新锁定状态"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Approve_all; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "审核"; ac.SetGroupRow = 1; ac.IsVisible = true; ac.RowSpan = 3; ac.IsVisible = false; aclist[5] = ac; ac = new NetAction("Checkall", nsd); //aclist = new NetAction[1]; ac.Text = "全选/全消"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Select_all; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "审核"; ac.SetGroupRow = 1; ac.RowSpan = 3; ac.IsVisible = false; aclist[6] = ac; ac = new NetAction("Excel", nsd); //aclist = new NetAction[1]; ac.Text = "导出Excel"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "查询"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; aclist[7] = ac; ac = new NetAction("PrintMo", nsd); //aclist = new NetAction[1]; ac.Text = "打印"; ac.Tag = usercontrol; ac.Image = Properties.Resources.print; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "打印"; ac.SetGroupRow = 1; ac.RowSpan = 3; ac.IsVisible = false; //ac.IsHaveAuth = true; aclist[8] = ac; ac = new NetAction("savebuju", nsd); //aclist = new NetAction[1]; ac.Text = "保存布局"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; //ac.SetGroup = "保存布局"; //ac.SetGroupRow = 1; //ac.RowSpan = 1; //ac.IsVisible = false; aclist[9] = ac; ac = new NetAction("delbuju", nsd); //aclist = new NetAction[1]; ac.Text = "删除布局"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存布局"; ac.SetGroupRow = 1; ac.RowSpan = 1; aclist[10] = ac; //ac.IsVisible = false; return(aclist); //return null; }
public void InitAction() { NetAction k1 = new NetAction(); k1.cd_time = 30;//每隔10秒执行一次,下载用户列表 k1.cd_start_time = -30; k1.Action = SendDownUserInfo; actions.Add(k1); k1 = new NetAction(); k1.cd_time = 60;//每隔10秒执行一次,下载用户列表 k1.cd_start_time = Time.time-50; k1.Action = SendDownCustomerLastAtTime; actions.Add(k1); //k1 = new NetAction(); //k1.cd_time = 5;//每隔10秒执行一次,下载用户列表 //k1.cd_start_time = Time.time; //k1.Action = SendGPGZSubmit; //actions.Add(k1); //k1 = new NetAction(); //k1.cd_time = 5;//每隔10秒执行一次,下载用户列表 //k1.cd_start_time = Time.time; //k1.Action = SendGPCKSubmit; //actions.Add(k1); }
public bool Authenticate(ICredentialsProvider provider) { log.Info("Authenticating"); if (provider == null) { throw new ArgumentNullException("AuthenticationInfo can not be null in order to authenticate."); } AuthenticationInfo authInfoToUse = null; try { authInfoToUse = provider.GetCredentials(); if (authInfoToUse == null) { throw new InvalidCredentialsException("Credential provider returned null"); } } catch (InvalidCredentialsException ice) { log.Error("Failed to obtain credentials.", ice); return(false); } // save important information lock (this) { this.provider = provider; this.clientAuthInfo = authInfoToUse; this.usingAuth = true; } // build NetMessage string actionId = System.Guid.NewGuid().ToString(); NetAuthentication netAuth = new NetAuthentication(authInfoToUse.Token, authInfoToUse.UserAuthenticationType); if ((authInfoToUse.Roles != null) && (authInfoToUse.Roles.Count != 0)) { netAuth.Roles = authInfoToUse.Roles; } if (authInfoToUse.UserId != null) { netAuth.UserId = authInfoToUse.UserId; } netAuth.ActionId = actionId; NetAction netAction = new NetAction(NetAction.ActionType.AUTH); netAction.AuthenticationMessage = netAuth; NetMessage msg = new NetMessage(netAction); // build waitable object WaitMessageAccepted waitMsgAccepted = new WaitMessageAccepted(); AcceptRequest acceptRequest = new AcceptRequest(actionId, waitMsgAccepted, 7000); //send message HandleOutgoingMessage(msg, acceptRequest); // wait for response lock (waitMsgAccepted.SyncObject) { Monitor.Wait(waitMsgAccepted.SyncObject); } if (waitMsgAccepted.WaitResult != WaitMessageAccepted.Result.Accepted) { log.Error("Authenticatation failed. Reason: " + waitMsgAccepted.WaitResult); return(false); } log.Info("Authenticated"); return(true); }
/// <summary> /// 处理布局按钮的样式 /// </summary> /// <param name="action"></param> private void HandleLayoutStyle(IAction action) { try { StateButtons buttons = UserToolbarStateManager.ReportButtonState[this.ReportViewControl.ClientReportContext.GetReportId()]; StateButton layouts = buttons["Layouts"]; //foreach (StateButton bt in groupAndCross.Buttons) //{ //StateButton Layouts = new StateButton("Layouts", "布局", true, "布局", Properties.Resources.filterFormat, "Layouts"); //StateButton FixFilter = new StateButton("FixFilter", "显示固定条件", true, "显示固定条件", null, "Layouts"); //StateButton QuickFilter = new StateButton("QuickFilter", "显示快捷条件", true, "显示固定条件", null, "Layouts"); //StateButton line1 = new StateButton("line1", "-", true, "", null, "Layouts"); //StateButton OcxShowSchema = new StateButton("OcxShowSchema", "显示查询方案", true, "显示查询方案", null, "Layouts"); //StateButton OcxShowFilter = new StateButton("OcxShowFilter", "显示查询条件", true, "显示查询条件", null, "Layouts"); //StateButton line2 = new StateButton("line2", "-", true, "", null, "Layouts"); //StateButton LeftRightLayout = new StateButton("LeftRightLayout", "左右布局", true, "左右布局", null, "Layouts"); //StateButton TopBottomLayout = new StateButton("TopBottomLayout", "上下布局", true, "上下布局", null, "Layouts"); string reportId = this.ReportViewControl.ClientReportContext.GetReportId(); AbstractFormInput.ActionHashtable actions = UserToolbarStateManager.ReportActionsState[reportId]; NetAction layoutsbuttons = actions["Layouts"] as NetAction; IAction btnFixFilter = UserToolbarStateManager.FindActionByKey(reportId, "FixFilter"); IAction btnQuickFilter = UserToolbarStateManager.FindActionByKey(reportId, "QuickFilter"); IAction btnOcxShowSchema = UserToolbarStateManager.FindActionByKey(reportId, "OcxShowSchema"); IAction btnOcxShowFilter = UserToolbarStateManager.FindActionByKey(reportId, "OcxShowFilter"); IAction btnLeftRightLayout = UserToolbarStateManager.FindActionByKey(reportId, "LeftRightLayout"); IAction btnTopBottomLayout = UserToolbarStateManager.FindActionByKey(reportId, "TopBottomLayout"); //显示固定条件 if (action.Id == "FixFilter") { btnFixFilter.IsChecked = true; btnFixFilter.IsEnabled = true; this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.FilterFlag = FilterType.FixFilter; btnQuickFilter.IsChecked = false; btnQuickFilter.IsEnabled = true; btnOcxShowSchema.IsChecked = false; btnOcxShowSchema.IsEnabled = false; //this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.SolutionVisible = false; btnOcxShowFilter.IsChecked = false; btnOcxShowFilter.IsEnabled = false; //this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.ConditionVisible = false; btnLeftRightLayout.IsChecked = false; btnLeftRightLayout.IsEnabled = false; //this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.QuickFilterLayoutFlag = QuickFilterLayout.LeftRight; btnTopBottomLayout.IsChecked = false; btnTopBottomLayout.IsEnabled = false; } else if (action.Id == "QuickFilter") { btnQuickFilter.IsChecked = true; btnQuickFilter.IsEnabled = true; this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.FilterFlag = FilterType.QuickFilter; btnFixFilter.IsChecked = false; btnFixFilter.IsEnabled = true; btnQuickFilter.IsEnabled = true; btnOcxShowSchema.IsEnabled = true; //默认应该显示一个,现在默认显示solution //btnOcxShowSchema.IsChecked = this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.SolutionVisible; btnOcxShowSchema.IsChecked = true; btnOcxShowFilter.IsEnabled = true; btnOcxShowFilter.IsChecked = this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.ConditionVisible; btnLeftRightLayout.IsEnabled = true; btnTopBottomLayout.IsEnabled = true; if (this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.QuickFilterLayoutFlag == QuickFilterLayout.LeftRight) { btnLeftRightLayout.IsChecked = true; } else { btnTopBottomLayout.IsChecked = true; } if (this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.ConditionVisible == false && this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.SolutionVisible == false) { this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.SolutionVisible = true; } } else if (action.Id == "OcxShowSchema") { this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.SolutionVisible = action.IsChecked; } else if (action.Id == "OcxShowFilter") { this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.ConditionVisible = action.IsChecked; } else if (action.Id == "LeftRightLayout") { btnLeftRightLayout.IsChecked = true; btnTopBottomLayout.IsChecked = false; this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.QuickFilterLayoutFlag = QuickFilterLayout.LeftRight; this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.LayoutIsSetted = true; } else if (action.Id == "TopBottomLayout") { btnTopBottomLayout.IsChecked = true; btnLeftRightLayout.IsChecked = false; this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.QuickFilterLayoutFlag = QuickFilterLayout.TopBottom; this.ReportViewControl.ClientReportContext.ReportUIUserStateInfo.LayoutIsSetted = true; } this.ReportViewControl.HandlerLayout(action.Id, action.IsChecked); } catch (Exception ex) { Logger logger = Logger.GetLogger("ReportFacade"); logger.Error(ex); } }
public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login) { IActionDelegate nsd = new NetSampleDelegate(); ////string skey = "mynewcontrol"; NetAction ac = new NetAction("add", nsd); NetAction[] aclist; aclist = new NetAction[11]; ac.Text = "增行"; ac.Tag = usercontrol; ac.Image = Properties.Resources.add; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "增行"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[0] = ac; ac = new NetAction("del", nsd); //aclist = new NetAction[1]; ac.Text = "删行"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Adjust_write_off; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "删行"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[1] = ac; ac = new NetAction("save", nsd); //aclist = new NetAction[1]; ac.Text = "保存"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Confirm; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[2] = ac; ac = new NetAction("xunjia", nsd); //aclist = new NetAction[1]; ac.Text = "询价"; ac.Tag = usercontrol; ac.Image = Properties.Resources.approval_query; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "询价"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[3] = ac; ac = new NetAction("guanbi", nsd); //aclist = new NetAction[1]; ac.Text = "关闭"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Cancel; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "关闭"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[4] = ac; ac = new NetAction("dakai", nsd); //aclist = new NetAction[1]; ac.Text = "打开"; ac.Tag = usercontrol; ac.Image = Properties.Resources.open; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "打开"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[5] = ac; ac = new NetAction("liancha", nsd); //aclist = new NetAction[1]; ac.Text = "联查询价单"; ac.Tag = usercontrol; ac.Image = Properties.Resources.cost; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "联查询价单"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[6] = ac; //return aclist; ac = new NetAction("query", nsd); //aclist = new NetAction[1]; ac.Text = "查询"; ac.Tag = usercontrol; ac.Image = Properties.Resources.filter; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "查询"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[7] = ac; ac = new NetAction("save2", nsd); //aclist = new NetAction[1]; ac.Text = "报价保存"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Confirm; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "报价保存"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[10] = ac; ac = new NetAction("savebuju", nsd); //aclist = new NetAction[1]; ac.Text = "保存布局"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存布局"; ac.SetGroupRow = 1; ac.RowSpan = 1; aclist[8] = ac; ac = new NetAction("delbuju", nsd); //aclist = new NetAction[1]; ac.Text = "删除布局"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存布局"; ac.SetGroupRow = 1; ac.RowSpan = 1; aclist[9] = ac; return(aclist); ////return null; }
static void Main(string[] args) { NetAction newserver = new NetAction(); newserver.WatchBegin(); }
static void Main(string[] args) { string username, xs; string password, ys; int function; int connect, result = 0; string Result = ""; string data = ""; NetAction newclient = new NetAction(); connect = newclient.Connect(); if (connect == 0) { Console.WriteLine("连接成功"); } Console.WriteLine("请选择要使用的功能:"); Console.WriteLine("1.登陆 2.注册 3.断开连接 4.上传眼球数据流 5.请求文章数据"); while (true) { function = Convert.ToInt32(Console.ReadLine()); switch (function) { case 1: Console.WriteLine("请输入用户名"); username = Console.ReadLine(); Console.WriteLine("请输入密码"); password = Console.ReadLine(); result = newclient.Login(username, password); if (result == -1) { Console.WriteLine("连接出现问题"); } if (result == 0) { Console.WriteLine("登陆成功"); } if (result == 7) { Console.WriteLine("用户名或密码错误!"); } break; case 2: Console.WriteLine("请输入用户名"); username = Console.ReadLine(); Console.WriteLine("请输入密码"); password = Console.ReadLine(); result = newclient.Register(username, password); if (result == -1) { Console.WriteLine("连接出现问题"); } if (result == 0) { Console.WriteLine("注册成功"); } if (result == 7) { Console.WriteLine("数据库出现问题,注册失败,请重试"); } if (result == 8) { Console.WriteLine("用户名已存在,请重新选择用户名注册"); } break; case 3: newclient.DisConnect(); Console.WriteLine("已断开连接,请关闭程序"); Console.ReadKey(); break; case 4: Console.WriteLine("请输入用户名:"); username = Console.ReadLine(); Console.WriteLine("请输入x轴数据"); xs = Console.ReadLine(); Console.WriteLine("请输入y轴数据"); ys = Console.ReadLine(); result = newclient.EyeStream(username, xs, ys); if (result == -1) { Console.WriteLine("连接出现问题"); } if (result == 0) { Console.WriteLine("上传成功"); } if (result == 7) { Console.WriteLine("服务器出现问题,上传失败,请重试"); } break; case 5: Console.WriteLine("请输入文章名:"); data = Console.ReadLine(); Result = newclient.AskFile(data); Console.WriteLine(Result); break; } } }
public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login) { IActionDelegate nsd = new NetSampleDelegate(); ////string skey = "mynewcontrol"; NetAction[] aclist; aclist = new NetAction[12]; NetAction ac = new NetAction("add", nsd); ac.Text = "增行"; ac.Tag = usercontrol; ac.Image = Properties.Resources.add; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "增行"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[0] = ac; ac = new NetAction("del", nsd); //aclist = new NetAction[1]; ac.Text = "删行"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Adjust_write_off; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "删行"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[1] = ac; ac = new NetAction("add", nsd); ac.Text = "批量添加"; ac.Tag = usercontrol; ac.Image = Properties.Resources.add; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "添加"; ac.SetGroupRow = 1; ac.RowSpan = 3; ac.IsVisible = false; aclist[2] = ac; ac = new NetAction("Save", nsd); //aclist = new NetAction[1]; ac.Text = "保存"; ac.Tag = usercontrol; ac.Image = Properties.Resources.save; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[3] = ac; ac = new NetAction("query", nsd); //aclist = new NetAction[1]; ac.Text = "查询"; ac.Tag = usercontrol; ac.Image = Properties.Resources.query; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "查询"; ac.SetGroupRow = 1; ac.RowSpan = 3; aclist[4] = ac; ac = new NetAction("Checkall", nsd); //aclist = new NetAction[1]; ac.Text = "全选/全消"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Select_all; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "审核"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; aclist[5] = ac; ac = new NetAction("ShenHe", nsd); //aclist = new NetAction[1]; ac.Text = "审核"; ac.Tag = usercontrol; ac.Image = Properties.Resources.Cancel; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "审核"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; aclist[6] = ac; ac = new NetAction("QiShen", nsd); //aclist = new NetAction[1]; ac.Text = "弃审"; ac.Tag = usercontrol; ac.Image = Properties.Resources.open; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "弃审"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; aclist[7] = ac; ac = new NetAction("Excel", nsd); //aclist = new NetAction[1]; ac.Text = "导出EXCEL"; ac.Tag = usercontrol; ac.Image = Properties.Resources.transfer; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "查询"; ac.SetGroupRow = 1; ac.RowSpan = 3; //ac.IsVisible = false; aclist[8] = ac; ac = new NetAction("ExcelIn", nsd); //aclist = new NetAction[1]; ac.Text = "导入数据"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "查询"; ac.SetGroupRow = 1; ac.RowSpan = 3; ac.IsVisible = false; aclist[9] = ac; ac = new NetAction("savebuju", nsd); //aclist = new NetAction[1]; ac.Text = "保存布局"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存布局"; ac.SetGroupRow = 1; ac.RowSpan = 1; aclist[10] = ac; ac = new NetAction("delbuju", nsd); //aclist = new NetAction[1]; ac.Text = "删除布局"; ac.Tag = usercontrol; ac.Image = Properties.Resources.import; ac.ActionType = NetAction.NetActionType.Edit; ac.DisplayStyle = 1; ac.Style = 1; ac.SetGroup = "保存布局"; ac.SetGroupRow = 1; ac.RowSpan = 1; aclist[11] = ac; return(aclist); ////return null; }