20041220类 MYDATA.CS

using System;
using System.Data ;
//using System.Data.SqlClient  ;
using System.Data.SqlClient;
using System.Timers;
using System.Collections;
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数据录入  科室表
  //***********************************************************
  public static 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);
   //其它数据
   //mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   //mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]); 
   mycommand.ExecuteNonQuery();
   db.Close();  
  }

  //***********************************************************
  //*ypfl数据录入   药品分类
  //***********************************************************
  public static 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);
   //其它数据
   //mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   //mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]); 
   mycommand.ExecuteNonQuery();
   db.Close();  
  }

  //***********************************************************
  //*hslb数据录入   核算类表
  //***********************************************************
  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);
   //其它数据
   //mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   //mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]); 
   mycommand.ExecuteNonQuery();
   db.Close();  
  }

  //***********************************************************
  //*hslb数据录入   收费类别
  //***********************************************************
  public static void sflb_add(string name,string ksbitem)
  {
   string sqlstring="insert into sflb(name,ksbitem) values(@name,@ksbitem)";
   SqlConnection db =new SqlConnection (mydb.ConnectionString);
   db.Open() ;
   SqlCommand mycommand  = new SqlCommand(sqlstring, db);
   mycommand.Parameters.Add("@name",name);
   mycommand.Parameters.Add("@ksbitem",ksbitem);
   //其它数据
   //mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   //mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]); 
   mycommand.ExecuteNonQuery();
   db.Close();  
  }

  //***********************************************************
  //*ypzl数据录入   药品资料
  //***********************************************************
  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,@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",price);
   mycommand.Parameters.Add("@made",made);

   mycommand.Parameters.Add("@itemshap",itemshap);
   mycommand.Parameters.Add("@sflb",sflb);
   mycommand.Parameters.Add("@hslb",hslb);
   mycommand.Parameters.Add("@ypfl",ypfl);

   mycommand.Parameters.Add("@ed",ed);
   mycommand.Parameters.Add("@memory",memory);

   //其它数据
   //mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   //mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]); 
   mycommand.ExecuteNonQuery();
   db.Close(); 
  }

  //***********************************************************
  //*zlxm数据录入   诊疗项目   注(诊疗项目 药品资料结构相同)
  //***********************************************************
  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,@itemshap,@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",price);
   mycommand.Parameters.Add("@made",made);

   mycommand.Parameters.Add("@itemshap",itemshap);
   mycommand.Parameters.Add("@sflb",sflb);
   mycommand.Parameters.Add("@hslb",hslb);
   mycommand.Parameters.Add("@ypfl",ypfl);

   mycommand.Parameters.Add("@ed",ed);
   mycommand.Parameters.Add("@memory",memory);

   //其它数据
   //mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   //mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]); 
   mycommand.ExecuteNonQuery();
   db.Close(); 
  }


  
  //***********************************************************
  //*ysb数据录入   医生表
  //***********************************************************
  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",worker);
   mycommand.Parameters.Add("@ksb",ksb);
   mycommand.Parameters.Add("@ed",ed);
   mycommand.Parameters.Add("@memory",memory);

   //其它数据
   //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数据录入
  //*
  //*
  //***********************************************************
  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);

   //其它数据
   mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
   mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]);
  

   mycommand.ExecuteNonQuery();
   db.Close();  
  }


  //***********************************************************
  //*articles数据录入
  //*
  //*
     //***********************************************************
  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",photofile);
  mycommand.Parameters.Add("@OTHER",OTHER);
  //其它数据
         mycommand.Parameters.Add("@updatetime",System.DateTime.Now.ToShortDateString());
  mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]);
  

  mycommand.ExecuteNonQuery();
  db.Close();  
  }


  
  //***********************************************************
  //*articles数据录入
  //*
  //*
  //***********************************************************
  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",photofile);
   mycommand.Parameters.Add("@OTHER",OTHER);
   //其它数据
   mycommand.Parameters.Add("@uploadtime",System.DateTime.Now);
   mycommand.Parameters.Add("@ip",System.Web.HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]);

   mycommand.ExecuteNonQuery();
   db.Close();   
  }

 


 }
//}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值