Exemplo n.º 1
0
 /// <summary>
 /// 将传入的成套医嘱对象同步到DataRow中,并保存到数据
 /// </summary>
 /// <param name="serialNo"></param>
 /// <param name="suiteObject"></param>
 public void SynchAndSaveMasterData(decimal serialNo, SuiteOrder suiteObject)
 {
     if (suiteObject == null)
     {
         return;
     }
     DataRow[] matchRows = SuiteMasterTable.Select(ConstSchemaNames.SuiteDetailColSuiteSerialNo + " = " + serialNo);
     if (matchRows.Length == 1)
     {
         //if (String.IsNullOrEmpty(suiteObject.Py))
         {
             // 重新生成拼音、五笔缩写
             string[] shortCodes = m_GenShortCode.GenerateStringShortCode(suiteObject.Name);
             suiteObject.Py = shortCodes[0];
             suiteObject.Wb = shortCodes[1];
         }
         // 同步属性和DataRow的值
         PersistentObjectFactory.SetDataRowValueFromObject(matchRows[0], suiteObject);
         // 将修改同步到数据库中
         m_SqlExecutor.UpdateTable(SuiteMasterTable, ConstSchemaNames.SuiteTableName, false);
         //SuiteMasterTable.AcceptChanges();
     }
     else
     {
         m_MessageBox.MessageShow("成套医嘱数据有错误,请退出程序重新进入!", CustomMessageBoxKind.ErrorOk);
     }
 }
Exemplo n.º 2
0
 private void ResetSelectedSuiteObject(DataRow row)
 {
     if (row == null)
     {
         _selectedSuiteNo     = 0;
         _selectedSuiteObject = null;
     }
     else
     {
         _selectedSuiteNo     = (decimal)row["SuiteID"];
         _selectedSuiteObject = new SuiteOrder(row);
         _selectedSuiteObject.ValueChanged += new EventHandler(DoAfterSelectedRecordValueChanged);
     }
 }