public void Update_bal(string id, double balance) { DBHelperAccess dBHelperAccess = new DBHelperAccess(startpath); string balanceSQL = "UPDATE 病人信息索引表 SET price=" + balance + " where patient_id = \"" + id + "\""; dBHelperAccess.ExecuteSQLNonquery(balanceSQL); dBHelperAccess.Close(); }
public void Update_gua(string id, string type, string dep, string doc, double balance, string time) { string date = DateTime.Now.ToString("yyyy/MM/dd"); string baseSQL = "INSERT INTO 挂号表 values(\"" + id + "\",\"" + time + "\",#" + date + "#,\"" + doc + "\",\"" + dep + "\",\"" + type + "\")"; DBHelperAccess dBHelperAccess = new DBHelperAccess(startpath); dBHelperAccess.ExecuteSQLNonquery(baseSQL); if (type.Equals("S")) { balance -= 20; } if (type.Equals("N")) { balance -= 5; } string balanceSQL = "UPDATE 病人信息索引表 SET price=" + balance + " where patient_id = \"" + id + "\""; dBHelperAccess.ExecuteSQLNonquery(balanceSQL); dBHelperAccess.Close(); }
public string creatPatient(patient patient) { DBHelperAccess dBHelperAccess = new DBHelperAccess(startpath); Random rad = new Random(); int value = rad.Next(1000, 10000); string cardno = DateTime.Now.ToString("yyyyMMddHHmmss") + value.ToString(); string birthday = patient.Birthday.ToString("yyyy/MM/dd"); string setup = patient.Setup_date.ToString("yyyy/MM/dd"); string baseSQL = "INSERT INTO 病人信息索引表 values(\"" + cardno + "\",\"" + patient.Name + "\",\"" + patient.Gender + "\",#" + birthday + "#,\"" + patient.SSN1 + "\",#" + setup + "#,\"" + 0 + "\",\"" + 0 + "\")"; dBHelperAccess.ExecuteSQLNonquery(baseSQL); dBHelperAccess.Close(); return(cardno); }