protected override void Save() { if (txtCode.Text.Trim().Length == 0) { XtraMessageBox.Show("请输入编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (txtItem.Text.Trim().Length == 0) { if (txtCode.Text.Length == 0) { XtraMessageBox.Show("请输入项目名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { _model = new DJK.Model.admin_MedicalData(); _model.Code = txtCode.Text.Trim(); _model.Item = txtItem.Text.Trim(); _model.ParentID = _parentID; if (txtMin.Text.Trim().Length > 0) { _model.DataMin = int.Parse(txtMin.Text.Trim()); } if (txtMax.Text.Trim().Length > 0) { _model.DataMax = int.Parse(txtMax.Text.Trim()); } if (lookUpFormula.EditValue.ToString().Length > 0) { _model.DataFormula = int.Parse(lookUpFormula.EditValue.ToString()); } CloseForm(); } }
private void CreateNodes(TreeList tl, TreeListNode parentNode, DJK.Model.admin_MedicalData model) { DataRow dr = dtTree.NewRow(); dr["code"] = model.Code; dr["item"] = model.Item; if (model.DataMin != null) { dr["datamin"] = model.DataMin; } if (model.DataMax != null) { dr["datamax"] = model.DataMax; } if (model.DataFormula != null) { dr["dataformula"] = model.DataFormula; } tl.BeginUnboundLoad(); tl.AppendNode(dr, parentNode); tl.EndUnboundLoad(); saveTree(); TreeReload(); tl.LayoutChanged(); }
private void FrmAdd_FormClosing(object sender, FormClosingEventArgs e) { if (_model != null) { if (_model.Code == null) { _model = null; } } }
public FormulaCalculation(List <MatrixParser> mList, List <InfoParser> iList) { dalData = new DJK.DAL.admin_MedicalData(); dalSource = new DJK.DAL.admin_MedicalSource(); dalClarity = new DJK.DAL.admin_Clarity(); modelData = new DJK.Model.admin_MedicalData(); modelSource = new DJK.Model.admin_MedicalSource(); mpList = mList; ipList = iList; }
private void barSubChild_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { this.popupMenu1.HidePopup(); TreeListNode clickedNode = this.treeList1.FocusedNode; string code = clickedNode.GetDisplayText("Code"); string item = clickedNode.GetDisplayText("Item"); int pid = (int)clickedNode[treeList1.ParentFieldName]; int id = (int)clickedNode[treeList1.KeyFieldName]; FrmAdd frmAdd = new FrmAdd(code, pid, id, true); frmAdd.ShowDialog(); DJK.Model.admin_MedicalData _model = frmAdd._model; if (_model != null) { CreateNodes(this.treeList1, clickedNode, _model); } }
public FrmAdd(string code, int pid, int currentID, bool addSub) { InitializeComponent(); ShowButtonRight(new string[] { "Save", "Exit" }); _model = null; dalData = new DJK.DAL.admin_MedicalData(); _code = code; if (addSub) { _parentID = currentID; } else { _parentID = pid; } txtCode.Text = getCode(_parentID, code); initFormula(); }
protected override void Exit() { _model = null; CloseForm(); }