/// 初始化配置,传入配置信息类 /// </summary> public virtual void InitializeSettings(DataControlParams controlParams) { ControlParams = controlParams;//先设置属性 InitialDgvMenu();//Dgv右键菜单 InitialDgvDynamicSum();//单元格动态求和 Initial();//其他配置 InitialDgvColumns(ControlParams.ColumnsBandingList );//配置dgv列 }
private void 历史数据预览ToolStripMenuItem_Click(object sender, EventArgs e) { DataControlParams CP = new DataControlParams(LabAssemblyName, typeof(tb_Ssq)); CP.IsEnablePaging = true; CP.IsEnableAddBtn = false; FormModel frm = DotNet.WinForm.Controls.DataManage.CreateForm(CP); frm.MdiParent = this; frm.Show(); }
/// <summary> /// 创建数据管理窗体 /// </summary> /// <param name="controlParams">控件参数</param> /// <returns>数据管理控件的窗体</returns> public static FormModel CreateForm(DataControlParams controlParams) { ZP365DataManage dm = new ZP365DataManage(); dm.InitializeSettings(controlParams); dm.Name = "dm"; dm.Dock = DockStyle.Fill; FormModel tf = new FormModel(); tf.Size = new Size(dm.Width + 15, dm.Size.Height + 40); tf.Controls.Add(dm);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; return tf; }
/// <summary> /// 创建数据管理窗体,需要重新写 /// </summary> /// <param name="controlParams">控件参数</param> /// <returns>数据管理控件的窗体</returns> public static FormModel CreateForm2(DataControlParams controlParams) { //默认的集成不能完成,需要修改生成的主窗体 DataPrediction dm = new DataPrediction(); dm.InitializeSettings(controlParams); dm.Name = "dm"; dm.Dock = DockStyle.Fill; FormModel tf = new FormModel(); tf.Size = new Size(dm.Width + 15, dm.Size.Height + 40); tf.Controls.Add(dm);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle ; return tf; }
private void ed2k链接管理ToolStripMenuItem_Click(object sender, EventArgs e) { DataControlParams CP = new DataControlParams("", typeof(tb_resoucelink)); CP.IsEnableAddBtn = false; CP.IsEnablePaging = true; CP.IsEnableAddBtn = false; CP.PageSize = 50; CP.DeleteColumnsName = new string[] {tb_resoucelink._.FromURL,tb_resoucelink._.ResouceLink , tb_resoucelink._.ResouceMD5,tb_resoucelink._.ClassName }; SetEd2kFormDM(CP);//DotNet.WinForm.Controls.DataManage.CreateForm(CP); FormModel frm = WinFormHelper.GetControlForm(LinkDM, "Ed2k链接管理"); frm.MdiParent = this; frm.Show(); }
private void 指标信息管理ToolStripMenuItem_Click(object sender, EventArgs e) { Dictionary<string, string[]> bandingSource = new Dictionary<string, string[]>(); bandingSource.Add(tb_Rules._.IndexSelectorNameTP, LotTickHelper.GetAllIndexFuncNames()); bandingSource.Add(tb_Rules._.CompareRuleNameTP, LotTickHelper.GetAllEnumNames<ECompareType>()); DataControlParams CP = new DataControlParams(LabAssemblyName, typeof(tb_IndexInfo)); //CP.DeleteColumnsName = new string[] { tb_Rules._.Remark.Description }; CP.IsEnablePaging = false; CP.ColumnsBandingList = bandingSource ; CP.ControlName = "LottAnalysis.GraphForm.AddIndexInfo"; FormModel frm = DotNet.WinForm.Controls.DataManage.CreateForm(CP); frm.Text = "指标信息管理"; frm.MdiParent = this; frm.Show(); }
void SetEd2kFormDM(DataControlParams CP) { string[] menuNames = {"OutPutDownLink"}; string[] dispTexts = {"导出链接" }; EventHandler[] eventNames = {(object sender, EventArgs e)=>{ List<int> Ids = new List<int>(); for (int i = 0; i < LinkDM.dgv.Rows.Count; i++) { Ids.Add(Convert.ToInt32(LinkDM.dgv.Rows[i].Cells[0].Value.ToString())); } VeryCdResouce.ExportLinkToLst("",Ids); MessageBox.Show("导出列表成功!");} }; //默认的集成不能完成,需要修改生成的主窗体 LinkDM.InitializeSettings(CP); LinkDM.Name = "ed2kdm"; LinkDM.Dock = DockStyle.Fill; LinkDM.AppendedMenu = WinFormHelper.GetContextMenuStrip(menuNames, dispTexts, eventNames); }
public static FormModel CreateForm(DataControlParams controlParams) { AddIndexInfo EntityControl = new AddIndexInfo(); EntityControl.InitializeSettings(controlParams); EntityControl.Dock = System.Windows.Forms.DockStyle.Fill; EntityControl.Location = new System.Drawing.Point(0, 0); EntityControl.Name = "AddIndexInfoCtl"; EntityControl.TabIndex = 0; FormModel tf = new FormModel(); tf.Size = new System.Drawing.Size (EntityControl.Width + 15, EntityControl.Size.Height + 40); tf.Controls.Add(EntityControl);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; return tf; }
/// <summary> /// 初始化设置 /// </summary> public void InitializeSettings(DataControlParams controlParams) { this.FormPager.PageSize = 1; this.CutShowMode = controlParams.AddFormShowMode; this.CutSearchCondition = controlParams.AddFormSearchString; if (CutShowMode == FormShowMode.AddOne || CutShowMode == FormShowMode.ContinueAdd) { CustomerSettings(); SetAllTextControls(ControlStatus.Edit); } else { //此记录数可以在加载时固定起来,不用每次都计算 FormPager.RecordCount = tb_Rules.FindCount(CutSearchCondition, "", "", 0, 0); SetAllTextControls(ControlStatus.ReadOnly);//只读 GetData(); BandingData();//绑定数据 } //TODO:问题,只读显示一条记录时,需要传入当前的Model实体类进行绑定 }
/// <summary> /// 设置控件的菜单及相关属性 /// </summary> /// <param name="CP"></param> private void SetFilterDM(DataControlParams CP) { //增加菜单的相关代码, //TODO:增加单独记录的验证功能 string[] menuNames = { "ScanContentPage", "ScanListPage", "AnalysisPageList", "AnalysisPage", "ResetCollectionMark"}; string[] dispTexts = { "扫描内容首页", "扫描列表页面", "分析列表页面", "扫描页面链接","重置错误页面"}; EventHandler[] eventNames ={(object sender, EventArgs e)=>{ Task.Factory.StartNew(() =>{VeryCdResouce.ScanPageContent();});}, (object sender, EventArgs e)=>{ Task.Factory.StartNew(() =>{VeryCdResouce.ScanPageList();});}, (object sender, EventArgs e)=>{ Task.Factory.StartNew(() =>{VeryCdResouce.StartCollectResoucePages();});}, (object sender, EventArgs e)=>{ Task.Factory.StartNew(() =>{VeryCdResouce.StartCollectResouceDownLoadLink();});}, (object sender, EventArgs e)=>{VeryCdResouce.ResetPageCollectionMark ();} }; //默认的集成不能完成,需要修改生成的主窗体 FilterDM.InitializeSettings(CP); FilterDM.Name = "dm"; FilterDM.Dock = DockStyle.Fill; FilterDM.AppendedMenu = WinFormHelper.GetContextMenuStrip(menuNames, dispTexts, eventNames); }
private void 页面管理ToolStripMenuItem_Click(object sender, EventArgs e) { DataControlParams CP = new DataControlParams("", typeof(tb_resoucepageslist)); CP.IsEnableAddBtn = false; CP.IsEnablePaging = true; CP.PageSize = 50; CP.DeleteColumnsName = new string[] {tb_resoucepageslist._.PageURL ,tb_resoucepageslist._.ResouceType, tb_resoucelink._.ClassName }; SetFilterDM(CP);//设置控件 FormModel frm = WinFormHelper.GetControlForm(FilterDM, "资源页面管理");// DotNet.WinForm.Controls.DataManage.CreateForm(CP); frm.MdiParent = this; frm.Show(); }
/// <summary> /// 获取窗体中数据管理控件的配置信息 /// </summary> private static DataControlParams GetFilterControlParams() { Dictionary<string, string[]> bandingSource = new Dictionary<string, string[]>(); bandingSource.Add(tb_Rules._.IndexSelectorNameTP , LotTickHelper.GetAllIndexFuncNames()); bandingSource.Add(tb_Rules._.CompareRuleNameTP, LotTickHelper.GetAllEnumNames<ECompareType>()); DataControlParams CP = new DataControlParams(LabAssemblyName, typeof(tb_Rules)); CP.IsEnablePaging = false; //CP.DeleteColumnsName = new string[] { tb_Rules._.Remark.Description }; CP.ColumnsBandingList = bandingSource; CP.ControlName = "LottAnalysis.GraphForm.AddRules"; //TODO:需要把菜单、名称、都包括进去,省略SetFilterDM方法,直接初始化得到窗体 return CP; }
/// <summary> /// 设置控件的菜单及相关属性 /// </summary> /// <param name="CP"></param> private void SetFilterDM(DataControlParams CP) { //增加菜单的相关代码, //TODO:增加单独记录的验证功能 string[] menuNames = {"ValidateCurrent", "CrossValidate", "Filter", "Remove", "SaveProject" }; string[] dispTexts = { "验证当前","交叉验证", "过滤", "移除记录", "保存方案" }; EventHandler[] eventNames ={ FilterDmHelper .toolStripValidateOneRule, FilterDmHelper.toolStripCrossValidate_Click, FilterDmHelper.toolStripFilter_Click, FilterDmHelper.toolStripRemove_Click, FilterDmHelper.toolStripSaveProject_Click}; //保存方案 //默认的集成不能完成,需要修改生成的主窗体 FilterDM.InitializeSettings(CP); FilterDM.Name = "dm"; FilterDM.Dock = DockStyle.Fill; FilterDM.AppendedMenu = WinFormHelper.GetContextMenuStrip(menuNames, dispTexts, eventNames); }