private void ImportByOrdID() { using (MetaDataServiceClient _mdc = new MetaDataServiceClient()) { //将所有顶级的指标的父指向当前的指标ID List <MD_GuideLine> _topLevelGuideLine = GetTopLevelGuideLines(); foreach (MD_GuideLine _gl in _topLevelGuideLine) { _gl.FatherID = this.CurrentGuideLine.ID; } decimal _count = Convert.ToDecimal(SelectedGuideLines.Count); decimal i = 0; foreach (MD_GuideLine _gl in this.SelectedGuideLines) { if (_mdc.IsExistGuideLineID(_gl.ID)) { _mdc.SaveGuideLine(_gl); } else { _mdc.SaveNewGuideLine(_gl); } decimal _progress = i / _count * 100; i++; this.backgroundWorker1.ReportProgress(Convert.ToInt32(_progress)); } } }
/// <summary> /// 替换当前指标算法及参数 /// </summary> private void ReplaceParam() { MD_GuideLine _gl = this.SelectedGuideLines[0]; CurrentGuideLine.GuideLineMethod = _gl.GuideLineMethod; CurrentGuideLine.GuideLineMeta = _gl.GuideLineMeta; CurrentGuideLine.GuideLineQueryMethod = _gl.GuideLineQueryMethod; CurrentGuideLine.DetailMeta = _gl.DetailMeta; using (MetaDataServiceClient _mdc = new MetaDataServiceClient()) { _mdc.SaveGuideLine(CurrentGuideLine); } }
private void SaveData() { this._guideLine.GuideLineName = this.TE_Name.EditValue.ToString(); this._guideLine.GuideLineMethod = this.TE_SF.EditValue.ToString(); this._guideLine.DisplayOrder = int.Parse(this.TE_ORDER.EditValue.ToString()); this._guideLine.Description = (this.te_Description.EditValue == null) ? "" : this.te_Description.EditValue.ToString(); this.treeList1.PostEditor(); this.gridView2.PostEditor(); this.gridView3.PostEditor(); _fgList = new List <MD_GuideLineFieldGroup>(); foreach (TreeObj_GuidelLineFieldItem _item in _treeData) { TreeObj_GuideLineFieldGroup _group = _item as TreeObj_GuideLineFieldGroup; MD_GuideLineFieldGroup _fg = _group.GroupData; GetChildData(_fg, _group); _fgList.Add(_fg); } //注:对于老系统的strYN参数的特殊处理 foreach (MD_GuideLineParameter _p in this.gridParameter.DataSource as IList <MD_GuideLineParameter> ) { if (_p.ParameterName == "strYN") { XtraMessageBox.Show("为了与旧系统的兼容需要,参数名称不可以是strYN!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } // ------------------------------------------ this._guideLine.GuideLineMeta = MC_GuideLine.CreateMeta(_fgList, this.gridParameter.DataSource as IList <MD_GuideLineParameter>, this.gridDetail.DataSource as IList <MD_GuideLineDetailDefine>); using (MetaDataServiceClient _mdc = new MetaDataServiceClient()) { if (_mdc.SaveGuideLine(MC_GuideLine.GetGuideLineDefineData(this._guideLine))) { XtraMessageBox.Show("保存成功!"); _haveChange = false; this.RaiseMenuChanged(); } } }