[C#] 纯文本查看 复制代码 public string AngelwinInput(XmlDocument InputData)
{
System.IO.Directory.CreateDirectory("C:\\Inetpub\\" + "AWlog\\" + System.DateTime.Now.ToString("yyyy-MM-dd"));
InputData.Save("C:\\Inetpub\\" + "AWlog\\" + System.DateTime.Now.ToString("yyyy-MM-dd") + "\\" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ".xml");
DataSet ds = new DataSet();
ds.ReadXml(new XmlTextReader(new StringReader(InputData.OuterXml)));
/////插入基本信息表HisData///
string strOrdRowID;
//医嘱ID
string Cnn_String;
SqlConnection Sql_Cnn = new SqlConnection();
DataRow Row;
strOrdRowID = "";
Cnn_String = System.Configuration.ConfigurationManager.ConnectionStrings("Cnn").ConnectionString;
//Cnn_String = "Server=localhost;uid =sa;pwd=itpschina;database=CMRSIndex"
Sql_Cnn.ConnectionString = Cnn_String;
try {
Sql_Cnn.Open();
SqlDataAdapter sql_Adp = new SqlDataAdapter("select * from SendAppBill", Sql_Cnn);
SqlCommandBuilder sql_Cmd = new SqlCommandBuilder(sql_Adp);
DataSet sql_Ds = new DataSet();
sql_Adp.MissingSchemaAction = MissingSchemaAction.AddWithKey;
sql_Adp.Fill(sql_Ds, "SendAppBill");
foreach (DataRow dr in ds.Tables("SendAppBill").Rows) {
Row = sql_Ds.Tables("SendAppBill").NewRow();
strOrdRowID = Convert.ToString(dr("OrdRowID"));
Row("RegNo") = Convert.ToString(dr("RegNo"));
Row("CardNo") = Convert.ToString(dr("CardNo"));
Row("Name") = Convert.ToString(dr("Name"));
Row("SexCode") = Convert.ToString(dr("SexCode"));
Row("Sex") = Convert.ToString(dr("Sex"));
Row("Age") = Convert.ToString(dr("Age"));
Row("BirthDay") = Convert.ToString(dr("BirthDay"));
Row("Marry") = Convert.ToString(dr("Marry"));
Row("Address") = Convert.ToString(dr("Address"));
Row("Telephone") = Convert.ToString(dr("Telephone"));
Row("CredentialNo") = Convert.ToString(dr("CredentialNo"));
Row("CredentialType") = Convert.ToString(dr("CredentialType"));
Row("NationCode") = Convert.ToString(dr("NationCode"));
Row("Nation") = Convert.ToString(dr("Nation"));
Row("OccupationCode") = Convert.ToString(dr("OccupationCode"));
Row("Occupation") = Convert.ToString(dr("Occupation"));
Row("DocumentID") = Convert.ToString(dr("DocumentID"));
Row("InsuranceNo") = Convert.ToString(dr("InsuranceNo"));
Row("AdmType") = Convert.ToString(dr("AdmType"));
Row("AdmNo") = Convert.ToString(dr("AdmNo"));
Row("AdmSerialNum") = Convert.ToString(dr("AdmSerialNum"));
Row("FeeType") = Convert.ToString(dr("FeeType"));
Row("WardCode") = Convert.ToString(dr("WardCode"));
Row("Ward") = Convert.ToString(dr("Ward"));
Row("RoomCode") = Convert.ToString(dr("RoomCode"));
Row("Room") = Convert.ToString(dr("Room"));
Row("BedNo") = Convert.ToString(dr("BedNo"));
Row("ClinicDiagnose") = Convert.ToString(dr("ClinicDiagnose"));
Row("ClinicDisease") = Convert.ToString(dr("ClinicDisease"));
Row("OperationInfo") = Convert.ToString(dr("OperationInfo"));
Row("OtherInfo") = Convert.ToString(dr("OtherInfo"));
Row("AdmDocRowID") = Convert.ToString(dr("AdmDocRowID"));
Row("AdmDocCode") = Convert.ToString(dr("AdmDocCode"));
Row("AdmDoc") = Convert.ToString(dr("AdmDoc"));
Row("OrdRowID") = Convert.ToString(dr("OrdRowID"));
Row("ArcimCode") = Convert.ToString(dr("ArcimCode"));
Row("OrdName") = Convert.ToString(dr("OrdName"));
Row("OrdPrice") = Convert.ToString(dr("OrdPrice"));
Row("OrdBillStatus") = Convert.ToString(dr("OrdBillStatus"));
Row("OrdPriorityCode") = Convert.ToString(dr("OrdPriorityCode"));
Row("OrdPriority") = Convert.ToString(dr("OrdPriority"));
Row("OrdHospital") = Convert.ToString(dr("OrdHospital"));
Row("OrdHospitalCode") = Convert.ToString(dr("OrdHospitalCode"));
Row("OrdExeHospital") = Convert.ToString(dr("OrdExeHospital"));
Row("OrdExeHospitalCode") = Convert.ToString(dr("OrdExeHospitalCode"));
Row("ARCItemCat") = Convert.ToString(dr("ARCItemCat"));
Row("ARCItemCatCode") = Convert.ToString(dr("ARCItemCatCode"));
Row("OECOrderCategory") = Convert.ToString(dr("OECOrderCategory"));
Row("OECOrderCategory") = Convert.ToString(dr("OECOrderCategory"));
Row("OrdLocCode") = Convert.ToString(dr("OrdLocCode"));
Row("OrdLoc") = Convert.ToString(dr("OrdLoc"));
Row("OrdDoctorCode") = Convert.ToString(dr("OrdDoctorCode"));
Row("OrdDoctor") = Convert.ToString(dr("OrdDoctor"));
Row("OrdDate") = Convert.ToString(dr("OrdDate"));
Row("OrdTime") = Convert.ToString(dr("OrdTime"));
Row("OrdExeLocCode") = Convert.ToString(dr("OrdExeLocCode"));
Row("OrdExeLoc") = Convert.ToString(dr("OrdExeLoc"));
Row("SampleCode") = Convert.ToString(dr("SampleCode"));
Row("SampleName") = Convert.ToString(dr("SampleName"));
Row("SendFlag") = Convert.ToString(dr("SendFlag"));
Row("NoteInfo") = Convert.ToString(dr("NoteInfo"));
Row("Position") = Convert.ToString(dr("Position"));
Row("Purpose") = Convert.ToString(dr("Purpose"));
Row("CurCase") = Convert.ToString(dr("CurCase"));
Row("Destination") = Convert.ToString(dr("Destination"));
Row("AutoFlag") = Convert.ToString(dr("AutoFlag"));
Row("BookDate") = Convert.ToString(dr("BookDate"));
Row("BookTime") = Convert.ToString(dr("BookTime"));
Row("PhyAddress") = Convert.ToString(dr("PhyAddress"));
Row("SpecialMarket") = Convert.ToString(dr("SpecialMarket"));
Row("SpecialPerson") = Convert.ToString(dr("SpecialPerson"));
Row("SpecialDate") = Convert.ToString(dr("SpecialDate"));
Row("StopDocCode") = Convert.ToString(dr("StopDocCode"));
Row("StopDocDesc") = Convert.ToString(dr("StopDocDesc"));
sql_Ds.Tables("SendAppBill").Rows.Add(Row);
sql_Adp.Update(sql_Ds, "SendAppBill");
}
SqlDataAdapter sql_Adp2 = new SqlDataAdapter("select * from BillDetail", Sql_Cnn);
SqlCommandBuilder sql_Cmd2 = new SqlCommandBuilder(sql_Adp2);
DataSet sql_Ds2 = new DataSet();
sql_Adp2.MissingSchemaAction = MissingSchemaAction.AddWithKey;
sql_Adp2.Fill(sql_Ds2, "BillDetail");
foreach (DataRow dr2 in ds.Tables("BillDetail").Rows) {
Row = sql_Ds2.Tables("BillDetail").NewRow();
Row("OrdRowID") = strOrdRowID;
Row("TARIRowid") = Convert.ToString(dr2("TARIRowid"));
Row("TARICode") = Convert.ToString(dr2("TARICode"));
Row("TARIDesc") = Convert.ToString(dr2("TARIDesc"));
Row("UnitPrice") = Convert.ToString(dr2("UnitPrice"));
Row("BillQty") = Convert.ToString(dr2("BillQty"));
Row("Total") = Convert.ToString(dr2("Total"));
Row("BillDate") = Convert.ToString(dr2("BillDate"));
Row("BillTime") = Convert.ToString(dr2("BillTime"));
sql_Ds2.Tables("BillDetail").Rows.Add(Row);
sql_Adp2.Update(sql_Ds2, "BillDetail");
}
Sql_Cnn.Close();
AngelwinInput = "<Response>" + Chr(13);
AngelwinInput = AngelwinInput + "<ResultCode>0</ResultCode>" + Chr(13);
AngelwinInput = AngelwinInput + "<ResultContent>成功</ResultContent>" + Chr(13);
AngelwinInput = AngelwinInput + "</Response>";
return AngelwinInput;
} catch (Exception ex) {
WriteLog("请检查所输入的xml文档完整性!" + ex.Message + ex.StackTrace);
InputData.Save("C:\\Inetpub\\" + "AWlog\\" + System.DateTime.Now.ToString("yyyy-MM-dd") + "\\" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ".xml");
return "请检查所输入的xml文档完整性!" + ex.Message;
}
}
|