Using system; using system.data.sqlclient; using system.data.sqlclient; using system.timers; using system.collections.specialized;
using System.IO; using System.Web; using System.Web.UI; using System.Web.Caching; using System.Configuration; using System.Text; using System.Text.RegularExpressions; using System.Web.UI.WebControls; // namespace zqfk.controls // {public class mydata {public mydata () {}
// ******************************************************** *********** // * KSB data entry department table // *************************************** *************************************** PUBLIC VOID KSB_ADD (STRING NAME) {String Sqlstring = "INSERT INTO KSB (NAME) VALUES (@name) "; SqlConnection DB = New SqlConnection (mydb.connectionstring); db.open (); sqlcommand mycommand = new sqlcommand (sqlstring, db); mycommand.parameters.add (" @ name ", name); // Other data //mycommand.parameters.add ("@ updatetime", system.datetime.now.toshortdateString ()); //mycommand.parameters.add("@ip" ,stem.web.httpContext.current.Request.ServerVariables ["Local_ADDR"]); mycommand.executenonury (); db.close ();
// ******************************************************** ********** // * YPFL data entry drug classification // ************************************** *************************************** PUBLIC VOID YPFL_ADD (STRING NAME) {String Sqlstring = "INSERT INTO YPFL (Name) VALUES (@name) "; SqlConnection DB = New SqlConnection (mydb.connectionstring); db.open (); sqlcommand mycommand = new sqlcommand (sqlstring, db); mycommand.parameters.add (" @ name ", name); // Other data //mycommand.parameters.add ("@ updatetime", system.datetime.now.toshortdateString ()); //mycommand.parameters.add("@ip" ,stem.web.httpContext.current.Request.ServerVariables ["Local_addr"]); myCommand.executenonQuery (); db.close ();} // **************************************** ******************************* // * HSLB data entry account class // *************** *********************************************************** * Public static void hslb_add (string name) {string sqlstring = "INSERT INTO HSLB (Name) VALUES (@Name)"; SqlConnection DB = New SqlConnection (mydb.connectionstring); db.open () SQLCommand mycommand = new sqlcommand (sqlstring, db); mycommand.parameters.add ("@ name", name); // Other data //mycommand.Parameters.add("@updatetime" ,system.datetime.now.toshortDateString ()); //Mycommand.parameters.add ("@ip" ,stem.web.httpContext.current.request.servervariables ["local_addr "]); mycommand.executenonQuery (); db.close ();}
// ******************************************************** ********** // * HSLB data entry fee category // **************************************** **************************************** Public Static void sflb_add (string name, string ksbit) {string sqlstring = "INTO SFLB ( name, ksbitem) values (@ @ ksbitem name,) "; SqlConnection db = new SqlConnection (mydb.ConnectionString); db.Open (); SqlCommand mycommand = new SqlCommand (sqlstring, db); mycommand.Parameters.Add (" @ Name ", name); mycommand.parameters.add (" @ Ksbitem ", ksbitem); // Other data //mycommand.parameters.add (" @ updatetime ", system.datetime.now.toshortdateString ()); ///// MyCommand.Parameters.add ("@ ip", system.Web.httpContext.current.request.servervariables ["local_addr"]); mycommand.executenon query (); db.close ();}
// ******************************************************** ********** // * YPZL data entered drug information // ************************************** *************************************** Public Static Void Ypzl_ADD (String Name, String Shap, String Unit, Float Price, String Made, string itemshap, string sflb, string hslb, string ypfl, bool ed, string memory) {string sqlstring = "insert into ypzl (name, gb, [shap], unit, price, made, itemshap, sflb, hslb, ypfl, ed , [MEMORY]) VALUES (@ Name, @ GB, @ shap, @ unit, @ price, @ made, @ Itemshap, @ sflb, @ hslb, @ ypfl, @ Ed, @MMORY); SQLConnection DB = New SqlConnection (mydb.connectionstring); db.open (); sqlcommand mycommand = new sqlcommand (sqlstring, db); mycommand.parameters.add ("@ name", name); mycommand.parameters.add ("@ GB", Mygetstring. GetChineseSpell () .tostring ()); mycommand.parameters.add ("@ shap", shap); mycommand.parameters.add ("@ unit", unit); mycommand.parameters.add ("@ price", Price ); Mycommand.parameters.add ("@ Made", Made); mycommand.parameters.add ("@ itemshap", itemshap); mycommand.parameters.ad D ("@ sflb", sflb; mycommand.parameters.add ("@ HSLB", HSLB); mycommand.parameters.add ("@ ypfl", ypfl);
MyCommand.Parameters.Add ("@ ed", ed); mycommand.parameters.add ("@Memory", Memory;
// Other data //mycommand.parameters.add ("@ updatetime", system.datetime.now.toshortdateString ()); //mycommand.parameters.add("@ip" ,stem.web.httpContext.current.Request .SerVariables ["local_addr"]); mycommand.executenonquery (); db.close ();
// ******************************************************** ********** // * ZLXM data entry diagnosis and treatment project Note (the diagnosis and treatment project drug data structure is the same) // ******************** *********************************************** Public Static Void ZLXM_ADD (String Name, String SHAP, string unit, float price, string made, string itemshap, string sflb, string hslb, string ypfl, bool ed, string memory) {string sqlstring = "insert into zlxm (name, gb, [shap], unit, price, made, Itemshap, SFLB, HSLB, YPFL, ED, [Memory]) Values (@ name, @ GB, @ shap, @ unit, @ price, @ made, @ @ @ sflb, @ hslb, @ ypfl, @ Ed, @ memory) "; SqlConnection db = new SqlConnection (mydb.ConnectionString); db.Open (); SqlCommand mycommand = new SqlCommand (sqlstring, db); mycommand.Parameters.Add (" @ name ", name); mycommand.Parameters. Add ("@ GB", Mygetstring.getChineseSpell (Name) .tostring ()); MyCommand.Parameters.Add ("@ shap", shap); mycommand.parameters.add ("@ unit", unit); mycommand.parameters .Add ("@ price"; mycommand.parameters.add ("@ Made", Made); mycommand.parameters.add ("@ itemshap", itemshap); Myco Mmand.Parameters.Add ("@ sflb", sflb); mycommand.parameters.add ("@ hslb", hslb; mycommand.parameters.add ("@ ypfl", ypfl);
MyCommand.Parameters.Add ("@ ed", ed); mycommand.parameters.add ("@Memory", Memory;
// Other data //mycommand.parameters.add ("@ updatetime", system.datetime.now.toshortdateString ()); //mycommand.parameters.add("@ip" ,stem.web.httpContext.current.Request .SerVariables ["local_addr"]); mycommand.executenonquery (); db.close ();
// ******************************************************** *********** // * YSB data entry doctor table // **************************************** *************************************** Public Static Void YSB_ADD (String Name, String Sex, String Addr, String Tel, String ZIP, String Worker, String Ksb, Bool Ed, String Memory {String Sqlstring = "Insert Into Ysb (Name, GB, SEX, ADDR, TEL, ZIP, WORKER, KSB, ED, MEMORY) VALUES (@ Name, @ GB, @ SEX, @ addr, @ tel, @ zip, @ worker, @ Ksb, @ ed, @Memory; sqlconnection db = new sqlconnection (mydb.connectionstring); db.open (); sqlcommand mycommand = new sqlCommand (Sqlstring, DB); MyCommand.Parameters.Add ("@ name", name); mycommand.parameters.add ("@ GB", mygetstring.getChineseSpell (Name) .tostring ()); mycommand.parameters.add ("@ sex" , SEX); MyCommand.Parameters.Add ("@ addr", addr; mycommand.parameters.add ("@ tel", tel); mycommand.parameters.add ("@ zip", zip); mycommand.parameters. Add ("@ worker"; mycommand.parameters.add ("@ Ksb", KSB); mycommand.parameters.add ("@ ed", ed); M Ycommand.Parameters.add ("@Memory"; // Other Data //mycommand.parameters.add ("@ UpdateTime", System.Datetime.now.toshortdateString ()); //mycommand.parameters.add ( "@ip", system.Web.httpContext.current.request.servervariables ["local_addr"]); mycommand.executenonQuery (); db.close ();
// ******************************************************** ********** // * Product data entry // * // * / ************************ ********************************************* Public Static Void Product_Add (int BoardID, String Product_name, String Product_Memory, String Shape , string other) {string sqlstring = "insert into product (boardid, product_name, product_memory, shape, other, updatetime, ip) values (@ boardid, @ product_name, @ product_memory, @ shape, @ other, @ updatetime, @ ip) "; SqlConnection db = new SqlConnection (mydb.ConnectionString); db.Open (); SqlCommand mycommand = new SqlCommand (sqlstring, db); mycommand.Parameters.Add (" @ boardid ", boardid); mycommand.Parameters.Add ( "@product_name", product_name); mycommand.Parameters.Add ( "@ product_memory", product_memory); mycommand.Parameters.Add ( "@ shape", shape); mycommand.Parameters.Add ( "@ other", other); // Other Data Mycommand.Parameters.add ("@ UpdateTime", System.datetime.now.toshortdateString ()); MyCommand.Parameters.Add ("@ ip", System.Web.httpContext.curre Nt.Request.servervariables ["local_addr"]);
MyCommand.executenonQuery (); db.close ();
// ******************************************************** *********** // * Articles Data Retriever // * // * // ************************* ********************************************* PUBLIC Static Void Articles_ADD (int Art_col_sub, string art_title, string art_body, string photofile , string OTHER) {string sqlstring = "insert into articles (art_col_sub, art_title, art_body, photofile, OTHER, uploadtime, ip) values (@ art_col_sub, @ art_title, @ art_body, @ photofile, @ OTHER, @ uploadtime, @ ip) "; SqlConnection db = new SqlConnection (mydb.ConnectionString); db.Open (); SqlCommand mycommand = new SqlCommand (sqlstring, db); mycommand.Parameters.Add (" @ art_col_sub ", art_col_sub); mycommand.Parameters.Add ( "@ART_TITLE", ART_TITLE; MyCommand.Parameters.Add ("@ Art_body", Art_Body); MyCommand.Parameters.Add ("@photofile"; mycommand.parameters.add ("@ @", ot); // Other Data MyCommand.Parameters.add ("@ UpdateTime", System.dateTime.now.toshortdateString ()); MyCommand.Parameters.add ("@ i), System.Web.httpContext.current.re Quest.servervariables ["local_addr"]); mycommand.executenonquery (); db.close ();
// ******************************************************** *********** // * Articles Data Retriever // * // * // ************************* ********************************************** Public Static Void Articles_UPDATE (String ID, String Art_TITLE, STRING Art_Body, String Photofile , string OTHER) {string sqlstring = "update articles set [art_title] = @ art_title, [art_body] = @ art_body, [photofile] = @ photofile, [OTHER] = @ OTHER, [uploadtime] = @ uploadtime, [ip] = @ ip where id = " id; SqlConnection db = new SqlConnection (mydb.ConnectionString); db.Open (); SqlCommand mycommand = new SqlCommand (sqlstring, db); mycommand.Parameters.Add (" @ art_title ", art_title ); Mycommand.parameters.add ("@ art_body", art_body); mycommand.parameters.add ("@photofile"; mycommand.parameters.add ("@ @", other); // Other data MyCommand. Parameters.Add ( "@ uploadtime", System.DateTime.Now); mycommand.Parameters.Add ( "@ ip", System.Web.HttpContext.Current.Request.ServerVariables [ "LOCAL_ADDR"]); mycommand.ExecuteNonQuery () DB.Close ();
} //}