VB医院管理系统毕业论文 第9页存盘按钮代码:
//存盘
private void Button3_Click(object sender, System.EventArgs e)
{
Button1.Enabled=false;
string ghlx="";
TextBox8.Text=money4.ToString()+"元";
admin admin2=new admin();
ghlx=DropDownList6.SelectedItem.Text.Trim();
money1=admin2.getMoney1(ghlx);
money2=admin2.getMoney2("诊疗");
if(CheckBox1.Checked)
{
money3=admin2.getMoney2("病历工本费");
money4=money1+money2+money3;
}
else
money4=money1+money2;
//*******************************************
string xm,xb,nl,mz,hf,lxdh,jtzz,fylx,ghks,ysxm,bh,zlf,blgbf,ghf,ghsj;
int add1=1;
xm=TextBox1.Text.Trim();
xb=DropDownList1.SelectedItem.Text.Trim();
nl=Textbox10.Text.Trim();
mz=DropDownList4.SelectedItem.Text.Trim();
hf=DropDownList2.SelectedItem.Text.Trim();
lxdh=TextBox2.Text.Trim();
jtzz=TextBox3.Text.Trim();
fylx=DropDownList3.SelectedItem.Text.Trim();
ghlx=DropDownList6.SelectedItem.Text.Trim();
ghks=DropDownList5.SelectedItem.Text.Trim();
ysxm=DropDownList7.SelectedItem.Text.Trim();
bh=TextBox4.Text.Trim();
ghf=TextBox5.Text.Trim();
zlf=TextBox6.Text.Trim();
blgbf=TextBox7.Text.Trim();
ghsj=TextBox9.Text.Trim();
string czy=Session["name"].ToString();
if (xm=="")
Response.Write("<script language='javaScript'>window.alert('姓名不能为空!');</script>");
else
{
Hashtable ht=new Hashtable();
ht.Add("xm",SqlStringFormat.GetQuotedString(xm));
ht.Add("xb",SqlStringFormat.GetQuotedString(xb));
ht.Add("nl",SqlStringFormat.GetQuotedString(nl));
ht.Add("mz",SqlStringFormat.GetQuotedString(mz));
ht.Add("hyzk",SqlStringFormat.GetQuotedString(hf));
ht.Add("tel",SqlStringFormat.GetQuotedString(lxdh));
ht.Add("jtzz",SqlStringFormat.GetQuotedString(jtzz));
ht.Add("fylx",SqlStringFormat.GetQuotedString(fylx));
ht.Add("ghlx",SqlStringFormat.GetQuotedString(ghlx));
ht.Add("ghks",SqlStringFormat.GetQuotedString(ghks));
ht.Add("jzys",SqlStringFormat.GetQuotedString(ysxm));
ht.Add("id",SqlStringFormat.GetQuotedString(bh));
ht.Add("ghf",SqlStringFormat.GetQuotedString(ghf));
ht.Add("zlf",SqlStringFormat.GetQuotedString(zlf));
ht.Add("blgbf",SqlStringFormat.GetQuotedString(blgbf));
ht.Add("ghsj",SqlStringFormat.GetQuotedString(ghsj));
ht.Add("czy",SqlStringFormat.GetQuotedString(czy));
ht.Add("gsje",money4);
ht.Add("sfjz",'1');
admin admin1=new admin()
if (bh.Substring(16,4)=="0001")
add1=0001;
else
add1=Int32.Parse(bh.Substring(16,4));
ht.Add("addnum",add1);
int bz=admin1.addinfo(ht,"ghb");
if (bz!=-1)
{
admin1.gengxinghl(ghks,ysxm);
Response.Write("<script language='javaScript'>window.alert('存盘成功!');</script>");
Button3.Enabled=false;
Button4.Enabled=true;
}
else
Response.Write("<script language='javaScript'>window.alert('存盘失败!');</script>");
}
}
addinfo()函数在业务逻辑层实现代码如下:
//信息存盘
public int addinfo(Hashtable Cols,string tablename)
{
int Count = 0;
if (Cols.Count<=0)
{
Console.Write ("this section isn't excuted!");
return 0;
}
string Fields = "(";
string Values = " Values(";
foreach(DictionaryEntry item in Cols)
{
if (Count!=0)
{
Fields += ",";
Values += ",";
}
Fields += "["+item.Key.ToString()+"]";
Values += item.Value.ToString();
Count ++;
Console.WriteLine ("the value of count is: {0}", Count);
}
Fields += ")";
Values += ")";
string SqlString = "Insert into "+tablename+Fields+Values;
Database db= new Database();
return db.ExecuteSql(SqlString);
}
ExecuteSql()函数在数据库访问层实现代码如下:
public int ExecuteSql(string strSql)
{
int RecordCount=-1;
try
{
Open();
SC = new SqlCommand(strSql,Conn);
RecordCount = SC.ExecuteNonQuery();
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
VB医院管理系统毕业论文 第9页下载如图片无法显示或论文不完整,请联系qq752018766