Update multiple tables at the same time ............

xiaoxiao2021-03-06  111

/// //Form1.csusing System for multi-table updates; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Data.SqlClient; using System.Reflection.Emit; using System.Reflection; namespace WindowsApplication1 {public struct refTab {private string tabName; private string tabKey; public string tabName {get {return this.tabName;}} public string tabKey {get {return this.tabKey; }

Public Reftab (String Tab, String ZD) {this.tabname = Tab; this.tabkey = zd;}} ///

/// Form1 summary. /// public class form1: system.windows.forms.form {#Region variable definition /// /// Connect to source database SQLCONNECTION /// private SqlConnection SqlConnection1; Private SqlConnection Dstcnn; Private System.Windows.Forms.DataGrid DataGrid1; /// /// Source Database Generating Data Set --- Source Data Set /// Private Dataset SrcDataSet = NULL; /// < Summary> /// After the first sorted source data set /// private dataset dstdatan = null; /// /// Data set and source data set in the target database (DstdataSet) the final data set after integration /// private dataSet endDataset = null; private System.Collections.Hashtable hshTab = new Hashtable (); private Hashtable hshTabSrc = new Hashtable (); private Hashtable hstTabVal = new Hashtable (); private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private bool complete = false; // has completed analysis of private ResultForm fs = null; // View Analysis Results Private Bool ISOK = FALSE; // Analysis is the correct /// /// The required designer variable. /// private system.componentmodel.container components = null; #ENDREGion #Region Data Adapter Variable Definition /// /// Disease Features Database Adapter /////// private sqldataadapter da_bcdtzdk;

///

/// patient database adapter /// private sqldataadapter da_brzlk; /// /// pathogenation inducement dictionary library adapter /// private sqldataadapter Da_fbyyzd; / // /// episoded class dictionary library adapter /// private sqldataadapter Da_fzlbzdk; /// /// Criminal penalty dictionary library adapter /// private sqldataadapter Da_FZCFLBZDK; /// /// functional influence Database Adapter /// private sqldataadapter da_glyxzdk; /// /// private sqldataadapter da_fyzdk; / // /// family history word library adapter /// private sqldataadapter da_jzszd; /// /// Education category Database adapter /// private sqldataadapter Da_Jylbzdk; / // /// Education topic directory adapter /// private SqlDataAdapter Da_JYZTMLK; /// /// Education Special Submmary> Private SqlDataAdapter Da_JYZTZMLK; /// /// Economic status Dictionary library adapter /// private sqldataadapter da_jzkzdk; /// /// Help Dictionary Database Adapter /// private sqldataadapter Da_qzfszdk; /// /// follow-up log information library adapter /// private sqldataadapter da_sfjlxxxk; /// /// 同 病 字 库 库器 适器 /// private sqldataadapter Da_TFBZDK; // / /// Culture Dictionary Database Adapter /// Private SqlDataAdapter Da_WHCDZDK; /// /// Physical Therapy Information Library Adapter /// private SqldataAdapter Da_WLZLXXK; // / /// Psychotherapy information library adapter /// private SqldataAdapter Da_XLZLXXK; /// /// character dictionary library adapter /// private sqldataadapter Da_XGZDK; ///

/// Drug Treatment Information Library Adapter /// Private SqldataAdapter Da_ywzlxxk; ///

/// Hospital Information Library Adapter /// private SqldataAdapter Da_YXXXK; /// / // Diagnostic Database Adapter /// private sqldataadapter Da_ZDZDK; /// /// 职 职 字 职 库器 适器 /// private sqldataadapter da_zyzdk; /// ///// Treatment Class Dictionary library /// private sqldataadapter da_zldlzdk; /// /// The treatment category Database adapter /// private sqldataadapter da_zllbzdk; /// ///// Treatment history library adapter /// private sqldataadapter da_zlsk; /// /// 治疗 治疗 专 目 库器 适器 /// private sqldataadapter da_zlztmlk; /// ///// Special Brand Library Adapter /// Private SqldataAdapter Da_zlztzmlk; /// /// Treatment Topic Database Adapter /// private SqldataAdapter Da_ZLZTZDK; /// //////// Hospital recording library adapter /// private sqldataadapter Da_zyjlk; /// /// suicide or attack Database adapter /// private sqldataadapter da_zsgjzdk; /// /////////// Self-knowledge dictionary library /// private sqldataadapter da_zzlzdk; #endregion

Public Form1 () {// // Windows Form Designer Support for // InitializeComponent ();

// // Todo: Add any constructor code after INITIALIZEComponent call //}

///

/// Clean all the resources being used. /// Protected Override Void Dispose (Bool Disposing) {if (disponents! = Null) {components.dispose ();}} Base.Dispose

#REGION Windows Form Designer The code ///

/// designer supports the required method - do not use the code editor to modify the // / this method.

/// private void InitializeComponent () {this.sqlConnection1 = new System.Data.SqlClient.SqlConnection (); this.dataGrid1 = new System.Windows.Forms.DataGrid (); this.button1 = new System. Windows.Forms.Button (); this.button2 = new System.Windows.Forms.Button (); this.button3 = new System.Windows.Forms.Button (); ((System.ComponentModel.ISupportInitialize) (this.dataGrid1 ))). Begininit (); this.suspendlayout (); // // DataGrid1 // this.dataGrid1.captiontext = "source data"; this.dataGrid1.datamember = ""; this.dataGrid1.dock = system.windows .Forms.DockStyle.Left; this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Location = new System.Drawing.Point (0, 0); this.dataGrid1.Name = "dataGrid1"; this .datagrid1.readonly = true; this.dataGrid1.size = new system.drawing.size (624, 277); this.dataGrid1.tabindex = 0; /// button1 // this.button1.anchor = ((System). Windows.Forms.Anchorstyles) (((System.Windows.Forms. AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.Location = New system.drawing.point (624, 32); this.Button1.name = "button1"; this.button1.size = new system.drawing.size (40, 48); this.button1.tabindex = 1; this. Button1.text = "Analyze Data Format"; this.Button1.Click = New System.EventHandler (this.Button1_Click_1); // // Button2 // this.button2.anchor =

((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows. Forms.anchorstyles.right)))))))); this.button2.flatstyle = system.windows.Forms.Flatstyle.Flat; this.button2.location = new system.drawing.point (624, 104); this.button2.name = " Button2 "; this.button2.size = new system.drawing.size (40, 48); this.button2.tabindex = 2; this.button2.text =" View Analysis Results "; this.button2.click = new System . EventHandler (this.button2_click_1); /// button3 // this.button3.ancy = ((System.Windows.Forms.Anchorstyles) ((System.Windows.Forms.Anchorstyles.Bottom | System.Windows.forms. AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button3.Location = new System.Drawing.Point (624, 192 This.button3.name = "button3"; this.button3.size = new system.drawing.size (40, 48); This.Button3.Tabindex = 3; this.button3.text = "Execute Import Action"; this.Button3.Click = new system.EventHandler (this.button3_click; // // form1 // this.autoscalebasesize = new system .Drawing.size (6, 14); this.clientsize = new system.drawing.size (664, 277); this.controls.add (this.button3); this.Controls.Add (this.button2); this. Controls.add (this.button1); this.Controls.add (this.DataGrid1); this.name = "form1"; this.startPosition = system.windows.forms.formstartPosition.centerscreen; this.text = "data import main Form "; this.closing =

new System.ComponentModel.CancelEventHandler (this.Form1_Closing); this.Load = new System.EventHandler (this.Form1_Load);. ((System.ComponentModel.ISupportInitialize) (this.dataGrid1)) EndInit (); this.ResumeLayout ( False);} #ENDREGION

///

/// The primary entry point of the application. /// [stathread] static void main () {system.windows.forms.Application.run (new form1 ());}

Private void form1_closing (object sender, system.componentmodel.canceleventargs e) {this.sqlconnection1.close (); this.dstcnn.close (); // this.sqlConnection2 .close ();}

///

/// read the data in the source database /// /// /// < / param> private void Form1_Load (object sender, System.EventArgs e) {// read raw data DataConnSetting dst = new DataConnSetting (); if (dst.ShowDialog () == DialogResult.OK) {this.sqlConnection1.ConnectionString = Dst.dbconnstring; this.readsrcdata ();

THIS.DSTCNN = New SqlConnection (System.configuration.configurationSettings.AppSettings ["dstconnstr"]);} else {Application.exit ();}} #Region Sub-process for analyzing the source data set ///

/ / / Connect a dictionary library to multiple sub-sections of a table for update /// /// source table /// Keywords /// Target Name /// keyword /// association table /// list of field names private void FeiXi (string dstTabName, string dstPk, string endTabName, string endPk, string refTabName, params string [ ] refkey) {int maxid = 0; Foreach (DATAROW DR IN THIS.EndDataSet.tables [endtabname ].ROWS) {int curid = (int) DR [ENDPK]; if (curid> maxid) maxid = curid;} HashTable HST = new hashtable (); foreach (DATAROW DR IN this.dstDataSet.Tables [dsttabname] .rows) {int curid = (int) DR [DSTPK]; int DSTID = Curid MaxID; DR [DSTPK] = DSTID; HST. Add (Curid, DSTID);} // More New Idont Walk Foreach (DataRow Refdr in this.dstdataSet.tables [ReftabName] .ROWS) {FOREACH (String OPC in Refkey) {String Val = Refdr [OPC] .tostring () .trim (); if (Hst.Contains Val)) {refDr [opc] = HST [VAL] .tostring ();}}}} [refabName] .acceptchange ();} /// /// gets each source database The minimum ID value of a table is the minimum ID value of each table in the current data set. ///////////// Summary> Private Void Feixi (String DSTTABNAME, STRING DSTPK, STRING EndTabname, String endpk, params refab [] tabs) { INT maxid = 0;

if (! tabs = null) {foreach (refTab tab in tabs) {string tabName = tab.TabName; string tabKey = tab.TabKey; this.dstDataset.Tables [tabName] .AcceptChanges ();}} foreach (DataRow dr in THIS.EndDataSet.Tables [endtabname ].ROWS) {int curid = (int) DR [endpk]; if (curid> maxid) maxid = curid;} foreach (DataRow Dr in this.dstDataSet.Tables [dsttabname] .rows) {INT Curid = (int) DR [DSTPK]; DR [DSTPK] = Curid MaxID; if (Tabs! = Null) {string tabname = tab.tabname; string Tabkey = Tab.Tabkey; String Tabkey = Tab.Tabkey Foreach (DATAROW REFDRIES [TabName] .ROWS) {if (Refdr [TabKey] .tostring () .trim () == curid.tostring () && refDr.rowstate! = DATAROWSTATE.MODIFIED) {refdr [TabKey] = Curid Maxid;}}}}}}}}}}}}}}}}} {string tabkey = tab.tabname; string tabkey = tab.tabkey; this.dstDataSet.tables [tabname ] .Acceptchanges (); }

} ///

