public UC_InputColumns(MD_InputModel _model) { InitializeComponent(); InputModel = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _model.NameSpace, _model.ModelName)); InitDataByModel(); }
public MD_InputModel GetInputData() { if (inputModel == null) { inputModel = new MD_InputModel(); } inputModel.DeleteRule = (this.te_DelRule.EditValue == null) ? "" : this.te_DelRule.EditValue.ToString(); inputModel.Descript = (this.te_Descript.EditValue == null) ? "" : this.te_Descript.EditValue.ToString(); inputModel.DisplayName = (this.te_Display.EditValue == null) ? "" : this.te_Display.EditValue.ToString(); inputModel.DWDM = (this.te_DWDM.EditValue == null) ? "" : this.te_DWDM.EditValue.ToString(); inputModel.GetDataGuideLine = (this.te_GetZB.EditValue == null) ? "" : this.te_GetZB.EditValue.ToString(); inputModel.InitGuideLine = (this.te_InitZB.EditValue == null) ? "" : this.te_InitZB.EditValue.ToString(); inputModel.GetNewRecordGuideLine = (this.te_NewZB.EditValue == null) ? "" : this.te_NewZB.EditValue.ToString(); inputModel.DisplayOrder = (this.te_Order.EditValue == null) ? 0 : int.Parse(this.te_Order.EditValue.ToString()); inputModel.ParamterType = (this.te_ParamType.EditValue == null) ? "" : this.te_ParamType.EditValue.ToString(); inputModel.ModelType = (this.te_ModelType.EditValue == null) ? "" : this.te_ModelType.EditValue.ToString(); inputModel.ModelName = (this.te_Name.EditValue == null) ? "" : this.te_Name.EditValue.ToString(); inputModel.IntegretedApplication = (this.te_IntApp.EditValue == null) ? "" : this.te_IntApp.EditValue.ToString(); inputModel.ResourceType = (this.te_ResType.EditValue == null) ? "" : this.te_ResType.EditValue.ToString(); inputModel.AfterWrite = (this.te_afterwrite.EditValue == null) ? "" : this.te_afterwrite.EditValue.ToString(); inputModel.BeforeWrite = (this.te_beforewrite.EditValue == null) ? "" : this.te_beforewrite.EditValue.ToString(); return(inputModel); }
private void bt_AddChild_ItemClick(object sender, ItemClickEventArgs e) { //添加子录入模型 object _selectedObj = FocusedItem; if (_selectedObj is MD_Title) { MD_Title _title = _selectedObj as MD_Title; MD_InputModel _mainModel = _title.FatherObj as MD_InputModel; Dialog_AddChildModel _f = new Dialog_AddChildModel(); if (_f.ShowDialog() == DialogResult.OK) { MD_InputModel _childModel = _f.ChildModel; if (DAConfig.DataAccess.AddChildInputModel(_mainModel.ID, _childModel.ID)) { MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _mainModel.NameSpace, _mainModel.ModelName)); _title.FatherObj = _model; this.treeList1.FocusedNode.Nodes.Clear(); this.treeList1.FocusedNode.HasChildren = true; this.treeList1.FocusedNode.Expanded = false; } } } }
private static List <MD_InputModel_SaveTable> GetWriteDesTableOfInputModel(MD_InputModel _model) { List <MD_InputModel_SaveTable> _ret = new List <MD_InputModel_SaveTable>(); using (SqlConnection cn = SqlHelper.OpenConnection()) { SqlCommand _cmd = new SqlCommand(SQL_GetWriteDesTableOfInputModel, cn); _cmd.Parameters.Add("@IVID", _model.ID); SqlDataReader _dr = _cmd.ExecuteReader(); while (_dr.Read()) { MD_InputModel_SaveTable _tb = new MD_InputModel_SaveTable( _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(), _dr.IsDBNull(1) ? "" : _dr.GetString(1), _dr.IsDBNull(2) ? "" : _dr.GetString(2), _dr.IsDBNull(3) ? true : (_dr.GetDecimal(3) > 0), _model.ID, _dr.IsDBNull(4) ? 0 : Convert.ToInt32(_dr.GetDecimal(4)), _dr.IsDBNull(5) ? "" : _dr.GetString(5) ); GetInputModelSaveTableColumn(_tb); _ret.Add(_tb); } _dr.Close(); } return(_ret); }
private static List <MD_InputModel_ColumnGroup> GetInputColumnGroups(MD_InputModel _model, SqlConnection cn) { List <MD_InputModel_ColumnGroup> _ret = new List <MD_InputModel_ColumnGroup>(); StringBuilder _sb = new StringBuilder(); SqlCommand _cmd = new SqlCommand(SQL_GetInputColumnGroups, cn); _cmd.Parameters.Add("@IVID", _model.ID); SqlDataReader _dr = _cmd.ExecuteReader(); while (_dr.Read()) { MD_InputModel_ColumnGroup _g = new MD_InputModel_ColumnGroup( _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(), _model.ID, _dr.IsDBNull(2) ? "" : _dr.GetString(2), _dr.IsDBNull(3) ? 0 : Convert.ToInt32(_dr.GetDecimal(3)) ); _g.GroupType = _dr.IsDBNull(4) ? "DEFAULT" : _dr.GetString(4).ToUpper(); _g.AppRegUrl = _dr.IsDBNull(5) ? "" : _dr.GetString(5); _g.GroupParam = _dr.IsDBNull(6) ? "" : _dr.GetString(6); _ret.Add(_g); } _dr.Close(); return(_ret); }
private void bt_DelGroup_ItemClick(object sender, ItemClickEventArgs e) { object _selectedObj = FocusedItem; if (_selectedObj is MD_InputModel_ColumnGroup) { MD_InputModel_ColumnGroup _group = _selectedObj as MD_InputModel_ColumnGroup; if (DAConfig.DataAccess.DelInputModelColumnGroup(_group.ModelID, _group.GroupID)) { TreeListNode _pnode = this.treeList1.FocusedNode.ParentNode; _pnode.Nodes.Clear(); MD_Title _title = _pnode.GetValue(this.treeListColumn1) as MD_Title; MD_InputModel _oldModel = _title.FatherObj as MD_InputModel; MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName)); _title.FatherObj = _model; _pnode.HasChildren = true; _pnode.Expanded = false; } else { XtraMessageBox.Show("删除分组失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void barButtonItem9_ItemClick(object sender, ItemClickEventArgs e) { object _selectedObj = FocusedItem; if (_selectedObj is MD_Title) { MD_Title _title = _selectedObj as MD_Title; MD_InputModel _oldModel = _title.FatherObj as MD_InputModel; if (_title.TitleType == "MD_SAVEDEFINE") { Dialog_AddSaveTable _f = new Dialog_AddSaveTable(); if (_f.ShowDialog() == DialogResult.OK) { if (DAConfig.DataAccess.AddNewInputModelSavedTable(_oldModel.ID, _f.TableName)) { MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName)); _title.FatherObj = _model; this.treeList1.FocusedNode.Nodes.Clear(); this.treeList1.FocusedNode.HasChildren = true; this.treeList1.FocusedNode.Expanded = false; } } } } }
public UC_InputModel(string _modelName) { InitializeComponent(); inputModelFullName = _modelName; inputModel = DAConfig.QueryDataAccess.GetInputModelByName(inputModelFullName); InitData(); }
private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e) { object _selectedObj = FocusedItem; if (_selectedObj is MD_Title) { MD_Title _title = _selectedObj as MD_Title; MD_InputModel _oldModel = _title.FatherObj as MD_InputModel; if (_title.TitleType == "MD_INPUTCOLUMES") { MD_InputModel_ColumnGroup _group = MenuController.AddInputGroup(_title.FatherObj as MD_InputModel); if (_group != null) { MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName)); _title.FatherObj = _model; this.treeList1.FocusedNode.Nodes.Clear(); this.treeList1.FocusedNode.HasChildren = true; this.treeList1.FocusedNode.Expanded = false; } else { XtraMessageBox.Show("添加分组失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void LoadInputModelDetial(TreeListNode _fnode, MD_InputModel _model) { MD_Title _title; TreeListNode _node; _fnode.Nodes.Clear(); _title = new MD_Title("录入界面字段定义", "MD_INPUTCOLUMES", _model); _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _title); _node.HasChildren = true; _node.ImageIndex = 5; _node.SelectImageIndex = 0; _title = new MD_Title("写入表定义", "MD_SAVEDEFINE", _model); _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _title); _node.HasChildren = true; _node.ImageIndex = 4; _node.SelectImageIndex = 0; _title = new MD_Title("子记录录入模型", "MD_CHILDDEFINE", _model); _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _title); _node.HasChildren = true; _node.ImageIndex = 6; _node.SelectImageIndex = 0; }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { object _selectedObj = FocusedItem; if (_selectedObj is MD_Namespace) { MD_Namespace _ns = _selectedObj as MD_Namespace; MD_InputModel _model = MenuController.AddInputModel(_ns); if (treeList1.FocusedNode != null && _model != null) { if (treeList1.FocusedNode.Nodes.Count > 0) { TreeListNode _node = treeList1.AppendNode(null, treeList1.FocusedNode); _node.SetValue(this.treeListColumn1, _model); _node.HasChildren = true; _node.ImageIndex = 3; _node.SelectImageIndex = 0; } else { treeList1.FocusedNode.HasChildren = true; } } } }
private void LoadInputModelColumnGroup(TreeListNode _fnode, MD_InputModel _model) { TreeListNode _node; _fnode.Nodes.Clear(); MD_Title _title = new MD_Title("无分组", "MD_INPUTGROUP", _model); _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _title); _node.HasChildren = false; _node.ImageIndex = 7; _node.SelectImageIndex = 0; if (_model.Groups != null) { foreach (MD_InputModel_ColumnGroup _group in _model.Groups) { _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _group); _node.HasChildren = false; _node.ImageIndex = 7; _node.SelectImageIndex = 0; } } }
public UC_InputColumns(MD_InputModel_ColumnGroup _group) { InitializeComponent(); InputGroup = DAConfig.QueryDataAccess.GetInputGroupByID(_group.GroupID); InputModel = DAConfig.QueryDataAccess.GetInputModelByID(_group.ModelID); InitDataByGroup(); }
private void ShowInputModelColumns(MD_InputModel _model) { UC_InputColumns _uc = new UC_InputColumns(_model); _uc.Dock = DockStyle.Fill; this.splitContainerControl1.Panel2.Controls.Add(_uc); CurrentControl = _uc as IMenuControl; }
private void Load_SaveDesTables(TreeListNode _fnode, MD_InputModel _model) { foreach (MD_InputModel_SaveTable _st in _model.WriteTableNames) { TreeListNode _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _st); _node.HasChildren = false; _node.ImageIndex = 4; _node.SelectImageIndex = 0; } }
private void Load_ChildModel(TreeListNode _fnode, MD_InputModel _model) { foreach (MD_InputModel_Child _child in _model.ChildInputModel) { TreeListNode _node = treeList1.AppendNode(null, _fnode); _node.SetValue(this.treeListColumn1, _child); _node.HasChildren = false; _node.ImageIndex = 4; _node.SelectImageIndex = 0; } }
public bool SaveInputModel(MD_InputModel SaveModel) { try { OraMetaDataFactroy _of = new OraMetaDataFactroy(); return(_of.SaveInputModel(SaveModel)); } catch (Exception ex) { throw new FaultException(ex.Message); } }
private void ShowNodeData(TreeListNode _selectedNode) { this.splitContainerControl1.Panel2.Controls.Clear(); CurrentControl = null; if (_selectedNode != null) { object _selectedObj = _selectedNode.GetValue(this.treeListColumn1); if (_selectedObj is MD_Nodes) { } if (_selectedObj is MD_InputModel) { MD_InputModel _model = _selectedObj as MD_InputModel; UC_InputModel _uc = new UC_InputModel(string.Format("{0}.{1}", _model.NameSpace, _model.ModelName)); _uc.Dock = DockStyle.Fill; this.splitContainerControl1.Panel2.Controls.Add(_uc); CurrentControl = _uc as IMenuControl; } if (_selectedObj is MD_InputModel_ColumnGroup) { ShowInputModelColumns(_selectedObj as MD_InputModel_ColumnGroup); } if (_selectedObj is MD_InputModel_SaveTable) { ShowInputModelWriteTableDefine(_selectedObj as MD_InputModel_SaveTable); } if (_selectedObj is MD_InputModel_Child) { ShowInputModelChild(_selectedObj as MD_InputModel_Child); } if (_selectedObj is MD_Title) { MD_Title _title = _selectedObj as MD_Title; switch (_title.TitleType) { case "MD_INPUTGROUP": ShowInputModelColumns(_title.FatherObj as MD_InputModel); break; case "MD_SAVEDEFINE": break; case "MD_CHILDDEFINE": break; } } } }
public bool SaveNewInputModel(string Namespace, MD_InputModel SaveModel) { try { OraMetaDataFactroy _of = new OraMetaDataFactroy(); return(_of.SaveNewInputModel(Namespace, SaveModel)); } catch (Exception ex) { throw new FaultException(ex.Message); } }
public void InitForm(MD_InputModel inputModelDefine, MD_InputEntity entity) { InputModelDefine = inputModelDefine; CurrentEntity = entity; if (InputModelDefine.Groups.Count > 0) { CreateGroupsForm(); } else { CreateSingleForm(); } }
private void ReInit() { if (InputGroup == null) { InputModel = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", InputModel.NameSpace, InputModel.ModelName)); InitDataByModel(); } else { InputGroup = DAConfig.QueryDataAccess.GetInputGroupByID(InputGroup.GroupID); InputModel = DAConfig.QueryDataAccess.GetInputModelByID(InputGroup.ModelID); InitDataByGroup(); } }
public static MD_InputModel GetInputModel(string _namespace, string ModelName) { MD_InputModel _model = null; StringBuilder _sb = new StringBuilder(); _sb.Append(""); _sb.Append(" "); using (SqlConnection cn = SqlHelper.OpenConnection()) { SqlCommand _cmd = new SqlCommand(SQL_GetInputModel, cn); _cmd.Parameters.Add("@NAMESPACE", _namespace); _cmd.Parameters.Add("@IVNAME", ModelName); SqlDataReader _dr = _cmd.ExecuteReader(); while (_dr.Read()) { _model = new MD_InputModel( _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(), _dr.IsDBNull(1) ? "" : _dr.GetString(1), _dr.IsDBNull(2) ? "" : _dr.GetString(2), _dr.IsDBNull(3) ? "" : _dr.GetString(3), _dr.IsDBNull(4) ? "" : _dr.GetString(4), _dr.IsDBNull(5) ? (int)0 : Convert.ToInt32(_dr.GetDecimal(5)), _dr.IsDBNull(6) ? "" : _dr.GetString(6), _dr.IsDBNull(8) ? "" : _dr.GetString(8), _dr.IsDBNull(9) ? "" : _dr.GetString(9), _dr.IsDBNull(10) ? "" : _dr.GetString(10), _dr.IsDBNull(11) ? "" : _dr.GetString(11) ); string _tname = StrUtils.GetMetaByName2("TABLE", _model.Param); string _orderField = StrUtils.GetMetaByName2("ORDER", _model.Param); string _modelType = StrUtils.GetMetaByName2("TYPE", _model.Param); string _paramType = StrUtils.GetMetaByName2("PARAMTYPE", _model.Param); _model.ModelType = (_modelType == "") ? "GRID" : _modelType.ToUpper(); _model.ParamterType = (_paramType == "") ? "OTHER" : _paramType.ToUpper(); _model.InitGuideLine = StrUtils.GetMetaByName2("INITZB", _model.Param); _model.GetDataGuideLine = StrUtils.GetMetaByName2("GETZB", _model.Param); _model.GetNewRecordGuideLine = StrUtils.GetMetaByName2("NEWZB", _model.Param); _model.OrderField = _orderField; _model.TableName = _tname; _model.WriteTableNames = GetWriteDesTableOfInputModel(_model); _model.ChildInputModel = GetChildInputModel(_model); } _dr.Close(); cn.Close(); } return(_model); }
public static List <Assembly> CreateRuleAssemblys(MD_InputModel InputModel) { List <Assembly> _ret = new List <Assembly>(); if (InputModel == null) { return(_ret); } if (InputModel.Groups.Count > 0) { foreach (MD_InputModel_ColumnGroup _group in InputModel.Groups) { foreach (MD_InputModel_Column _column in _group.Columns) { if (_column.InputRule.Trim() != "") { try { _ret.Add(CreateRuleAssembly(_column.ColumnID, _column.InputRule)); } catch (Exception e) { string _errStr = string.Format("创建{1}.{2}的验证规则失败!错误信息:{0}", e.Message, InputModel.ModelFullName, _column.ColumnName); throw new Exception(_errStr); } } } } } else { foreach (MD_InputModel_Column _column in InputModel.Columns) { if (_column.InputRule.Trim() != "") { try { _ret.Add(CreateRuleAssembly(_column.ColumnID, _column.InputRule)); } catch (Exception e) { string _errStr = string.Format("创建{1}.{2}的验证规则失败!错误信息:{0}", e.Message, InputModel.ModelFullName, _column.ColumnName); throw new Exception(_errStr); } } } } return(_ret); }
/// <summary> /// 导入录入模型 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bt_ImportModel_ItemClick(object sender, ItemClickEventArgs e) { object _selectedObj = FocusedItem; if (_selectedObj is MD_Namespace) { MD_Namespace _ns = _selectedObj as MD_Namespace; OpenFileDialog _sf = new OpenFileDialog(); _sf.Filter = "备份文件|*.XML"; _sf.FilterIndex = 1; if (_sf.ShowDialog() == DialogResult.OK) { ImportInputModelController _ic = new ImportInputModelController(_sf.FileName, _ns); try { _ic.Import(); XtraMessageBox.Show("导入成功!", "系统提示"); OraMetaDataFactroy _of = new OraMetaDataFactroy(); MD_InputModel _model = _of.GetInputModel(_ns.NameSpace, _ic.ModelName); if (treeList1.FocusedNode != null && _model != null) { if (treeList1.FocusedNode.Nodes.Count > 0) { TreeListNode _node = treeList1.AppendNode(null, treeList1.FocusedNode); _node.SetValue(this.treeListColumn1, _model); _node.HasChildren = true; _node.ImageIndex = 3; _node.SelectImageIndex = 0; } else { treeList1.FocusedNode.HasChildren = true; } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "导入失败"); } } } }
public void DoSave() { string _msg = ""; if (InputValid(ref _msg)) { MD_InputModel SaveModel = GetInputData(); if (SaveModel != null) { if (DAConfig.DataAccess.SaveInputModel(SaveModel)) { } } } else { XtraMessageBox.Show(_msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void bt_DelInputModel_ItemClick(object sender, ItemClickEventArgs e) { object _selectedObj = FocusedItem; if (_selectedObj is MD_InputModel) { MD_InputModel _model = _selectedObj as MD_InputModel; if (XtraMessageBox.Show(string.Format("是否确定要删除录入模型[{0}.{1}]?", _model.NameSpace, _model.ModelName), "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (DAConfig.DataAccess.DelInputModel(_model.ID)) { XtraMessageBox.Show("删除成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.treeList1.Nodes.Remove(this.treeList1.FocusedNode); } else { XtraMessageBox.Show("删除失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
public static List <MD_InputModel_Child> GetChildInputModel(MD_InputModel _model) { List <MD_InputModel_Child> _ret = new List <MD_InputModel_Child>(); using (SqlConnection cn = SqlHelper.OpenConnection()) { SqlCommand _cmd = new SqlCommand(SQL_GetChildInputModel, cn); _cmd.Parameters.Add("@IVID", _model.ID); SqlDataReader _dr = _cmd.ExecuteReader(); while (_dr.Read()) { string _cns = _dr.IsDBNull(4) ? "" : _dr.GetString(4); string _cname = _dr.IsDBNull(5) ? "" : _dr.GetString(5); string _paramstring = _dr.IsDBNull(3) ? "" : _dr.GetString(3); MD_InputModel_Child _child = new MD_InputModel_Child( _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(), string.Format("{0}.{1}", _model.NameSpace, _model.ModelName), string.Format("{0}.{1}", _cns, _cname), _dr.IsDBNull(6) ? 0 : Convert.ToInt32(_dr.GetDecimal(6)) ); _child.ShowCondition = _dr.IsDBNull(7) ? "" : _dr.GetString(7); _child.SelectMode = _dr.IsDBNull(8) ? 0 : Convert.ToInt16(_dr.GetDecimal(8)); _child.ChildModel = GetInputModel(_cns, _cname); if (_child.Parameters == null) { _child.Parameters = new List <MD_InputModel_ChildParam>(); } foreach (string _pstr in StrUtils.GetMetasByName2("PARAM", _paramstring)) { string[] _s = _pstr.Split(':'); MD_InputModel_ChildParam _p = new MD_InputModel_ChildParam(_s[0], _s[1], _s[2]); _child.Parameters.Add(_p); } _ret.Add(_child); } _dr.Close(); } return(_ret); }
private void LoadChildData(TreeListNode _fnode, object _value) { if (_value is MD_Nodes) { MD_Nodes _nodes = _value as MD_Nodes; LoadNamespaceOfNodes(_fnode, _nodes); } if (_value is MD_Namespace) { MD_Namespace _ns = _value as MD_Namespace; LoadInputViewOfNamespace(_fnode, _ns); } if (_value is MD_InputModel) { MD_InputModel _model = _value as MD_InputModel; LoadInputModelDetial(_fnode, _model); } if (_value is MD_Title) { MD_Title _title = _value as MD_Title; switch (_title.TitleType) { case "MD_INPUTCOLUMES": LoadInputModelColumnGroup(_fnode, _title.FatherObj as MD_InputModel); break; case "MD_SAVEDEFINE": Load_SaveDesTables(_fnode, _title.FatherObj as MD_InputModel); break; case "MD_CHILDDEFINE": Load_ChildModel(_fnode, _title.FatherObj as MD_InputModel); break; } } }
private void simpleButton1_Click(object sender, EventArgs e) { string _msg = ""; if (this.uC_InputModel1.InputValid(ref _msg)) { MD_InputModel SaveModel = this.uC_InputModel1.GetInputData(); if (SaveModel != null) { if (DAConfig.DataAccess.SaveNewInputModel(ns.NameSpace, SaveModel)) { _newModel = DAConfig.DataAccess.GetInputModel(ns.NameSpace, SaveModel.ModelName); } } this.DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show(_msg, "�µ�³�ב�¾", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
public static bool SaveNewInputModel(string _namespace, MD_InputModel SaveModel) { try { using (SqlConnection cn = SqlHelper.OpenConnection()) { SqlCommand _cmd = new SqlCommand(SQL_SaveNewInputModel, cn); _cmd.Parameters.Add("@IV_ID", SequenceAccessor.GetNewId()); _cmd.Parameters.Add("@NAMESPACE", _namespace); _cmd.Parameters.Add("@IV_NAME", SaveModel.ModelName); _cmd.Parameters.Add("@DESCRIPTION", SaveModel.Descript); _cmd.Parameters.Add("@DISPLAYNAME", SaveModel.DisplayName); _cmd.Parameters.Add("@DISPLAYORDER", Convert.ToDecimal(SaveModel.DisplayOrder)); StringBuilder _cs = new StringBuilder(); _cs.Append(string.Format("<TABLE>{0}</TABLE>", SaveModel.TableName)); _cs.Append(string.Format("<ORDER>{0}</ORDER>", SaveModel.OrderField)); _cs.Append(string.Format("<TYPE>{0}</TYPE>", SaveModel.ModelType)); _cs.Append(string.Format("<PARAMTYPE>{0}</PARAMTYPE>", SaveModel.ParamterType)); _cs.Append(string.Format("<INITZB>{0}</INITZB>", SaveModel.InitGuideLine)); _cs.Append(string.Format("<GETZB>{0}</GETZB>", SaveModel.GetDataGuideLine)); _cs.Append(string.Format("<NEWZB>{0}</NEWZB>", SaveModel.GetNewRecordGuideLine)); _cmd.Parameters.Add("@IV_CS", _cs.ToString()); _cmd.Parameters.Add("@DELRULE", SaveModel.DeleteRule); _cmd.Parameters.Add("@DWDM", SaveModel.DWDM); _cmd.ExecuteNonQuery(); } return(true); } catch (Exception e) { LogWriter.WriteSystemLog(e.Message, "ERROR"); return(false); } }