예제 #1
0
        public void addData(Medicinedata u)
        {
            string sql = string.Format("INSERT INTO medicinedata (`MedicineId`,`MedicineName`, `Unit`)  VALUES ('"
                                       + u.MId + "','" + u.MName + "','" + u.Unit + "')");

            mycom.executeSQLCUD(sql);
        }
예제 #2
0
        private void InsertNewSingleVitalData(string AID, string name, string data, DateTime time)
        {
            string cmd = "INSERT INTO `dzmd`.`vitalrecord` (`AnesthesiaID`, " +
                         "`VitalSigns`, `VitalTime`, `VitalDetail`) VALUES ('" +
                         AID + "', '" + name + "', '" + time.ToString("yyyy-MM-dd HH:mm:ss") +
                         "', '" + data + "');";

            mycom.executeSQLCUD(cmd);
        }
예제 #3
0
        public void insertMRecord(AnesthesiaMedicineRecord a)
        {
            mycom = new sqlBase();
            //string sql = string.Format("INSERT INTO anesthesiamedicinerecord (`MedicineID`,`Time`, `ActualAmount`, `FlowRate`)  VALUES ('"
            //    + a.MedicineID + "','" + a.Time + "','" + a.ActualAmount + "','" + a.FlowRate + "')");
            string sql = string.Format("INSERT INTO anesthesiamedicinerecord (`MedicineID`,`ActualAmount`,`AnesthesiaType`,`AnesthesiaID`, `StartTime`,`FlowRate`)  VALUES ('"
                                       + a.MedicineID + "','" + a.ActualAmount + "','" + a.AnesthesiaType + "','" + a.AnesthesiaID + "','" + a.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "','" + a.FlowRate + "')");

            mycom.executeSQLCUD(sql);
            mycom.closeConnect();
        }
예제 #4
0
        //設置停止時間
        public void setEndTime(AnesthesiaMedicineRecord a)
        {
            mycom = new sqlBase();

            string sql = "UPDATE anesthesiamedicinerecord SET EndTime = '" + a.EndTime.ToString("yyyy-MM-dd HH:mm:ss") + "' WHERE StartTime = '"
                         + a.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "' AND MedicineID = '" + a.MedicineID + "' AND AnesthesiaID = '" + a.AnesthesiaID + "'";

            Console.WriteLine(sql);
            mycom.executeSQLCUD(sql);
            mycom.closeConnect();
        }
예제 #5
0
        //删除药物记录
        public void deleteByTime(AnesthesiaMedicineRecord a)
        {
            mycom = new sqlBase();
            string sql;

            if (a.AnesthesiaType == 0)
            {
                sql = "DELETE FROM anesthesiamedicinerecord WHERE StartTime = '" + a.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "' AND MedicineID = '"
                      + a.MedicineID + "' AND AnesthesiaID = '" + a.AnesthesiaID + "'";
            }
            else
            {
                sql = "DELETE FROM anesthesiamedicinerecord WHERE StartTime = '" + a.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "' AND MedicineID = '"
                      + a.MedicineID + "' AND AnesthesiaID = '" + a.AnesthesiaID + "' AND ActualAmount = '" + a.ActualAmount + "'";
            }

            mycom.executeSQLCUD(sql);
            mycom.closeConnect();
        }
예제 #6
0
        //修改药物记录
        public void updateByTime(AnesthesiaMedicineRecord a)
        {
            mycom = new sqlBase();
            string sql;

            if (a.AnesthesiaType == 0)
            {
                sql = "UPDATE anesthesiamedicinerecord SET ActualAmount = '" + a.ActualAmount + "' WHERE StartTime = '" + a.StartTime.ToString("yyyy-MM-dd HH:mm:ss")
                      + "' AND MedicineID = '" + a.MedicineID + "' AND AnesthesiaID = '" + a.AnesthesiaID + "'";
            }
            else
            {
                sql = "UPDATE anesthesiamedicinerecord SET ActualAmount = '" + a.ActualAmount + "' , FlowRate = '" + a.FlowRate +
                      "' WHERE StartTime = '" + a.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "' AND MedicineID = '"
                      + a.MedicineID + "' AND AnesthesiaID = '" + a.AnesthesiaID + "'";
            }

            Console.WriteLine(sql);
            mycom.executeSQLCUD(sql);
            mycom.closeConnect();
        }