/// Read Data Source Data /// Private Void ReadSrcdata () {String Selcmdtxt = "SELECT * FROM D_ Duration Dictionary Database; SELECT * FROM D_ Patient Database ; "; SELCMDTXT =" SELECT * FROM D_ pathogenesis Dictionary; Select * from D_ episodes Dictionary library; "; SELCMDTXT =" SELECT * FROM D_ criminal penalty dictionary library; SELECT * FROM D_ function affects Dictionary library ; "; SELCMDTXT =" Select * from D_ Marriage Database; "; SELCMDTXT =" SELECT * FROM D_ Family History Dictionary; SELECT * from D_ Education Category Database; "; SqlDataAdapter Da = New SqlDataAdapter (Selcmdtxt, this . SqlConnection1); this.srcdata = new dataset (); DA.TABLEMAPPINGS.ADD ("Table", "Disease Features Database"); DA.TABLEMAPPINGS .ADD ("Table1", "Patient Database"); DA. TableMappings .add ("Table2", "Topic Prescentive Dictionary"); DA.TABLEMAPPINGS .ADD ("Table3", "Seasonal Category Database"); DA.TABLEMAPPINGS .ADD ("Table4", "Crime Penalty Dictionary Database" ); DA.TABLEMAPPINGS.ADD ("Table5", "Features Functional Database"); DA.TABLEMAPPINGS.ADD ("Table6", "Marriage Database"); Da.TableMappings.Add ("Table7", "Famous History Dictionary "); DA.TABLEMAPPINGS.ADD (" Table8 "," Education Category Database ");

Da.fill (this.srcdata); string selcmdtxt2 = "SELECT * FROM D_ Education topic catalog library;"; SELCMDTXT2 = "SELECT * FROM D_ Education Special Sub-catalog; SELECT * FROM D_ Economic Status Database;" SELCMDTXT2 = "SELECT * FROM D_ Help method Dictionary library; SELECT * FROM D_ follow-up record information library;"; SELCMDTXT2 = "SELECT * FROM D_ is the disease word class; SELECT * from D_ Culture Dictionary Database; "; Sqldataadapter Da2 = new sqldataadapter (Selcmdtxt2, this.sqlconnection1); da2.tablemappings.add (" Table "," Education Topic Library "); DA2.TableMappings.Add (" Table1 "," Education Special Subscription " ); DA2.TABLEMAPPINGS.ADD ("Table2", "Economic Status"); DA2.TABLEMAPPINGS.ADD ("Table3", "SOLVED Database"); DA2.TABLEMAPPINGS.ADD ("Table4", "follow-up Record information library "); DA2.TableMappings.add (" Table5 "," Top Database "); DA2.TableMappings.add (" Table6 "," Culture Dictionary Database "); DataSet DS2 = New DataSet () DA2.FILL (DS2); String Selcmdtxt3 = "SELECT * FROM D_ physiotherapy information library; SELECT * FROM D_ Psychological treatment information library;"; SELCMDTXT3 = "SELECT * FROM D_ PROUNIC DROLED class; SELECT * FROM D _ Drug treatment information library; "; SELCMDTXT3 =" Select * from D_ hospital information library; SELECT * from D_ Diagnostic Database; "; Selcmdtxt3 =" Select * from D_ Occupational Database; "; SqlDataAdapter DA3 = New SqldataAdapter (Selcmdtxt3, THIS.SQLCONNECTION1); DA3.TABLEMAPPINGS.ADD ("Table", "Physical Treatment Information Library"); DA3.TableMappings.Add ("Table1", "Psychotherapy Information Library"); DA3.TABLEMAPPINGS.ADD ("Table2" , "Dictionary"); DA3.TableMappings.add ("Table3", "Drug Treatment Information Library"); DA3.TableMappings.Add ("Table4", "Hospital Information Library"); DA3.TABLEMAPPINGS.ADD (" Table5 "," Diagnostic Database "); DA3.TABLEMAPPings.Add (" Table6 "," Professional Dictionary Library "); Dataset DS3 = New Dataset (); DA3.FILL (DS3);

String Selcmdtxt4 = "SELECT * FROM D_ Treatment Class Dictionary Library; Select * from D_ Treatment Category Database;"; Selcmdtxt4 = "SELECT * FROM D_ Treatment History; SELECT * FROM D_ Treatment Topic" " ; SELCMDTXT4 = "Select * from D_ Treatment Special Brand Library; Select * from D_ Treatment Topic Database;"; Selcmdtxt4 = "SELECT * FROM D_ Hospital Library; SELECT * from D_ Suicide or Attack Dictionary; "; SELCMDTXT4 =" SELECT * FROM D_ Autonomous Database "; SqlDataAdapter Da4 = New SqlDataAdapter (Selcmdtxt4, this.sqlConnection1); DA4.TABLEMAPPINGS.ADD (" Table "," Treatment Class Database "); DA4 .TableMappings.add ("Table1", "Treatment Category Database"); DA4.TABLEMAPPINGS.ADD ("Table2", "Treatment of History"); DA4.TABLEMAPPINGS.ADD ("Table3", "Total Total Library" ); DA4.TABLEMAPPINGS.ADD ("Table4", "Treatment Special Brand Library"); DA4.TABLEMAppings.add ("Table5", "Treatment Treatment Database"); DA4.TABLEMAPPINGS.ADD ("Table6", " Hospital Recording Library "); DA4.TABLEMAPPINGS.Add (" Table7 "," Suicide or Attack Database "); DA4.TABLEMAPPINGS.ADD (" Table8 "," Self-known "); DataSet DS4 = New Dataset DA4.FILL (DS4); Foreach (DataTable DT IN DS2.TABLES) {dataable DCT = DT.copy (); this.srcdatant.tables.add (dct);} DS2.Tables.clear (); DS2 = NULL; Foreach (DataTable DT IN DS3.Tables) {dataable dct = dt.copy (); this.srcdatanet.tables.add (dct);

} DS3.Tables.clear (); DS3 = NULL; Foreach (DATATABLE DT IN DS4.TABLES) {DataBole DCT = DT.copy (); this.srcdatanet.tables.add (dct);

} DS4.Tables.clear (); DS4 = null; this.dataGrid1.datasource = this.srcdata

}

///

// / According to the table name, it is processed /// /// #ENDREGION / / / // / Execution Analysis /// /// /// private void button1_click_1 (Object Sender, System.EventArgs e) {if (! this.complete) {this.cursor = system.windows.Forms.cursors.waitcursor; this.initdataadapter (); // ---- Prepare this.fillendDataSet (); // ---- Additional target dataset (); // Generate new dataset this.cursor = system.windows.Forms.cursors.default; messagebox.show ("Analysis completed!"); This.button1 .Enabled = false; if (this.isok) // If the analysis does not have an error {this.Complete = true; this.dstdataSet.acceptchange ();}}} private void button2_click_1 (Object sender, System.EventArgs E) {ix ( {IF (this.fs == null) {this.fs = new resultform (); fs.dstdata = this.Enddatanet; fs.show ();} else {this.fs.activate (); } Else {messagebox.show ("first execution analysis action");}}

Private void button3_click (object sender, system.eventargs e) {// Transfer data to the target database // Put the data in the DSTDataSet data set in the target database // The analysis after the analysis is stored in the target library. First update dictionary library // disease feature Database // sqldataadapter da = new SqlDataAdapter ("SELECT * FROM D_ Duration Database"); if (this.complete) {this.Dataimport (); this.button3.enabled = False;

// / / Generate the INSERTCOMMMMAND statement of updated database //

} Else {messagebox.show ("Please perform the analysis action");

} #Region Processing The DSTDataSet and deposits the endDataSet ///

/// Initialization data adapter /// generates the corresponding SQL statement for each data adapter ///// private void InitDataAdapter () {string dbName = this.dstCnn.Database; string sql_Open = ". set identity_insert {0} .dbo {1} on;"; string sql_Close = "set identity_insert {2} .dbo. {3} OFF "; String SQL_ADD ="; // Insert Statement String TabName = "; // Name String Sqlcmd =" ​​"; // Plus the command statement after the switchword name is also the last INSERTCOMMAND.COMMANDTEXT / / - Adapter command statement: SELECT and INSERT statement #Region disease characteristics Database - Adapter's command statement: SELECT and INSERT statement tabname = "D_ Database Features Database"; this.da_bcdtzdk = new SqldataAdapter (); this .da_bcdtzdk.selectcommand = new sqlcommand ("SELECT * FROM D_ Duration Database", this.dstcnn); SQL_ADD = "INSERT INTO D_ Duration Dictionary Database (ID, Disease Features) VALUES (@ id, @ bcdt) ; "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd0 = new SqlCommand (sqlCmd, this.dstCnn); addCmd0.Parameters.Add (new SqlParameter ( "@ID", sqldbtype.int); addcmd0.parameters.add (New SQLPA Rameter ("@ bcdt", sqldbtype.varchar, 200)); addcmd0.parameters ["@ id"]. SourceColumn = "id"; addcmd0.parameters ["@ bcdt"]. SourceColumn = "Disease characteristics"; da_Bcdtzdk .InsertCommand = addCmd0; #endregion #region database of all patients - adapter command statement: Select and Insert statements tabName = "d_ database of all patients"; this.da_Brzlk = new SqlDataAdapter (); this.da_Brzlk.SelectCommand = new SQLCOMMAND ("SELECT * FROM D_ Patient Database", this.dstcnn); SQL_ADD = "

INSERT INTO D_ patient database (ID, hospital number, patient name, pinyin code, outpatient, gender, birth year, marriage, occupation, economic income, cultural level, smoking, drug, address, address, ID number , fill in a form, entry time) values ​​(@ ID, @ YYBH, @ XM, @ PYM, @ MZH, @ XB, @ CSNY, @ FY, @ ZY, @ JJSR, @ WHCD, @ XY, @ YWLY, @ ZZ, @ DH, @ SFZ, @ TBR, @ SJ); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd1 = new SqlCommand (sqlCmd, THIS.DSTCNN); Addcmd1.Parameters.add ("@ id", sqldbtype.int); addcmd1.parameters.add (New SqlParameter ("@ yybh", sqldbtype.Id); addcmd1.parameters.Add (New SqlParameter ("@ xm", sqldbtype.varchar, 8)); addcmd1.parameters.add (New Sqlparameter ("@ pym", sqldbtype.varchar, 4)); addcmd1.parameters.add (new sqlparameter) MZH ", SQLDBTYPE.VARCHAR, 20)); addcmd1.parameters.add (" @ xb ", sqldbtype.bit); addcmd1.parameters.add (New Sqlparameter (" @ csny ", sqldbtype.varchar, 50 ); Addcmd1.parameters.add ("@ fy", sqldbtype.int); addcmd1.parameters.add (New SqlParameter ("@ zy", sqldbtype.int); addcmd1.parameters.add (New)SqlParameter ("@ jjsr", sqldbtype.int); addcmd1.parameters.add ("@ whcd", sqldbtype.int); addcmd1.parameters.add (New Sqlparameter ("@ xy", sqldbtype.bit ))); Addcmd1.parameters.add ("@ ywly", sqldbtype.bit); addcmd1.parameters.add (New SqlParameter ("@ zz", sqldbtype.varchar, 200)); addcmd1.parameters.add (New SQLParameter ("@ DH", SqldbType.varchar, 20)); addcmd1.parameters.add (New Sqlparameter ("@ sfz", sqldbtype.varchar, 20));

Addcmd1.Parameters.Add ("@ TBR", SqldbType.varchar, 8)); addcmd1.parameters.add (New SqlParameter ("@ SJ", SqldbType.varchar, 50)); addcmd1.parameters ["@ ID "]. SourceColumn =" id "; addcmd1.parameters [" @ yybh "]. SourceColumn =" Hospital number "; addcmd1.parameters [" @ xm "]. SourceColumn =" patient name "; addcmd1.parameters [" @ @ x PYM "]. SourceColumn =" Pinya code "; addcmd1.parameters [" @ mn "]. SourceColumn =" 门 门号 "; addcmd1.parameters [" @ xb "]. SourceColumn =" gender "; addcmd1.parameters [" @ Csny "]. SourceColumn =" Year of birth "; addcmd1.parameters [" @ fy "]. SourceColumn =" marriage "; addcmd1.parameters [" @ zy "]. SourceColumn =" 职业 "; addcmd1.parameters [" @ JJSR "]. SourceColumn =" Economic Income "; AddCMD1.Parameters [" @ WHCD "]. SourceColumn =" Culture "; Addcmd1.Parameters [" @ xy "]. SourceColumn =" smoking "; addcmd1.parameters [" @ Ywly "]. SourceColumn =" drug is used "; addcmd1.parameters [" @ zz "]. SourceColumn =" address "; addcmd1.parameters [" @ DH ​​"]. SourceColumn =" phone "; addcmd1.parameters [" @ sfz "]. SourceColumn =" ID card number "; addcmd1.parameters [" @ TBR "]. SourceColumn =" Fill in the table "; addcmd1.parameters [" @SJ "]. SourceColumn =" entry time "; this.da_brzlk .insertcommand = addcmd1;

