Exemplo n.º 1
0
        /// <summary>
        /// 通过药品注册码获取药品信息
        /// </summary>
        /// <returns>药品检测信息</returns>
        public DrugInfo GetDrugInfoFromLicense(string licenseCode)
        {
            try
            {
                List <DrugInfo> drugs = new List <DrugInfo>();

                string          sqlstr          = "select * from " + DBTableName[(int)TDBableType.DRUG] + " where passBatch='" + licenseCode + "'";
                OleDbCommand    myAccessCommand = new OleDbCommand(sqlstr, myAccessConn);
                OleDbDataReader myDataReader    = myAccessCommand.ExecuteReader();

                DrugInfo retDrugInfo = null;
                if (myDataReader.Read())
                {
                    retDrugInfo = new DrugInfo();
                    retDrugInfo.chemicalName   = GetData <string>(myDataReader, "phyName");
                    retDrugInfo.commercialName = GetData <string>(myDataReader, "tradeCName");
                    retDrugInfo.productUnit    = GetData <string>(myDataReader, "nowProUnit");
                    retDrugInfo.form           = GetData <string>(myDataReader, "doseType");
                    retDrugInfo.specification  = GetData <string>(myDataReader, "Specs");
                    retDrugInfo.licenseCode    = GetData <string>(myDataReader, "passBatch");
                }
                myDataReader.Close();

                return(retDrugInfo);
            }
            catch (Exception ex)
            {
                ErrorString = ex.Message;
                return(null);
            }
        }
Exemplo n.º 2
0
 public ModelInfo(DrugInfo drug)
 {
     thresold      = 0.97;
     licenseCode   = drug.licenseCode;
     productUnit   = drug.productUnit;
     form          = drug.form;
     specification = drug.specification;
     chemicalName  = drug.chemicalName;
     thisObject    = this;
     files         = new ObservableCollection <Ai.Hong.CommonLibrary.spectrumDisplayInfo>();
     regions       = new ObservableCollection <region>();
 }
Exemplo n.º 3
0
        public bool UpdateDrugInfo(DrugInfo drugInfo)
        {
            string sqlstr = "update " + DBTableName[(int)TDBableType.DRUG] + " set ";

            sqlstr += " phyName='" + drugInfo.chemicalName + "',";
            sqlstr += " nowProUnit='" + drugInfo.productUnit + "',";
            sqlstr += " doseType='" + drugInfo.form + "',";
            sqlstr += " Specs='" + drugInfo.specification;
            sqlstr += " passBatch='" + drugInfo.licenseCode + "'";

            if (ExcuteSqlCommand(sqlstr) == false)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 新增药品检测信息
        /// </summary>
        /// <param name="drugInfo">药品检测信息</param>
        /// <returns>操作结果</returns>
        public bool InsertDrugInfo(DrugInfo drugInfo)
        {
            string sqlstr = "insert into " + DBTableName[(int)TDBableType.DRUG];

            sqlstr += "(phyName, nowProUnit, doseType, Specs, packSpecs, passBatch) values(";
            sqlstr += "'" + drugInfo.chemicalName + "',";
            sqlstr += "'" + drugInfo.productUnit + "',";
            sqlstr += "'" + drugInfo.form + "',";
            sqlstr += "'" + drugInfo.specification + "',";
            sqlstr += "'" + drugInfo.licenseCode + "')";

            if (ExcuteSqlCommand(sqlstr) == false)
            {
                return(false);
            }

            return(true);
        }