/// <summary> /// 锁定任务 /// </summary> private bool LockResult() { if (this.CurrentTask != null) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { if (_msc.LockQueryTaskResult(this.CurrentTask.TaskID)) { this.gridView1.BeginUpdate(); this.CurrentTask.ResultLocked = true; this.gridView1.EndDataUpdate(); RaiseMenuChanged(); return(true); } else { return(false); } } } else { return(false); } }
/// <summary> /// 取消查询任务 /// </summary> private bool CancelTask() { if (this.CurrentTask != null) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { if (_msc.CancleQueryTask(this.CurrentTask.TaskID)) { XtraMessageBox.Show(string.Format("查询任务\"{0}\"记录已经被取消!", this.CurrentTask.TaskName), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.gridView1.BeginUpdate(); this.CurrentTask.TaskState = 4; this.gridView1.EndDataUpdate(); RaiseMenuChanged(); return(true); } else { return(false); } } } else { return(false); } }
private void ShowTabPages(GuideLineLinkItem _gLine) { string[] _guideLineIDs = _gLine.GuideLineID.Split(','); string[] _guideLineTitles = _gLine.ExtendParams.Split(','); this.xtraTabControl1.TabPages.Clear(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { for (int i = 0; i < _guideLineIDs.Length; i++) { string _title = (_guideLineTitles.Length > i) ? _guideLineTitles[i] : _gLine.Title; XtraTabPage _tp = this.xtraTabControl1.TabPages.Add(); _tp.Text = _title; string _glid = _guideLineIDs[i]; MD_GuideLine _glDefine = _msc.GetGuideLineByID(_glid); _tp.Tag = _glDefine; SinoSZUC_GuideLineQueryResult _qr = new SinoSZUC_GuideLineQueryResult(); _qr.Dock = DockStyle.Fill; _tp.Controls.Add(_qr); if (i == 0) { this.sinoSZUC_GuideLineDynamicInput21.InitForm(_glDefine); this.sinoSZUC_GuideLineDynamicInput21.WriteParamValue(_gLine.Params); } _qr.QueryFinished += new EventHandler(_qr_QueryFinished); _qr.ShowDetailData += new EventHandler(_qr_ShowDetailData); } if (this.xtraTabControl1.TabPages.Count > 0) { this.xtraTabControl1.SelectedTabPageIndex = 0; } } }
private bool ChangeRequestTime() { if (this.CurrentTask != null) { Dialog_ChangeTaskRequestTime _f = new Dialog_ChangeTaskRequestTime(this.CurrentTask.RequestTime); if (_f.ShowDialog() == DialogResult.OK) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { if (_msc.ChangeQueryTaskRequestTime(this.CurrentTask.TaskID, _f.RequestTime)) { XtraMessageBox.Show("任务计划执行时间修改成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshList(); return(true); } else { XtraMessageBox.Show("任务计划执行时间修改失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return(true); } } } return(true); } else { return(false); } return(true); }
void AttachmentDownload_Click(object sender, EventArgs e) { Control _te = sender as Control; string _tagString = (_te.Tag == null) ? "" : _te.Tag.ToString(); string[] _strs = _tagString.Split(','); if (_strs.Length < 3) { XtraMessageBox.Show(string.Format("下载失败!错误的参数信息:{0}", _tagString), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string _indexString = _strs[0]; SaveFileDialog _f = new SaveFileDialog(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _f.FileName = _msc.GetAttachFileName(_indexString, _strs[2]); if (_f.ShowDialog() == DialogResult.OK) { byte[] _fileBytes = _msc.GetAttachFileBytes(_indexString, _strs[1]); if (_fileBytes == null) { XtraMessageBox.Show("下载失败!取得的附件数据为空!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } FileStream stream = File.OpenWrite(_f.FileName); int _count = _fileBytes.Length; stream.Write(_fileBytes, 0, _count); stream.Close(); XtraMessageBox.Show("下载成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } }
private Panel CreatePanel(MDModel_Table _ctable) { Panel _panel = new Panel(); _panel.Height = 0; DataTable _cdt; using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _cdt = _msc.GetChildTableDataByKey(this.QueryModel.FullQueryModelName, _ctable.TableName, this.MainKeyID); } if (_cdt != null) { int i = 1; foreach (DataRow _dr in _cdt.Rows) { SinoSZUC_RecordData _crd = new SinoSZUC_RecordData(_ctable, _dr, i++); _crd.Dock = DockStyle.Top; _panel.Controls.Add(_crd); _crd.BringToFront(); _panel.Height += _crd.Height; } } _panel.Visible = false; _panel.Dock = DockStyle.Top; this.PanelDetail.Controls.Add(_panel); ChildTablePanel.Add(_ctable.TableName, _panel); return(_panel); }
private void SaveQueryCondition() { string _errorMsg = ""; if (!this.sinoSZUC_MD_Model_FieldList1.CheckItems(ref _errorMsg)) { XtraMessageBox.Show(string.Format("选择查询结果不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!this.sinoSZUC_ConditionPanel1.CheckInput(ref _errorMsg)) { XtraMessageBox.Show(string.Format("查询条件不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Dialog_SaveQuery _f = new Dialog_SaveQuery(); if (_f.ShowDialog() == DialogResult.OK) { MC_QueryRequsetFactory _rf = new MC_QueryRequsetFactory(); _rf.QueryModelName = this.QueryModelName; this.sinoSZUC_ConditionPanel1.InsertConditions2QueryRequest(_rf); this.sinoSZUC_MD_Model_FieldList1.InsertResultFields2QueryRequest(_rf); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _msc.SaveQuery(_f.SaveName, _f.IsPublic, _rf.GetQueryRequest()); } } }
private void navBarControl1_LinkClicked(object sender, NavBarLinkEventArgs e) { if (this.sinoSZUC_GuideLineQueryResult1.IsQuerying) { return; } GuideLineLinkItem _gLine = e.Link.Item.Tag as GuideLineLinkItem; this.xtraTabPage1.Text = _gLine.Title; using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { GuideLineDefine = _msc.GetGuideLineByID(_gLine.GuideLineID); } this.sinoSZUC_GuideLineDynamicInput1.InitForm(GuideLineDefine); this.sinoSZUC_GuideLineDynamicInput1.WriteParamValue(_gLine.Params); if (this.sinoSZUC_GuideLineDynamicInput1.ItemCount > 0) { this.xtraTabPage2.PageVisible = true; } else { this.xtraTabPage2.PageVisible = false; } this.xtraTabControl1.SelectedTabPageIndex = 0; if (this.sinoSZUC_GuideLineDynamicInput1.InputFinised) { QueryParameter = this.sinoSZUC_GuideLineDynamicInput1.GetParamters(); this.sinoSZUC_GuideLineQueryResult1.ShowGuideLineResult(GuideLineDefine, QueryParameter); } this.Cursor = Cursors.WaitCursor; }
private void InsertInput() { string _msg = ""; if (CheckInput(ref _msg)) { this.displayName = (this.te_DisplayName.EditValue == null) ? "" : this.te_DisplayName.EditValue.ToString(); this.description = (this.te_Des.EditValue == null) ? "" : this.te_Des.EditValue.ToString(); this.expression = (this.te_exp.EditValue == null) ? "" : this.te_exp.EditValue.ToString(); if (this.checkEdit1.Checked) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _msc.SaveComputeFieldDefine(this.DisplayName, this.Description, this.Expression, this.queryString, this.ResultDataType, this.TableDefine.TableName, this.TableDefine.QueryModelName); } } this.DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show(_msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
private void CreateList() { List <SinoSZUC_FieldTreeItem> _ret = new List <SinoSZUC_FieldTreeItem>(); SinoSZUC_FieldTreeItem _TableItem = new SinoSZUC_FieldTreeItem(TableDefine); _ret.Add(_TableItem); foreach (MDModel_Table_Column _tc in TableDefine.Columns) { if (_tc.ColumnDefine.CanShowAsResult) { SinoSZUC_FieldTreeItem _tcItem = new SinoSZUC_FieldTreeItem(_tc); _ret.Add(_tcItem); } } this.treeList1.BeginUpdate(); this.treeList1.DataSource = _ret; this.treeList1.ExpandAll(); this.treeList1.EndUpdate(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { List <MDQuery_ComputeColumnDefine> _personList = _msc.GetPersonSavedComputField(TableDefine.QueryModelName, TableDefine.TableName).ToList <MDQuery_ComputeColumnDefine>(); this.gridView1.BeginUpdate(); this.sinoCommonGrid1.DataSource = _personList; this.gridView1.EndUpdate(); } }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _ResultTable = _msc.QueryGuideLineByDefault(this._guideLineDefine.ID, this.QueryParameter.ToArray()); } }
private void SendFKInfo() { if (_infoData == null) { return; } if (this.te_FKJG.EditValue != null && this.te_FKJG.EditValue.ToString().Trim() != "") { string _fkjg = this.te_FKJG.EditValue.ToString(); using (MetaDataQueryServiceClient _rsc = new MetaDataQueryServiceClient()) { if (_rsc.SendDataCheckMsgFK(_infoData.ID, _fkjg)) { XtraMessageBox.Show("反馈成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show("反馈失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } else { XtraMessageBox.Show("请选择反馈结果!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
private void InitInfo() { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { DataTable _dt = _msc.GetTaskQueryLog(CurrentTask.TaskID); this.sinoCommonGrid1.DataSource = _dt; } }
private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { ResultData = _msc.GetMainTableDataByKey(this.QueryModel.FullQueryModelName, this.QueryModel.MainTable.TableName, this.MainKeyID); } }
public static List <MD_CheckRule> GetDataCheckRuleDefine(string QueryModelName, bool NeedRefresh) { using (MetaDataQueryServiceClient _sc = new MetaDataQueryServiceClient()) { List <MD_CheckRule> _cr = _sc.GetDataCheckRuleDefine(QueryModelName).ToList <MD_CheckRule>(); return(_cr); } }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { List <MDQuery_Task> _ret = _msc.GetQueryTaskList().ToList <MDQuery_Task>(); e.Result = _ret; } }
public Dialog_QueryModelDescript(string _modelName) { InitializeComponent(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { string _msg = _msc.GetQueryModelDescription(_modelName); this.memoEdit1.EditValue = _msg; } }
private void InitData() { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { DataTable _dt = _msc.GetSaveQueryList(QueryModelName); this.sinoCommonGrid1.DataSource = _dt; ChangeDelButtonState(); } }
private void InitForm() { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _request = _msc.GetQueryTaskRequestContext(_taskDefine.TaskID); this.textEdit1.EditValue = _request.ConditionExpressions; this.sinoSZUC_GridControlEx1.ShowBlankQueryResult(_request); ShowCondition(_request); } }
private void InitForm() { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _taskList = _msc.GetQueryTaskList().ToList <MDQuery_Task>(); } this.sinoCommonGrid1.DataSource = _taskList; _initFinished = true; this.timer1.Enabled = true; }
private void ShowData() { DataTable _cdt; using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _cdt = _msc.GetChildTableDataByKey(this.QueryModel.FullQueryModelName, TabelDefine.TableName, this.MainKeyID); } foreach (MDModel_Table_Column _tc in TabelDefine.Columns) { if (_tc.CanDisplay && _tc.CanResultShow) { GridColumn _gc = this.gridView1.Columns.Add(); _gc.Caption = _tc.ColumnTitle; _gc.FieldName = _tc.ColumnAlias; _gc.OptionsColumn.AllowFocus = true; _gc.OptionsColumn.AllowGroup = DefaultBoolean.True; _gc.OptionsColumn.AllowIncrementalSearch = true; _gc.OptionsColumn.AllowMerge = DefaultBoolean.True; _gc.OptionsColumn.AllowMove = true; _gc.OptionsColumn.AllowSize = true; _gc.OptionsColumn.AllowSort = DefaultBoolean.True; _gc.OptionsColumn.ReadOnly = true; _gc.OptionsColumn.ShowCaption = true; _gc.OptionsColumn.ShowInCustomizationForm = true; if (_tc.ColumnDefine.TableColumn.DisplayFormat == "") { if (_tc.ColumnDataType == "DATE") { _gc.DisplayFormat.FormatType = FormatType.DateTime; _gc.DisplayFormat.FormatString = "yyyy-MM-dd"; } } else { if (_tc.ColumnDataType == "DATE") { _gc.DisplayFormat.FormatType = FormatType.DateTime; } _gc.DisplayFormat.FormatString = _tc.ColumnDefine.TableColumn.DisplayFormat; } _gc.Width = (_tc.ColumnDefine.TableColumn.DisplayLength + _tc.ColumnDefine.TableColumn.DisplayHeight) * 80; _gc.VisibleIndex = gridView1.Columns.Count; } } this.sinoCommonGrid1.DataSource = _cdt; //this.gridView1.BestFitColumns(); ShowDetailData(); this._initFinished = true; }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { string _fname = ""; QueryModel = MetaDataCache.GetQueryModelDefine(compareRequest.QueryModelName); //处理比对数据表 srcData = new DataTable(); foreach (DataColumn _dc in compareRequest.ExcelData.Columns) { if (_dc.ColumnName == "XH") { _fname = "XH"; } else { ExcelColumnAlias _alias = ExcelColumns[_dc.ColumnName]; _fname = _alias.Alias; } srcData.Columns.Add(_fname, _dc.DataType); } foreach (DataRow _dr in compareRequest.ExcelData.Rows) { DataRow _newrow = srcData.NewRow(); foreach (DataColumn _dc in compareRequest.ExcelData.Columns) { if (_dc.ColumnName == "XH") { _fname = "XH"; } else { ExcelColumnAlias _alias = ExcelColumns[_dc.ColumnName]; _fname = _alias.Alias; } _newrow[_fname] = _dr[_dc.ColumnName]; } srcData.Rows.Add(_newrow); } //调用比对服务 using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { CompareResult = _msc.CompareData(compareRequest, srcData); } //建立关系 MC_QueryModel.CreateDataRelation(this.QueryModel, CompareResult); DataTable _mtable = CompareResult.Tables[QueryModel.MainTable.TableName]; DataTable _ctable = CompareResult.Tables["EXCELRESULTDATA"]; CompareResult.Relations.Add("比对的EXCEL文件", _mtable.Columns["MAINID"], _ctable.Columns["MAINID"]); }
public frmGuideLineQueryWithoutInput(string _title, string _guideLineID, string _params, bool _canGroup) { InitializeComponent(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { GuideLineDefine = _msc.GetGuideLineByID(_guideLineID); } QueryParameter = MC_GuideLine.CreateQueryParameter(GuideLineDefine, _params); this.sinoSZUC_GuideLineQueryResult1.CanGrouped = _canGroup; this.Text = _title; _initFinished = true; }
private void QueryByModel() { if (this.QueryRequest != null) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { QueryResultData = _msc.QueryData(this.QueryRequest); } //多表关联处理 MC_QueryModel.CreateDataRelation(this.QueryModel, QueryResultData); } }
public frmSinoSZ_DataDetail(MDSearch_ResultDataIndex _searchResutIndex) { InitializeComponent(); QueryModel = MetaDataCache.GetQueryModelDefine(_searchResutIndex.SourceColumn.QueryModel.FullName); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { MainKeyID = _msc.GetMainTableKeyByChildKey(_searchResutIndex.SourceColumn, _searchResutIndex.MainKey); } this.Text = string.Format("{0}的详细信息", QueryModel.DisplayName); SearchResutIndex = _searchResutIndex; ShowKKPanel(); }
public static MDModel_QueryModel GetQueryModelDefine(string QueryModelName) { if (!QueryModelLib.ContainsKey(QueryModelName)) { using (MetaDataQueryServiceClient _sc = new MetaDataQueryServiceClient()) { MD_QueryModel _qv = _sc.GetMDQueryModelDefine(QueryModelName); QueryModelLib.Add(QueryModelName, MC_QueryModel.CreateQuery_ModelDefine(_qv)); } } return(QueryModelLib[QueryModelName]); }
private void LoadChildGuideLine(MD_GuideLine _fgl, TreeListNode _fnode) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { List<MD_GuideLine> _rootGuideLineList = _msc.GetGuideLineListByFatherID(_fgl.ID).ToList<MD_GuideLine>(); foreach (MD_GuideLine _gl in _rootGuideLineList) { TreeListNode _newnode = treeList1.AppendNode(null, _fnode); _newnode.SetValue(this.treeListColumn1, _gl); _newnode.HasChildren = true; } } }
protected override void QueryData(SinoSZPluginFramework.IApplication _application) { if (_application == null) { return; } string _errorMsg = ""; if (!this.sinoSZUC_MD_Model_FieldList1.CheckItems(ref _errorMsg)) { XtraMessageBox.Show(string.Format("选择查询结果不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!this.sinoSZUC_ConditionPanel1.CheckInput(ref _errorMsg)) { XtraMessageBox.Show(string.Format("查询条件不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } MC_QueryRequsetFactory _rf = new MC_QueryRequsetFactory(); _rf.QueryModelName = this.QueryModelName; this.sinoSZUC_ConditionPanel1.InsertConditions2QueryRequest(_rf); this.sinoSZUC_MD_Model_FieldList1.InsertResultFields2QueryRequest(_rf); MDQuery_Request _queryRequest = _rf.GetQueryRequest(); if (_queryRequest.MainResultTable.Columns.Count < 1) { XtraMessageBox.Show("主表必须至少选择一个结果字段!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Dialog_TaskInfo _f = new Dialog_TaskInfo(); if (_f.ShowDialog() == DialogResult.OK) { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { string _taskid = _msc.AddNewQueryTask(_f.Task_Name, _queryRequest); if (_taskid != "") { XtraMessageBox.Show("此查询请求已经添加到查询任务中!请稍后在查询任务列表中查看查询结果!"); this.Close(); } else { XtraMessageBox.Show("添加到查询任务失败!"); } } } }
private void InitGuideLineTree() { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { List<MD_GuideLine> _rootGuideLineList = _msc.GetRootGuideLineList(rootGuideLines).ToList<MD_GuideLine>(); foreach (MD_GuideLine _gl in _rootGuideLineList) { TreeListNode _newnode = treeList1.AppendNode(null, null); _newnode.SetValue(this.treeListColumn1, _gl); LoadChildGuideLine(_gl, _newnode); _newnode.Expanded = true; } } }
private void InitModels() { using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { QueryModelList = _msc.GetQueryModels(QueryModels).ToList <MD_QueryModel>(); } foreach (MD_QueryModel _qm in QueryModelList) { TreeListNode _node = this.treeList1.AppendNode(null, null); _node.Tag = _qm; _node.SetValue("COLUMN1", _qm); _node.SetValue("State", 1); } }