#ENDREGION #REGion Pathogenicity Dictionary - Adapter Command State: SELECT and INSERT Statement TabName = "D_ Virtue Prescentives"; this.da_fbyyzd = New SqldataAdapter (); this.da_fbyyzd .selectCommand = New SqlCommand ("Select * from D_ pathogenesis induce dictionary, this.dstcnn; sqlcommand addcmd2 = new sqlcommand (); addcmd2.connection = this.dstcnn; sql_add = "INTO D_ pathogenesis Dictionary (ID, pathogenesis) VALUES (@ id, @ @ @ @@@ YY); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); addCmd2.CommandText = sqlCmd; addCmd2.Parameters.Add (new SqlParameter (" @ ID ", Sqldbtype.It); addcmd2.parameters.add ("@ yy", sqldbtype.varchar, 100)); addcmd2.parameters ["@ id"]. SourceColumn = "id"; addcmd2.parameters ["@ @ i YY "]. SourceColumn =" Pathogency incentives "; this.da_fbyyzd .insertcommand = addcmd2; #endregion #region episoding class Dictionary library - Adapter command statement: SELECT and INSERT statement tabname =" d_ episoding class Database "; this .da_fzlbzdk = new sqldataadapter (); this.da_fzlbzdk.selectcommand = new sqlcommand ("SELECT * FROM D_ episoded class dictionary", this.dstcnn; sqlcommand addcmd3 = new Sqlcommand (); addcmd3.connection = this.dstcnn; sql_add = "INSERT INTO D_ episoding class Database (ID, episode) VALUES (@ id, @ fz);"; sqlcmd = SQL_Open SQL_ADD SQL_Close; SQLCMD = string.Format (sqlCmd, dbName, tabName, dbName, tabName); addCmd3.CommandText = sqlCmd; addCmd3.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)); addCmd3.Parameters.Add (new SqlParameter ( "@Fz", sqldbtype.varchar, 50); addcmd3.parameters ["@ ID"]. SourceColumn = "id"; addcmd3.parameters ["@ fz"

]. SourceColumn = "Site Category"; this.da_fzlbzdk.insertcommand = addcmd3; #ndregion #Region Crime punishment Database - Adapter's command statement: SELECT and INSERT statement tabname = "D_ Crime penalty dictionary"; this .da_fzcflbzdk = new sqldataadapter (); this.da_fzcflbzdk.selectcommand = new sqlcommand ("SELECT * FROM D_ Criminal penalty Database", this.dstcnn); SQL_ADD = "Insert Into D_ Crime penalty Database (ID, criminal penalties category) values ​​(@ ID, @ CF); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd4 = new SqlCommand (sqlCmd, this. DSTCNN); addcmd4.parameters.add ("@ ID", sqldbtype.int); addcmd4.parameters.add (New Sqlparameter ("@ cf", sqldbtype.varchar, 50); addcmd4.parameters [" @ID "]. SourceColumn =" id "; addcmd4.parameters [" @ cf "]. SourceColumn =" Crime punishment category "; this.da_fzcflbzdk.insertcommand = addcmd4; #endregion #Region function affects the Dictionary library - Adapter command Statement: SELECT and INSERT statement tabname = "D_ function affects dictionary library"; this.da_glyxzdk = new sqldataadapter (); this.da_glyxzdk.selectCommand = new sqlcommand ("SELECT * FROM D_ function affects Database", this.dstcnn ) ; SQL_ADD = "INSERT INTO D_ function affects the Dictionary library (ID, Impact Description) VALUES (@ id, @ yx);" SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String.Format (SQLCMD, DBNAME, TabName, DBNAME , tabName); SqlCommand addCmd5 = new SqlCommand (sqlCmd, this.dstCnn); addCmd5.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)); addCmd5.Parameters.Add (new SqlParameter ( "@ YX" , SQLDBTYPE.VARCHAR, 50); addcmd5.parameters ["@ ID"]. SourceColumn = "id"; addcmd5.parameters ["@ yx"]. SourceColumn = "

Impact description "; this.da_glyxzdk .insertcommand = addcmd5; #endregion #region Marriage Database - Adapter command statement: SELECT and INSERT statement tabname =" D_ Marriage Database "; this.da_fyzdk = new sqldataadapter (); this .da_fyzdk .selectcommand = new sqlcommand ("SELECT * FROM D_ Marriage Database", this.dstcnn); SQL_ADD = "INSERT INTO D_ Marriage Database (Fyid, Marriage) Values ​​(@ id, @ fy);" ; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd6 = new SqlCommand (sqlCmd, this.dstCnn); addCmd6.Parameters.Add (new SqlParameter ( "@ ID ", sqldbtype.int); addcmd6.parameters.add (New SqlParameter (" @ fy ", sqldbtype.varchar, 50)); addcmd6.parameters [" @ id "]. SourceColumn =" fyid "; addcmd6.parameters ["@Fy"]. SourceColumn = "Marriage status"; this.da_fyzdk .insertcommand = addcmd6;

#endregion #Region family history dictionary - Adapter command statement: SELECT and INSERT statement

TabName = "D_ Family History Dictionary"; this.da_jzszd = new SqldataAdapter (); this.da_jzszd .selectCommand = New SqlCommand ("Select * from D_ Famous Dictionary", this.dstcnn); SQL_ADD = "Insert Into D _ Family History Dictionary (ID, Family History) VALUES (@ ID, @ JS); "; SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String.Format (SQLCMD, DBNAME, TabName, DBNAME, TABNAME); SQLCommand Addcmd7 = New Sqlcommand (Sqlcmd, this.dstcnn); addcmd7.parameters.add ("@ id", sqldbtype.int); addcmd7.parameters.add (New Sqlparameter ("@ Js", SqldbType.varchar, 100)) Addcmd7.Parameters ["@ ID"]. SourceColumn = "id"; addcmd7.parameters ["@ Js"]. SourceColumn = "family history"; this.da_jzszd.insertcommand = addcmd7; #ndregion #Region Education Category Database - Adapter's command statement: SELECT and INSERT statement tabname = "d_ educational category"; this.da_jylbzdk = new sqldataadapter (); this.da_jylbzdk .selectCommand = new SQLCOMMAND ("SELECT * from D_ Education Category Database ", this.dstcnn); SQL_ADD =" INSERT INTO D_ Educational Category Database (ID, JYDES) VALUES (@ ID, @ JS); "; SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String.Format (Sqlcmd, DBNAME, TabName, DBNAME, T abName); SqlCommand addCmd8 = new SqlCommand (sqlCmd, this.dstCnn); addCmd8.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int, 4, "ID")); addCmd8.Parameters.Add (new SqlParameter ("@JS", sqldbtype.varchar, 50, "jydes")); this.da_jylbzdk .insertcommand = addcmd8; #endregion #Region Education topic catalog - Adapter command statement: SELECT and INSERT statement tabname = "D_ Educational Topics Library "; this.da_jyztmlk = new SqldataAdapter (); this.da_jyztmlk .selectCommand = New SqlCommand (" SELECT * FROM D_ Education Topic Library "

, THIS.DSTCNN; SQL_ADD = "INSERT INTO D_ Education Topics Library (ID, CLSID, Title, DOCTXT, DOCTIME) VALUES (@ ID, @ CLS, @ Tit, @ DOC, @TM);"; SQLCMD = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd9 = new SqlCommand (sqlCmd, this.dstCnn); addCmd9.Parameters.Add (new SqlParameter ( "@ ID", Sqldbtype.int); addcmd9.parameters.add ("@ CLS", SqldbType.It); addcmd9.parameters.Add (New Sqlparameter ("@ tit", sqldbtype.varchar, 50); addcmd9. Parameters.Add ("@ DOC", SqldbType.text); addcmd9.parameters.add (New SqlParameter ("@TM", SqldbType.varchar, 50)); addcmd9.parameters ["@ id"]. SourceColumn = "id"; addcmd9.parameters ["@ CLS"]. SourceColumn = "clsid"; addcmd9.parameters ["@ TIT"]. SourceColumn = "Title"; addcmd9.parameters ["@ DOC"]. SourceColumn = "Doctxt"; addcmd9.parameters ["@TM"]. SourceColumn = "doctime"; this.da_jyztmlk.insertcommand = addcmd9;

#ENDREGION #REGion Education Special Submatical Library - Adapter Command Statement: SELECT and INSERT Statement TabName = "D_ Education Special Submarial Library"; this.da_jyztzmlk = New SqldataAdapter (); this.da_jyztzmlk .selectCommand = New Sqlcommand "Select * from D_ Education Special Submatical Library", this.dstcnn); SQL_ADD = "INTO D_ Education Special Subscription (ID, Farid, Sonorder, Title, DOC, DOCTM) VALUES (@ id, @ FAR , @ SON, @ TIT, @ DOC, @ TM); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd10 = new SqlCommand (sqlCmd, this .dstcnn); addcmd10.Parameters.add ("@ ID", sqldbtype.int); addcmd10.parameters.add (New SqlParameter ("@ far", sqldbtype.int); addcmd10.parameters.add ( New SqlParameter ("@ Son", SqldbType.It); addcmd10.parameters.add (New Sqlparameter ("@ tit", sqldbtype.varchar, 50)); addcmd10.parameters.add (New Sqlparameter ("@ DOC", Sqldbtype.text); addcmd10.parameters.add (New SqlParameter ("@TM", SqldbType.varchar, 50)); addcmd10.Parameters ["@ id"]. SourceColumn = "id"; addcmd10.parameters ["@ Far "]. SourceColumn =" fa Rid "; addcmd10.Parameters [" @ Son "]. SourceColumn =" Sonorder "; addcmd10.parameters [" @ tit "]. SourceColumn =" Title "; addcmd10.parameters [" @ DOC "]. SourceColumn =" DOC " Addcmd10.Parameters ["@TM"]. SourceColumn = "doctm"; this.da_jyztzmlk.insertcommand = addcmd10;

#ENDREGION #REGON Economic Status Dictionary Library - Adapter Command Statement: SELECT and INSERT Statement TabName = "D_ Economic Status Database"; this.da_jzkzdk = New SqldataAdapter (); this.da_jzkzdk .selectCommand = New SqlCommand ("SELECT * from D_ Economic Status Dictionary (THIS.DSTCNN); SQL_ADD = "INTO D_ Economic Status Database (JJZD, Economic Status) Values ​​(@ ID, @ JS);"; SQLCMD = SQL_Open SQL_ADD SQL_Close ; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd11 = new SqlCommand (sqlCmd, this.dstCnn); addCmd11.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)) Addcmd11.Parameters.add ("@ Js", Sqldbtype.varchar, 100)); addcmd11.parameters ["@ id"]. SourceColumn = "jjzd"; addcmd11.parameters ["@ JS"]. SourceColumn. SourceColumn. = "Economic Status"; this.da_jjzkzdk.insertCommand = addcmd11; #endregion #REGON Help method Dictionary library - Adapter command statement: SELECT and INSERT statement tabname = "d_ 方式 方式 字 字 字"; this.da_qzfszdk = new SqldataAdapter (); This.da_qzfszdk .selectcommand = new SQLCOMMAND ("SELECT * FROM D_ Help Dictionary Library", this.dstcnn); SQL_ADD = "Insert INTO D_ Help Dictionary Database (ID, Help Mode) VALUES (@ID) , @ JS); "; sqlcmd = SQL _Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd12 = new SqlCommand (sqlCmd, this.dstCnn); addCmd12.Parameters.Add (new SqlParameter ( "@ ID", Sqldbtype.int); addcmd12.parameters.add (New Sqlparameter ("@ Js", SqldbType.varchar, 50); addcmd12.parameters ["@ id"]. SourceColumn = "id"; addcmd12.parameters ["@ JS "]. SourceColumn =" Help mode "; this.da_qzfszdk.insertcommand = addcmd12;

#ENDREGION #REGON follow-up recording information library - Adapter command statement: SELECT and INSERT statement tabname = "D_ follow-up record information"; this.da_sfjlxxk = new SqldataAdapter (); this.da_sfjlxxxk.selectCommand = new sqlcommand ("SELECT * from D_ follow-up record information library ", this.dstcnn); SQL_ADD =" INSERT INTO D_ follow-up record information library ("; sql_add =" ID, patient number, follow-up date, social leisure function, professional function, social family interaction Role, "; sql_add =" cognitive function, scale, manic scale, Hammy Don depression table, symptoms, laboratory examination, "; sql_add =" self-knowledge, same disease, cycle interval, suicide concept , Suicide, attack behavior, "; sql_add =" crime punishment, weight, metabolic syndrome, diabetes, prolactin level increase, "; SQL_ADD =" Lipid metabolism, QTC Extension, EPS) Values ​​("; sql_add = "@ Id, @BRBH, @ RQ, @ xx, @ zy, @ Jt,"; sql_add = "@ rzGL, @ lb, @ cklb, @ hmdlb, @ zz, @ sys,"; sql_add = "@ zzl , @ TFB, @ xfjg, @ zsgn, @ zssj, @ gjxw, "; sql_add =" @ fzcf, @ Tz, @ dxzhz, @ tnb, @ SGZ, "; sql_add =" @ Dxyc, @ qtc, @ EPS) ; "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd13 = new SqlCommand (sqlCmd, this.dstCnn); addCmd13.Parameters.Add (new SqlParameter ( "@ID", sqldbtype.int, 4, "id")); addcmd13.parameters.add (New Sqlparameter ("@ BRBH", SqldbType.int, 4, "Patient No."); AddCmd13.Paramete rs.add ("@ rq", sqldbtype.varchar, 50, "follow-up date"); addcmd13.parameters.add (New Sqlparameter ("@ xx", sqldbtype.int, 4, "social leisure function" ); Addcmd13.parameters.add (New SqlParameter ("@ zy", sqldbtype.int, 4, "professional function")); addcmd13.parameters.add (New Sqlparameter ("@ Jt", SqldbType.Int, 4, "Social Home Interaction"))

Addcmd13.Parameters.Add ("@ rzgl", sqldbtype.int, 4, "cognitive")); addcmd13.parameters.add (New Sqlparameter ("@ lb", sqldbtype.int, 4, " Table ")); addcmd13.Parameters.add (" @ cklb ", sqldbtype.int, 4," Melody Table ")); addcmd13.Parameters.Add (New Sqlparameter (" @ hmdlb ", sqldbtype. INT, 4, "Hammeron Depression Table"); addcmd13.parameters.add (New Sqlparameter ("@ zz", sqldbtype.varchar, 200, "symptom")); addcmd13.Parameters.Add (New Sqlparameter) "@Sys", sqldbtype.varchar, 200, "laboratory check")); addcmd13.parameters.add ("@ zzl", sqldbtype.int, 4, "self-knowledge")); addcmd13.Parameters .Add ("@ TFB", SqldbType.varchar, 200, "The Same"); addcmd13.parameters.add (New Sqlparameter ("@ xfjg", sqldbtype.int, 4, "cycle interval") Addcmd13.Parameters.Add (New Sqlparameter ("@ zsgn", sqldbtype.int, 4, "suicide concept")); addcmd13.parameters.add (New Sqlparameter ("@ zssj", sqldbtype.int, 4, " Suicide event "); addcmd13.parameters.add (New Sqlparameter (" @ gjxw ", sqldbtype.int, 4," attack behavior "));

Addcmd13.Parameters.add (New Sqlparameter ("@ fzcf", SqldbType.int, 4, "Crime Punishment")); AddCMD13.Parameters.add (New Sqlparameter ("@ Tz", SqldbType.Float, 9, "Weight" )); Addcmd13.Parameters.add (New Sqlparameter ("@ DXZHz", SqldbType.bit, 1, "Metabolic Syndrome"); addcmd13.parameters.add (New SqlParameter ("@ TNB", SqldbType.bit, 1 "Diabetes")); addcmd13.Parameters.Add (New Sqlparameter ("@ SGZ", SqldbType.bit, 1, "Prompticin levels"));

Addcmd13.Parameters.add ("@ Dxyc", SqldbType.bit, 1, "Lipid Metabolism")); addcmd13.parameters.add (New Sqlparameter ("@ qtc", sqldbtype.int, 4, " QTC extension ")); addcmd13.Parameters.add (New Sqlparameter (" @ EPS ", SqldbType.varchar, 4," EPS ")); this.da_sfjlxxk .insertcommand = addcmd13; #ndregion #region is the same as the disease word classic library - Adapter's command statement: SELECT and INSERT statement tabname = "D_ is the disease word"; this.da_tfbzdk = new SqldataAdapter (); this.da_tfbzdk.selectCommand = new SQLCommand ("SELECT * from D_ with a Dictionary Dictionary Library ", this.dstcnn); SQL_ADD =" INTO D_ is the same as the disease word library (ID, the same disease) VALUES (@ ID, @ BCDT); "; sqlcmd = SQL_Open SQL_ADD SQL_Close; sqlcmd = string. Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd14 = new SqlCommand (sqlCmd, this.dstCnn); addCmd14.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)); addCmd14.Parameters. Add ("@ bcdt", sqldbtype.varchar, 100)); addcmd14.parameters ["@ ID"]. SourceColumn = "id"; addcmd14.parameters ["@ bcdt"]. SourceColumn = " "; This.da_tfbzdk .insertcommand = addcmd14; #endregion #REGON Culture Level Dictionary Library - Adapter Command Statement: SELECT and INSERT statement

TabName = "D_ Culture"; this.da_whcdzdk = new sqldataadapter (); this.da_whcdzdk.selectCommand = New SQLCOMMAND ("SELECT * FROM D_ Culture Dictionary Database", this.dstcnn); SQL_ADD = "Insert INTO D_ Culture Dictionary Database (ID, Culture) VALUES (@ ID, @ BCDT); "; SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String.Format (SQLCMD, DBNAME, TabName, DBName, TabName); SQLCommand addCmd15 = new SqlCommand (sqlCmd, this.dstCnn); addCmd15.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)); addCmd15.Parameters.Add (new SqlParameter ( "@ BCDT", SqlDbType.VarChar, 100)); addcmd15.parameters ["@ ID"]. SourceColumn = "id"; addcmd15.parameters ["@ bcdt"]. SourceColumn = "Culture"; this.da_whcdzdk.insertCommand = addcmd15; #ndregion #Region Physics Treatment information library - Adapter's command statement: SELECT and INSERT statement

TabName = "D_ Physiotherapy Information Library"; this.da_wlzlxxk = new sqldataadapter (); this.da_wlzlxxk .selectCommand = New SqlCommand ("SELECT * FROM D_ Physiotherapy Information Library", this.dstcnn); SQL_ADD = "Insert INTO D_ physiotherapy information library (ID, physical category, treatment record number, start time, number of times, power, duration, adverse reactions, efficacy, patient reply feeling) "; sql_add =" VALUES (@ id, @ WLLB, @ JLBH, @ Kssj, @ cs, @ DL, @ cssj, @ fy, @ lx, @gj); "; sqlcmd = sql_open sql_add sql_close; sqlcmd = string.format (SQLCMD, DBNAME, TABNAME, DBNAME, TABNAME) ; SqlCommand addCmd16 = new SqlCommand (sqlCmd, this.dstCnn); addCmd16.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)); addCmd16.Parameters.Add (new SqlParameter ( "@ WLLB", SqlDbType. INT); AddCMD16.Parameters.Add ("@ jlbh", sqldbtype.int); addcmd16.parameters.add (New SqlParameter ("@ Kssj", SqldbType.varchar, 50)); addcmd16.parameters. Add ("@ cs", ​​sqldbtype.int); addcmd16.parameters.add (New SqlParameter ("@ DL", Sqldbtype.varchar, 50)); addcmd16.parameters.add (new sqlparameter ("@ cssj ", Sqldbtype.varchar, 50)); addcmd16.parameters.add (New SQLP Arameter ("@ fy", sqldbtype.varchar, 200)); addcmd16.parameters.add (New Sqlparameter ("@ lx", sqldbtype.varchar, 200)); addcmd16.parameters.add (New Sqlparameter ("@ gj" , SQLDBTYPE.VARCHAR, 100); AddCMD16.Parameters ["@ ID"]. SourceColumn = "id"; addcmd16.parameters ["@ WLLB"]. SourceColumn = "physical category"; addcmd16.parameters ["@ jlbh" ]. SourceColumn = "Treatment Record Number"; AddCMD16.Parameters ["@ Kssj"]. SourceColumn = "Start Time";

AddCMD16.Parameters ["@ cs"]. SourceColumn = "number"; addcmd16.parameters ["@ DL"]. SourceColumn = "electricity"; addcmd16.parameters ["@ cssj"]. SourceColumn = "duration"; addcmd16 .Parameters ["@ fy"]. SourceColumn = "Adding"; addcmd16.parameters ["@ lx"]. SourceColumn = "Effect"; addcmd16.parameters ["@ gj"]. SourceColumn = "Patient self-prosecution"; THIS.DA_WLZLXXXK .INSERTCOMMAND = addcmd16; #endregion #region Psychotherapy information library - Adapter command statement: SELECT and INSERT statement

TabName = "D_ Psychotherapy Information Library"; this.da_xlzlxxk = new sqldataadapter (); this.da_xlzlxxk .selectCommand = New SQLCommand ("SELECT * FROM D_ Psychotherapy Information Library", this.dstcnn); SQL_ADD = "Insert INTO D_ psychotherapy information library (ID, psychological category, treatment record number, like time, number of times, interval, efficacy, patient self-prosecution) "; sql_add =" VALUES (@ id, @ xllb, @ jlbh, @ Kssj , @ CS, @ CSSJ, @ LX, @ GJ); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd17 = new SqlCommand (sqlCmd, this .dstcnn); addcmd17.parameters.add ("@ id", sqldbtype.int); addcmd17.parameters.add (New Sqlparameter ("@ xllb", sqldbtype.int); address); addcmd17.parameters.Add ( New SqlParameter ("@ jlbh", sqldbtype.int); addcmd17.parameters.add ("@ kssj", sqldbtype.varchar, 50)); addcmd17.parameters.add (New Sqlparameter ("@ cs", Sqldbtype.int); addcmd17.parameters.add (New SqlParameter ("@ cssj", sqldbtype.varchar, 50)); addcmd17.parameters.add (New Sqlparameter ("@ lx", sqldbtype.varchar, 200)); Addcmd17.Parameters.add (New Sqlparameter ("@gj" , SQLDBTYPE.VARCHAR, 100); AddCMD17.Parameters ["@ ID"]. SourceColumn = "id"; addcmd17.parameters ["@ XLLB"]. SourceColumn = "Psychological category"; addcmd17.parameters ["@ jlbh" ]. SourceColumn = "Treatment Record Number"; AddCMD17.Parameters ["@ Kssj"]. SourceColumn = "Open, AddCMD17.Parameters [" @ cs "]. SourceColumn =" Times "; addcmd17.parameters [" @ CSSJ "]. SourceColumn =" Interval Time "; Addcmd17.Parameters [" @ lx "]. SourceColumn =" Effect "

Addcmd17.Parameters ["@gj"]. SourceColumn = "Patient reply"; this.da_xlzlxxk .insertCommand = addcmd17; #endregion #region Personality Dictionary library - Adapter command statement: SELECT and INSERT statement tabname = "D_ Character dictionary (this.da_xgzdk = new sqldataadapter (); this.da_xgzdk.selectCommand = new SQLCOMMAND ("SELECT * FROM D_ Personality Database", this.dstcnn); SQL_ADD = "Insert Into D_ Personality Dictionary Library ( ID, character) values ​​(@ ID, @ XG); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd18 = new SqlCommand (sqlCmd, this. Dstcnn); addcmd18.parameters.add ("@ id", sqldbtype.int); addcmd18.parameters.add (New Sqlparameter ("@ xg", sqldbtype.varchar, 50); addcmd18.parameters [" @ID "]. SourceColumn =" id "; addcmd18.parameters [" @ xg "]. SourceColumn =" character "; this.da_xgzdk.insertcommand = addcmd18; #ndregion #region drug treatment information library - Adapter command statement: SELECT and INSERT statement

TabName = "d_ drug therapy information"; this.da_ywzlxxk = new sqldataadapter (); this.da_ywzlxxk .selectcommand = new sqlcommand ("SELECT * FROM D_ Drug Treatment Information Library", this.dstcnn); SQL_ADD = "INSERT INTO D_ drug treatment information library (ID, drug number, treatment record number, start time, dose, blood concentration, adverse reactions, efficacy, stop time, arrowing) "; sql_add =" VALUES (@ id, @ ywbh, @ Jlbh, @ Kssj, @ jl, @ XYLD, @ fy, @ lx, @ Tzsj, @ Jy); "SQLCMD = SQL_Open SQL_ADD SQL_Close; Sqlcmd = String.Format (SQLCMD, DBNAME, TabName, DBName, Tabname ); SqlCommand addCmd19 = new SqlCommand (sqlCmd, this.dstCnn); addCmd19.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int)); addCmd19.Parameters.Add (new SqlParameter ( "@ YWBH", SqlDbType .Int); addcmd19.parameters.add ("@ jlbh", sqldbtype.int); addcmd19.parameters.add (New SqlParameter ("@ Kssj", SqldbType.varchar, 50); addcmd19.parameters; address .Add ("@ jl", sqldbtype.varchar, 50)); addcmd19.parameters.add (New Sqlparameter ("@ xyld", sqldbtype.varchar, 50)); addcmd19.parameters.add (New Sqlparameter) "@Fy", sqldbtype.varchar, 200)); addcmd19.parameters.a DD ("@ lx", sqldbtype.varchar, 200)); addcmd19.parameters.add (New Sqlparameter ("@ Tzsj", SqldbType.varchar, 50)); addcmd19.parameters.add (New Sqlparameter) @JY ", sqldbtype.bit); addcmd19.parameters [" @ ID "]. SourceColumn =" id "; addcmd19.parameters [" @ ywbh "]. SourceColumn =" drug number "; addcmd19.parameters [" @ jlbh "]. SourceColumn =" Treatment Record Number "; AddCMD19.Parameters [" @ Kssj "]. SourceColumn =" Start Time ";

Addcmd19.Parameters ["@ JL"]. SourceColumn = "Did"; addcmd19.parameters ["@ XYLD"]. SourceColumn = "blood concentration"; addcmd19.parameters ["@ fy"]. SourceColumn = "adverse reactions" Addcmd19.Parameters ["@ LX"]. SourceColumn = "Effect"; addcmd19.parameters ["@ TZSJ"]. SourceColumn = "Stop time"; addcmd19.parameters ["@ jy"]. SourceColumn = "Sports processing" ;

THIS.DA_YWZLXXK .INSERTCOMMAND = addcmd19; #endregion #Region Hospital Information Library - Adapter command statement: SELECT and INSERT statement tabname = "D_ Hospital Information Library"; this.da_yxxxk = new SqldataAdapter (); this.da_yxxxk.selectCommand = New SQLCOMMAND ("SELECT * FROM D_ Hospital Information Library", this.dstcnn); SQL_ADD = "Insert INTO D_ Hospital Information Library (ID, Hospital Name, Contact Phone, Introduction Information) Values ​​(@ id, @ mz, @ DH, @ XX); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd20 = new SqlCommand (sqlCmd, this.dstCnn); addCmd20.Parameters .Add ("@ ID", sqldbtype.int); addcmd20.parameters.add (New Sqlparameter ("@ mz", sqldbtype.varchar, 50)); addcmd20.parameters.add (new sqlparameter) DH ", SQLDBTYPE.VARCHAR, 20); addcmd20.parameters.add (" @ xx ", sqldbtype.text); addcmd20.parameters [" @ id "]. SourceColumn =" id "; addcmd20.parameters ["@MZ"]. SourceColumn = "Hospital name"; addcmd20.parameters ["@ DH"]. SourceColumn = "Contact phone"; addcmd20.parameters ["@ xx"]. SourceColumn = "Introduction information"; Da_YYXXK.INSERTCOMMAND = addcmd20; #endregion #Region Diagnostic Database - Adapter Command State: SELECT and INSERT Statement TabName = "D_ Diagnostics Database"; this.da_zdzdk = new SqldataAdapter (); this.da_zdzdk.selectCommand = New SqlCommand ("SELECT * FROMMand D_ Diagnostics Database ", this.dstcnn); SQL_ADD =" INSERT INTO D_ Diagnostic Database (ID, Diagnostics) VALUES (@ ID, @ xg); "; SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String. Format (SQLCMD, DBNAME, TABNAME, DBNAME, TABNAME); SQLCOMMAND AddCMD21 = New SQLCOMMAND (SQLCMD, this.dstcnn);

AddCMD21.Parameters.add ("@ ID", sqldbtype.int); addcmd21.parameters.add (New SQLParameter ("@ xg", sqldbtype.varchar, 200)); addcmd21.parameters ["@ id" ]. SourceColumn = "id"; addcmd21.parameters ["@ xg"]. SourceColumn = "Diagnostics"; this.da_zdzdk.insertCommand = addcmd21; #endregion #REGION Career Dictionary library - Adapter command statement: SELECT and INSERT statement TabName = "D_ Certificate Dictionary"; this.da_zyzdk = new SqldataAdapter (); this.da_zyzdk .selectCommand = New SqlCommand ("SELECT * FROM D_ Certificate", this.dstcnn); SQL_ADD = "Insert Into D _ Certified Database (Zyid, Career Description) Values ​​(@ ID, @ xg); "SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String.Format (SQLCMD, DBNAME, TabName, DBNAME, TabName); SQLCommand AddCMD22 = New Sqlcommand (Sqlcmd, this.dstcnn); addcmd22.parameters.add ("@ ID", sqldbtype.int); addcmd22.parameters.add (New Sqlparameter ("@ xg", sqldbtype.varchar, 100)) Addcmd22.Parameters ["@ ID"]. SourceColumn = "zyid"; addcmd22.parameters ["@ xg"]. SourceColumn = "career description"; this.da_zyzdk .insertcommand = addcmd22; #ndregion #R Egion Treatment Class Database - Adapter's command statement: SELECT statement (not inserted) this.da_zldlzdk = new SqldataAdapter (); this.da_zldlzdk.selectCommand = New SQLCOMMAND ("SELECT * from D_ Treatment Classical Database", THIS.DSTCNN; #ndregion #Region treatment category Database - adapter command statement: SELECT and INSERT statement tabname = "d_ 治疗 类 字 字 字"; this.da_zllbzdk = new SqldataAdapter (); this.da_zllbzdk .selectCommand = New SqlCommand ("Select * from D_ Treatment Category Database", this.dstcnn); SQL_ADD = "Insert INTO D_ Treatment Category Database (ID, Treatment Category Description, Treatment Class) VALUES (@ id, @ xg, @Dl); "

sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd23 = new SqlCommand (sqlCmd, this.dstCnn); addCmd23.Parameters.Add (new SqlParameter ( "@ ID ", Sqldbtype.int); addcmd23.parameters.add (New Sqlparameter (" @ xg ", sqldbtype.varchar, 100)); addcmd23.parameters.add (New Sqlparameter (" @ dl ", sqldbtype.int); Addcmd23.Parameters ["@ ID"]. SourceColumn = "ID"; addcmd23.parameters ["@ xg"]. SourceColumn = "Treatment Category Description"; AddCMD23.Parameters ["@ DL"]. SourceColumn = "Treatment "; THISERTCOMMAND = addcmd23; #endregion #region Treatment history library - adapter command statement: SELECT and INSERT statement tabname =" d_ z 库 "; this.da_zlsk = new sqldataAdapter (); this.da_zlsk .SelectCommand = New SQLCOMMAND ("SELECT * FROM D_ Treatment History", this.dstcnn); SQL_ADD = "INTO D_ Treatment History (ID, Patient No., Yubi Dissive, Character, Family History"; SQL_ADD = "Chronic medical disease, long-term medicine, onset time, incentive, first help mode,"; sql_add = "first diagnosis, first diagnosis, diagnosis, diagnosis,"; sql_add = "first mania, front drive period , Suicide concept, suicide, attack behavior, "sql_add =" disease characteristics) VALUES (@ id, @BRBH, @ JL, @ xg, @ JS, "; sql_add =" @ mxjb, @ CQ YY, @ fbsj, @ fbyy, @ fs, "; szsj, @ szzd, @ @ @ zd,"; sql_add = "@ ck, @ zzq, @ zsgn, @ zssj, @ gjxw,"; sql_Add = "@ BCDT);"; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd24 = new SqlCommand (sqlCmd, this.dstCnn); addCmd24.Parameters .Add (New Sqlparameter ("@ ID"

, SQLDBTYPE.INT, 4, "ID")); addcmd24.parameters.add (New Sqlparameter ("@ BRBH", SqldbType.int, 4, "Patient No.")); AddCMD24.Parameters.Add (New Sqlparameter) @JL ", SqldbType.bit, 1," Nothing experience ")); addcmd24.parameters.add (New Sqlparameter (" @ xg ", sqldbtype.int, 4," character ")); addcmd24.parameters.add ( New SqlParameter ("@ Js", SqldbType.int, 4, "Family History")); addcmd24.parameters.add (New Sqlparameter ("@ mxjb", sqldbtype.varchar, 200, "Chronic Internal Medicine)); addcmd24 .Parameters.add (New SqlParameter ("@ cqyy", sqldbtype.varchar, 200, "Long Terminal Medicine")); addcmd24.parameters.add (New Sqlparameter ("@ fbsj", sqldbtype.varchar, 50, "Time ")); Addcmd24.parameters.add (New SqlParameter (" @ fbyy ", sqldbtype.int, 4," pathogenesis ")); addcmd24.parameters.add (New Sqlparameter (" @ fs ", sqldbtype.int, 4 , "First Help Way")));

Addcmd24.Parameters.add (New SqlParameter ("@ szsj", sqldbtype.varchar, 50, "first diagnostic time")); addcmd24.parameters.add (New Sqlparameter ("@ szzarameter (" @ szzd ", sqldbtype.varchar, 50," first Diagnosis "); addcmd24.parameters.add (" @ qzsj ", sqldbtype.varchar, 50," diagnosis time ")); addcmd24.parameters.add (new sqlparameter (" @ zd ", sqldbtype.varchar , 200, "Diagnostics"));

AddCMD24.Parameters.add ("@ ck", sqldbtype.bit, 1, "first mania")); addcmd24.parameters.add (New Sqlparameter ("@ zzq", sqldbtype.varchar, 50, "pre-drive Symptoms ")); addcmd24.parameters.add (New Sqlparameter (" @ zsgn ", sqldbtype.int, 4," suicide concept ")); addcmd24.parameters.add (New Sqlparameter (" @ zssj ", sqldbtype.int , 4, "Suicide Event")); addcmd24.parameters.add (New Sqlparameter ("@ gjxw", sqldbtype.int, 4, "attack behavior"); addcmd24.parameters.add (New Sqlparameter ("@ bcdt" , SQLDBTYPE.INT, 4, "Disease Features")); this.da_zlsk.insertCommand = AddCMD24;

#ENDREGON #Region Treatment Topic Library - Adapter command statement: SELECT and INSERT statement tabname = "d_ 治疗 专 目"; this.da_zlztmlk = new sqldataadapter (); this.da_zlztmlk .selectCommand = new sqlcommand ("SELECT * from D_ Treatment Topics Library ", this.dstcnn); SQL_ADD =" INSERT INTO D_ Treatment Topics Library (ID, CLSID, Title, DOC, DOCTM) VALUES (@ ID, @ CLS, @ Tit, @ DOC , @ TM); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd25 = new SqlCommand (sqlCmd, this.dstCnn); addCmd25.Parameters.Add ("@ ID", sqldbtype.int); addcmd25.parameters.add ("@ cls", sqldbtype.int); addcmd25.parameters.add (New Sqlparameter ("@ tit", Sqldbtype .Varchar, 100)); addcmd25.Parameters.add ("@ DOC", SqldbType.text); addcmd25.parameters.add (New Sqlparameter ("@TM", sqldbtype.varchar, 50); addcmd25 .Parameters ["@ ID"]. SourceColumn = "id"; addcmd25.parameters ["@ CLS"]. SourceColumn = "clsid"; addcmd25.parameters ["@ tit"]. SourceColumn = "title"; addcmd25.parameters [@Doc " ]. SourceColumn = "DOC"; addcmd25.parameters ["@TM"]. SourceColumn = "doctm"; this.da_zlztmlk.insertcommand = addcmd25;

#ENDREGION #Region Treatment Special Submatical Library - Adapter Command Statement: SELECT and INSERT Statement TabName = "D_ Treatment Special Brand"; this.da_zlztzmlk = New SqldataAdapter (); this.da_zlztzmlk .selectCommand = New Sqlcommand "SELECT * FROM D_ Treatment Special Brand", this.dstcnn; SQL_ADD = "Insert INTO D_ Treatment Special Subscription (ID, Parent, Sonorder, Title, DOC, DOCTM) VALUES (@ id, @far , @ SON, @ TIT, @ DOC, @ TM); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd26 = new SqlCommand (sqlCmd, this .dstcnn); addcmd26.parameters.add ("@ ID", sqldbtype.int); addcmd26.parameters.add (New Sqlparameter ("@ far", sqldbtype.int); addcmd26.parameters.add ( New SqlParameter ("@ Son", SqldbType.It); addcmd26.parameters.add (New Sqlparameter ("@ tit", SqldbType.varchar, 100)); addcmd26.parameters.add (New SqlParameter ("@ DOC", Sqldbtype.text); addcmd26.parameters.add (New SqlParameter ("@TM", sqldbtype.varchar, 50)); addcmd26.parameters ["@ id"]. SourceColumn = "id"; addcmd26.parameters ["@ Far "]. SourceColumn = "Parent"; addcmd26.parameters ["@ Son"]. SourceColumn = "Sonorder"; addcmd26.parameters ["@ tit"]. SourceColumn = "Title"; addcmd26.parameters ["@ DOC"]. SourceColumn = " "; Addcmd26.parameters [" @TM "]. SourceColumn =" doctM "; this.da_zlztzmlk.insertcommand = addcmd26;

#ENDREGION #REGON Treatment Topic Dictionary Library - Adapter Command State: SELECT and INSERT Statement TabName = "D_ Total Dictionary"; this.da_zlztzdk = New SqldataAdapter (); this.da_zlztzdk .selectCommand = New SqlCommand ("SELECT * from D_ Treatment Topic Database ", this.dstcnn); SQL_ADD =" INSERT INTO D_ Treatment Topic Database (ID, ZTCLS) VALUES (@ ID, @ JS); "; SQLCMD = SQL_Open SQL_ADD SQL_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd27 = new SqlCommand (sqlCmd, this.dstCnn); addCmd27.Parameters.Add (new SqlParameter ( "@ ID", SqlDbType.Int, 4, "ID"))); addcmd27.parameters.add (New Sqlparameter ("@ JS", SqldbType.varchar, 50, "ztcls")); this.da_zlztzdk .insertcommand = addcmd27; #ndregion #region Hospital Recording - Adapter Command statement: SELECT and INSERT statement tabname = "D_ inpatient record library"; this.da_zyjlk = new sqldataadapter (); this.da_zyjlk .selectCommand = new SQLCOMMAND ("SELECT * FROM D_ Hospital Record", this.dstcnn ); SQL_ADD = "INSERT INTO D_ Hospital Record Library (ID, Patient Number, Acquisition Time, Admission Time, Disposal Time, Feed Type) VALUES (@ id, @ Bh, @ fzsj, @ Rysj, @ cysj, @ fzlx) ; "; SQLCMD = SQL_Open SQL_ADD SQL_Close; SQLCMD = String.Format (S QLCMD, DBNAME, TABNAME, DBNAME, TABNAME); SQLCommand AddCMD28 = New SQLCOMMAND (Sqlcmd, this.dstcnn); addcmd28.parameters.add (New Sqlparameter ("@ ID", sqldbtype.int, 4, "id"); Addcmd28.Parameters.add ("@ BH", SqldbType.int, 4, "Patient No.")); AddCMD28.Parameters.Add (New SqlParameter ("@ fzsj", SqldbType.varchar, 50, "Jump Time ")); Addcmd28.parameters.add (New SqlParameter (" @ rysj ", sqldbtype.varchar, 50," Admission Time ")); addcmd28.parameters.add (new sqlparameter (" @ @ 入

Cysj ", SqldbType.varchar, 50," Discharge Time ")); addcmd28.parameters.add (" @ fzlx ", sqldbtype.int, 4," episode "); this.da_zyjlk .insertcommand = addcmd28 ; #Endregion # argion suicide or attack Database - Adapter command statement: SELECT and INSERT statement tabname = "D_ suicide or attack dictionary"; this.da_zsgjzdk = new sqldataadapter (); this.da_zsgjzdk.selectCommand = new SQLCommand ("SELECT * FROM D_ Suicide or Attack Database", this.dstcnn); SQL_ADD = "INSERT INTO D_ Suicide or Attack Database (ID, Suicide, or Attack Category) VALUES (@ ID, @ bcdt);"; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd29 = new SqlCommand (sqlCmd, this.dstCnn); addCmd29.Parameters.Add (new SqlParameter ( "@ ID ", Sqldbtype.int); addcmd29.parameters.add (" @ bcdt ", sqldbtype.varchar, 50)); addcmd29.parameters [" @ id "]. SourceColumn =" id "; addcmd29.parameters [ "@BCDT"]. SourceColumn = "Suicide or Attack Category"; this.da_zsgjzdk .insertCommand = addCMD29; #ENDREGION #REGON self-knowledge word library - Adapter command statement: SELECT and INSERT statement tabname = "D_ self-knowledge Power 库 "; this.da_zzlzdk = new Sqldat Aadapter (); this.da_zzlzdk.selectcommand = new sqlcommand ("SELECT * FROM D_ self-knowledge", this.dstcnn); SQL_ADD = "Insert INTO D_ self-knowledge word" (ID, self-knowledge category) ) values ​​(@ ID, @ BCDT); "; sqlCmd = sql_Open sql_Add sql_Close; sqlCmd = string.Format (sqlCmd, dbName, tabName, dbName, tabName); SqlCommand addCmd30 = new SqlCommand (sqlCmd, this.dstCnn); Addcmd30.Parameters.Add ("@ ID", Sqldbtype.InT); addcmd30.parameters.add (New Sqlparameter ("@ bcdt", sqldbtype.varchar, 50));

AddCMD30.Parameters ["@ ID"]. SourceColumn = "id"; addcmd30.parameters ["@ bcdt"]. SourceColumn = "self-knowledge category"; this.da_zzlzdk .insertcommand = addcmd30; #ndregion} /// < Summary> /// Fill the final data set /// private void fillendDataSet () {this.ndDataSet = new dataset (); this.da_bcdtzdk.fill (this.EndDataSet, "Disease Features Database "); This.da_brzlk .fill (this.EnddataSet," Patient Database "); this.da_fbyyzd.fill (this.Enddataset," Pathoction Dictionary "); this.da_fzlbzdk.fill (this.EndDataSet," episoding category Dictionary library "); this.da_fzcflbzdk.fill (this.EndDataSet," Crime penalty dairy Database "); this.da_glyxzdk.Fill (this.EndDataSet," Features Function Database "); this.da_fyzdk.fill (this." EndDataSet, "Marriage Database"); this.da_jzszd.fill (this.EnddataSet, "Family Historical Dictionary"); this.da_jylbzdk.Fill (this.EndDataSet, "Education Category Database"); this.da_jyztmlk.Fill This.EndDataSet, "Educational Topic Library"); this.da_jyztzmlk.fill (this.EndDataSet, "Education Special Brand Library"); this.da_jjzkzdk.Fill (this.EndDataSet, "Economic Status Database"); this .da_qzfszdk .fill (this.EndDataSet, "Help Dictionary Database"); this.da_sfjlxxk.fill (this.EndDataSet, "Follow-Up Log Information Library") "This.da_tfbzdk .fill (this.EndDataSet," That Database "); this.da_whcdzdk.fill (this.EndDataSet," Culture Dictionary Library "); this.da_wlzlxxxk.fill (this.EndDataSet," Physics Treatment information library "); this.da_xlzlxxk.fill (this.EndDataSet," Psychological Treatment Information Library "); this.da_xgzdk.fill (this.EndDataSet," Dictionary Database "); this.da_ywzlxxxk.fill (this.EndDataSet , "Drug Treatment Information Library"); this.da_yyxxk .fill (this.EndDataSet, "Hospital Information Library"); this.da_zdzdk .fill (this.EndDataSet, "Diagnostic Database"); this.da_zyzdk.fill (this .enddataaset, "Professional Dictionary"); this.da_zldlzdk.fill (this.EnddataSet, "

Treatment of big class dwares "); this.da_zllbzdk.fill (this.Enddatan," Treatment Category Database "); this.da_zlsk.fill (this.EnddataSet," Treatment History "); this.da_zlztmlk.Fill (this .EnddataSet, "Treatment Topic Library"); this.da_zlztzmlk.Fill (this.EnddataSet, "Treatment Special Brand Library"); this.da_zlztzdk.fill (this.EnddataSet, "Treatment Topic Dictionary"); Da_zyjlk.Fill (this.EnddataSet, "Hospital Record Library"); this.da_zsgjzdk.fill (this.EnddataSet, "Suicide or Attack Database"); this.da_zzlzdk.fill (this.EndDataSet, "self-knowledge word library ");} ///

/// Take the value of each subkey in the final data set --- Specification /// Source Dataset (DstdataSet) in each child in each subkey in // / Target Data Set The corresponding sub-items in the data dictionary /// The same sub-items are combined /// /// private void ruledstdata () {this.dstDataSet = THIS .SrcdataSet.copy (); this.dstDataSet.Acceptchanges (); // Do not fall #REGON to normalize the Class Database for the Class Database RefTab RF = New Reftab ("Treatment Category Database", "Treatment Class") This.Feixi ("Treatment Class Dictionary", "ID", "Treatment of Class Dictionary", "Id", RF); this.rulezidian ("Treatment Class Dictionary", "ID", "Category "," Treatment Category Database "," Treatment Class "); #ENDREGION

#Region Specification RF = New Reftab ("Treatment History", "Disease Features"); This.Feixi ("Disease Features Database", "ID", "Disease Features Database", " ID ", RF); this.rulezidian (" Disease Features Database "," Id "," Disease Features "," Treatment of History "," Disease Features "); #ndregion

#REGION to the pathogenesis of the dictionary library RF = New Reftab ("Treatment of History", "Pathogenesis"); this.Feixi ("Pathogenic Prescentives", "ID", "Pathocery Dictionary", "ID", "Id", RF); this.rulezidian ("Pathogenesis Dictionary", "Id", "Pathogenesis", "Treatment of History", "Pathogenesis");

#ENDREGION #Region Specifications RF = New Reftab ("Inpatient Recording", "Jials", "ID", "Idate Category Database", "ID", "Idate Category Database", "ID" "ID", RF); this.rulezidian ("Phase Category Database", "Id", "Site Category", "Hospital Recording Library", "Punch Type"); #ENDREGION #Region Crime penalty Database RF = New Reftab ("Followup Record Information Library", "Crime Penalty"); this.Feixi ("Criminal Penalty Database", "ID", "Crime Penalty Database", "ID", RF); this.rulezidian ("Criminal Penalty Dictionary", "ID", "Crime Punishment Category", "Follow-up Record Information Library", "Crime Punishment"); #ndregion

#Region's functional influence dictionary library this.feixi ("Feature Functional Dictionary Library", "ID", "Features Functional Database", "Id", "Follow-Up Library", "Social Leisure Function", "Occupational Function" , "Social Home Interaction", "Cognitive Function"); this.rulezidian ("Impact Dictionary Library", "Id", "Impact Description", "Follow-up Record Information Library", "Social Leisure Function", "Professional Function "," social home interaction "," cognitive function "); #ndregion #Region marriage word library Specifications RF = New Reftab (" Patient Database "," Marriage "); this.Feixi (" Marriage Database "," Fyid "," Marriage Database "," Fyid ", RF); this.rulezidian (" Marriage Database "," Fyid "," Marriage "," Patient Database "," Marriage "); # EndRegion #region Specifications to family history dictionary RF = New Reftab ("Treatment History", "Family History"); This.Feixi ("Family History Dictionary", "ID", "ID", "ID", Rf); this.rulezidian ("Family History Dictionary", "Id", "Family History", "Treatment of History", "Family History"); #ENDREGION #REGion Economic Status Class Specification RF = New Reftab (" Patient Database "," Economic Income "); this.Feixi (" Economic Status Dictionary "," JJZD "," JJZD ", RF); this.rulezidian (" Economic Status Dictionary " , "JJZD", "Economic Status", "Patient Database", "Economic Income"); #ENDREGION #REGON Help Dictionary library Specification RF = New Reftab ("Treatment History", "First Help Method"); THIS.FEIXI ("Help Dictionary Library", "ID", "Help Dictionary Database", "ID", RF); this.rulezidian ("Help Dictionary Database", "Id", "Help Method", " Treatment history "," First Help Method "); #ndregion #Region's Culture Level Database Specifications RF = New Ref Tab ("Patient Database", "Culture"; this.Feixi ("Culture Dictionary Library", "ID", "Culture Dictionary", "ID", RF); this.rulezidian ("Culture Dictionary library "," ID "," cultural level "," patient database "," cultural level ");

#endregion #Region Treatment RF = New Reftab ("Treatment History", "Personality"); This.Feixi ("Personality Dictionary", "ID", "Dictionary Database", "ID", RF ); This.rulezidian ("identical library", "ID", "character", "treatment history", "personality"); #ndregion #region occupational Dictionary library RF = New Reftab ("Patient Database" , "Professional"); this.feixi ("Professional Dictionary", "Zyid", "Professional Dictionary", "Zyid", RF); this.rulezidian ("Professional Dictionary", "Zyid", "career description "" Patient Database "," Professional "); #ndregion #Region to Suicide or Attack Database THISFEIXI (" Suicide or Attack Database "," ID "," Suicide or Attack Database "," ID " "Treatment of history", "suicide concept", "attack behavior"); this.rulezidian ("Suicide or Attack Database", "ID", "Suicide or Attack Category", "Treatment of History", "Suicide Concept "," Attack behavior "); #ndregion rf = new Reftab (" Treatment Class Database "," Treatment Class "); This.Feixi (" Treatment Class Dictionary "," ID "," Treatment of Class Dictionary Library "," ID ", RF); this.rulezidian (" Treatment Class Dictionary "," ID "," Category "," Treatment Category Database "," Treatment Class "); #Region's self-knowledge Dictionary library for normalization RF = New Reftab ("Follow-up Record Information Library", "Autonomous"); this.Feixi ("Idealistic Classic", "ID", "Self-knowledge Class", "ID ", RF); this.rulezidian (" Items "," Identification Category "," Follow-up Record Information Library "," Autonomous ");

#ndregion #Region Specification RF = New Reftab ("Physiotherapy Information Library", "Physiotherapy Information Library"); Reftab Ref2 = New Reftab ("Psychological Treatment Information Library", "Psychological Category"); reftab Ref3 = new Reftab ("Drug Treatment Information Library", "Drug Number"); This.Feixi ("Treatment Category Database", "ID", "Treatment Category Database", "ID", RF, REF2, REF3) This.rulezidian ("Treatment Category Database", "Id", "Treatment Category Description", "Physical Treatment Information Library", "Physical Category"); this.rulezidian ("Treatment Category Database", "ID", "Treatment Category", "Psychotherapy Information Library", "Psychological Category"); this.rulezidian ("Treatment Category Database", "Id", "Treatment Category Description", "Drug Treatment Information Library", "Drug Number "); #Ndregion #region Education Category Database RF = New Reftab (" Education Topic Library "," CLSID "); this.Feixi (" Education Category Database "," ID "," Education Class Dictionary ", "ID", RF); this.rulezidian ("Id", "JYDES", "Education Topic Library", "CLSID"); #ndregion #region Treatment Topic Dictionary Database THIS.RULEZIDIAN "Treatment Topic Dictionary", "Id", "ZTCLS", "Total Topic Library", "CLSID"); #ndregion this.Feixi ("The That Dismuttology", "ID", "Dictionary Library, "ID"); this.Ruletfbzdk (); // Diagnostic Database THISFEIXI ("Diagnostic Database", "ID", "Diagnostic Database", "ID"); this.rulezdzdk (); // Hospital Information Library This.Feixi ("Hospital Information Library", "ID", "Hospital Information Library", "Id", "Hospital Database", "Hospital Number"); this.rulezidian ("Hospital Information Library" , "ID", "Hospital Name", "Patient Database", "Hospital Number"); // Add other table Reftab cp1 = new reftab (" Follow-up record information library "," patient number "); Reftab CP2 = New Reftab (" Hospital Recording "," Patient No. "); Reftab CP3 = New Reftab (" Treatment History "," Patient No. "); Feixi ("Patient Database", "ID", "Patient Database", "Id", CP1, CP2, CP3);

THIS.TABLEROWADD ("Patient Database", "Patient Database"); CP1 = New Reftab ("Drug Treatment Information Library", "Treatment Record Number"); CP2 = New REFTAB ("Physical Therapy Information Library", "Treatment Record number "); CP3 = New Reftab (" Drug Treatment Information Library "," Treatment Record Number "); This.Feixi (" Reporter "," ID "," Hospital Recording Library "," ID ", CP1, CP2, CP3); this.TableRowadd ("Reporter", "Hospital Recording Library");

THIS.FEIXI ("Treatment of History", "ID", "Treatment of History", "ID"); this.TableRowadd ("Treatment History", "Treatment of History");

This.Feixi ("follow-up log information", "id", "follow-up log library", "id"); this.tableRowadd ("follow-up log library", "follow-up log information"); / this.Feixi ("Drug Treatment Information Library", "ID", "Medicine Treatment Information Library", "ID"); this.TableRowadd ("Drug Treatment Information Library", "Drug Treatment Information Library");

This.Feixi ("Physiotherapy Information Library", "ID", "Physical Therapy Information Library", "ID"); this.TableRowadd ("Physical Therapy Information Library", "Physical Therapy Information Library");

THIS.FEIXI ("Psychotherapy Information Library", "ID", "Psychotherapy Information Library", "ID"); this.TableRowadd ("Psychological Treatment Information Library", "Psychotherapy Information Library");

CP1 = New REFTAB ("Education Special Subscription", "Farid"); this.Feixi ("Education Topic Library", "ID", "Education Topics Library", "ID", CP1); this.TableRowadd ("Education Topic Library", "Education Topic Library");

THIS.FEIXI ("Education Special Subscription", "ID", "Education Special Brand Library", "ID"); this.TableRowadd ("Education Special Subscription", "Education Special Subscription");

CP1 = New Reftab ("Treatment Special Book", "PARENT"); this.Feixi ("Treatment Topic Library", "ID", "Treatment Topics Library", "ID", CP1); this.TableRowadd ("Treatment Topics Library", "Treatment Topic Library"); This.Feixi ("Treatment Special Subscription", "ID", "Treatment Special Subscription", "ID"); this.TableRowadd (" Treatment Special Subprint "," Treatment Special Subprint "); this.isek = true;

} ///

/// Modify the same disease word library /// private void Ruletfbzdk () {string zdname = "String Valkey =" String "; String zdPryKey = "ID"; string refTabName = "follow-up record repository"; System.Collections.Hashtable hst = new Hashtable (); foreach (DataRow srcDr in this.dstDataset.Tables [zdName] .Rows) {string idstr = srcDr [ Valkey] .tostring () .trim (); foreach (DATAROW Enddr in this.enddataSet.tables [zdname ].ROWS) {string endstr = enddr [Valkey] .tostring () .trim (); if (endstr == idstr ) // Value the same {hst.add (srcdr [zdprykey] .tostring (), enddr [zdprykey] .tostring () .trim ();}}} foreach (DATAROW SRCDR in this.dstDataSet.tables [zdname] .Rows) {string idstr = srcdr [zdprykey] .tostring () .trim (); if (! Hst.contains (idstr)) {Add new row to dictionary library DATAROW DR = this.EndDataSet.tables [zdname] .newrow (); Foreach (Datacolumn DC in this.EndDataSet.Tables [zDName] .COLUMNS) {DR [dc.columnname] = srcdr [dc.columnname];} this.EnddataSet.tables [zdname]. Rows .ADD (DR);}} // Update association line Foreach (DATAROW DRC IN this.dstdataSet.tables [Reftabname ].ROWS) {String Rings = DRC ["Same Disease"] .tostring (); string [] Opcstr = relasstr.trim () .split (new char [] {','}); for (int i = 0; i

} Relasstr ​​= ""; for (int i = 0; i

This.dstdataSet.Tables [ReftabName] .acceptchange (); hst.clear ();} ///

/// Modify Diagnostic Database /// private void rulexdzdk () {string zdname = " diagnosis dictionary library "; string valKey =" diagnosis "; string zdPryKey =" ID "; System.Collections.Hashtable hst = new Hashtable (); foreach (DataRow srcDr in this.dstDataset.Tables [zdName] .Rows) {string idstr = Srcdr [Valkey] .tostring () .trim (); foreach (DATAROW Enddr in this.EnddataSet.tables [zdname] .ROWS) {string endstr = enddr [VALKEY] .tostring () .trim (); if (EndStr) == IDSTR) // Take the same {hst.add (srcdr [zdprykey] .tostring (), enddr [zdprykey] .tostring () .trim ());}

}}} Foreach (DATAROW SRCDR in this.dstDataSet.tables [zDName] .ROWS) {string idstr = srcdr [zdprykey] .tostring () .trim (); if (! Hst.contains (idstr)) {Add new line to Database DATAROW DR = this.EndDataSet.Tables [zdname] .newrow (); foreach (DCOLUMN DC in this.EndDataSet.tables [zdname] .COLUMNS) {DR [dc.columnname] = srcdr [dc.columnname];} This.EnddataSet.Tables [zdname] .Rows .add (dr);}}} ///

///} /// Source Dataset DSTDataSet in DSTDataSet /// Target Data Set" Name of EndDataSet Private Void TableRowadd (String Srctabname, String Dstabname) {INT ks = dstDataset.Tables [srcTabName] .Columns.Count; foreach (DataRow dr in dstDataset.Tables [srcTabName] .Rows) {DataRow nwDr = this.endDataset.Tables [dstTabName] .NewRow (); foreach (DataColumn dc in dstDataset .Tables [srctabname] .columns) {nwdr [dc.columnname] = DR [dc.columnname];} this.enddatanet.tables [DST TabName]. ROWS.ADD (NWDR);

} ///

/// Specification Dictionary and its association table /// /// Dictionary table /// Key Frame Name /// The corresponding value field name /// association table ///// linked list of field names private void RuleZiDian (string zdName, string zdPryKey, string valKey, string refTabName, params string [] zdList) {System.Collections.Hashtable hst = new Hashtable () Foreach (DATAROW SRCDRIS [ZDNAME]. ROWS) {string idstr = srcdr [VALKEY] .tostring () .trim (); foreach (DATAROW Enddr in this.enddatatet.tables [zdname ].ROWS) {String endstr = enddr [varkey] .tostring () .trim (); if (endstr == idstr) // Value the same {hst.add (srcdr [zdpryKey] .tostring (), enddr [zdprykey] .tostring ) .Trim ());}}} foreach (DATAROW SRCDR in this.dstdataSet.tables [zdname ].ROWS) {string idstr = srcdr [zdprykey] .tostring () .trim (); if (! Hst.contain); IDSTR)) {Add New Row to Dictionary Library Database DR = this.EndDatase T.TABLES [ZDNAME] .NEWROW (); Foreach (Datacolumn DC in this.EndDataSet.Tables [zdname] .COLUMNS) {DR [DC.COLUMNNAME] = srcdr [dc.columnname];} this.EnddataSet.Tables [zdname ] .Rows .add (dr);}} // Update association line Foreach (DATAROW DRC IN THISTSTDATASET.TABLES [ReftabName ].ROWS) {FOREACH (String ZDC in ZDList) {String BC = DRC [ZDC] .tostring (); If (hst.contains (bc)) {DRC [ZDC] = HST [BC] .tostring ();}}}

THISTDATASet.Tables [ReftabName] .acceptchange (); hst.clear ();} ///

/// The data set (endDataSet) back to the database / // execute the update operation DA_XXXXXXXXXXXXXXXX. Update (); /// /// private void dataimport () {// things start IF (this.dstcnn.state == connectionState.closed) this.dstcnn.open (); system.data.sqlclient .SqlTransaction trans = this.dstCnn.BeginTransaction (System.Data.IsolationLevel.Serializable, "DhzTrans"); // update the dictionary database this.da_Bcdtzdk.InsertCommand.Transaction = trans; this.da_Bcdtzdk.Update (this.endDataset, "course Dictionary features library "); this.da_Fbyyzd.InsertCommand.Transaction = trans; this.da_Fbyyzd .Update (this.endDataset," predisposing Dictionary "); this.da_Fzlbzdk.InsertCommand.Transaction = trans; this.da_Fzlbzdk.Update (this .enddataaset, "Phase Category Database"); this.da_fzcflbzdk.insertcommand.TransAction = Trans; this.da_fzcflbzdk.Update (this.Enddata, "Crime penalty Database"); this.da_glyxzdk.insertCommand.Transaction = Trans; this.da_glyxzdk.Update (this.EndDataSet, "Feature Function Database"); this.da_fyzdk.insertCommand .Transaction = trans; this.da_fyzdk.update (this.Enddatan); this.da_jzszd.insertcommand.Transaction = Trans; this.da_jzszd.Update (this.EnddataSet, "Family Historical Dictionary"); this .da_Jjzkzdk.InsertCommand.Transaction = trans; this.da_Jjzkzdk .Update (this.endDataset, "the economic situation Dictionary library"); this.da_Qzfszdk.InsertCommand.Transaction = trans; this.da_Qzfszdk.Update (this.endDataset, "help-seeking Dictionary library "); this.da_tfbzdk.insertcommand.Transaction = trans; this.da_tfbzdk.Update (this.nddatan," That is the disease word "); this.da_whcdzdk.insertCommand.Transaction = Trans; this.da_whcdzdk.update this.EnddataSet, "

Culture Dictionary Library "); this.da_xgzdk.insertCommand.Transaction = Trans; this.da_xgzdk.Update (this.EndDataSet," Person Dictionary "); this.da_zdzdk.insertcommand.Transaction = Trans; this.da_zdzdk.update This.EndDataSet, "Diagnostic Database"); this.da_zyzdk.insertCommand.TransAction = Trans; this.da_zyzdk.Update (this.nddatan); this.da_zsgjzdk.insertCommand.Transaction = Trans; this. Da_ZSGJZDK.UPDATE (this.EndDataSet, "Suicide or Attack Database"); this.da_zzlzdk.insertCommand.Transaction = Trans; this.da_zzlzdk.Update (this.EndDataSet, "Self-knowledge Layer"); // Treatment Class Dictionary Library No need to update this.da_zllbzdk.insertcommand.transaction = trans; this.da_zllbzdk.update (this.Enddatan "); // Education Topic THIS.DA_JYLBZDK.INSERTCOMMAND.TRANSACTION = Trans; this.da_jylbzdk .Update (this.enddatan); this.da_jyztmlk.insertcommand.trarsaction = trans; this.da_jyztmlk.Update (this.EnddataSet, "Education Topic Library"); this.da_jyztzmlk.insertCommand.Transaction = Trans; this.da_jyztzmlk.Update (this.EndDataSet, "Education Special Subscription"); // Treatment THIS.DA_ZLZT ZDK.insertCommand.Transaction = Trans; this.da_zlztzdk.Update (this.Enddatan "); this.da_zlztmlk.insertcommand.transaction = trans; this.da_zlztmlk .update (this.EnddataSet," Total catalog "); This.da_zlztzmlk.insertcommand.transaction = trans; this.da_zlztzmlk .Update (this.Enddata," Treatment Special Brand Library "); // Patient Database THIS.DA_YXXXK.INSERTCOMMAND.TRANSACTION = Trans; this. Da_YYXXK.UPDATE (THIS.EndDataSet, "Hospital Information Library"); this.da_brzlk.insertcommand.Transaction = Trans; this.da_brzlk.Update (this.EndDataSet, "Patient Database"); this.da_zlsk.insertCommand.Transaction = TRANS;

THIS.DA_ZLSK.UPDATE (THIS.EndDataSet, "Treatment History"); this.da_sfjlxxk.insertCommand.Transaction = Trans; this.da_sfjlxxk.Update (this.EnddataSet, "follow-up log library"); this.da_zyjlk.insertCommand .Transaction = trans; this.da_zyjlk.update (this.EnddataSet, "Hospital Record"); // XX Treatment this.da_ywzlxxxk.insertcommand.Transaction = Trans; this.da_ywzlxxk.Update (this.EndDataSet, "drug therapy information "); This.da_wlzlxxk.insertcommand.transaction = trans; this.da_wlzlxxk.update (this.EnddataSet," Physical Therapy Information Library "); this.da_xlzlxxk.insertCommand.Transaction = Trans; this.da_xlzlxxk.update (this. EndDataSet, "Psychotherapy Information Library"); Trans.commit (); MessageBox.show ("Import Success!"); //

} #Endregion

}

转载请注明原文地址:https://www.9cbs.com/read-101299.html

New Post(0)