⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 paymenu.aspx.cs

📁 医院的用户管理与缴费与当病人去医院看病的时候要挂号等作用。
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class BusinessSys_paymenu : System.Web.UI.Page
{
    string adminid = "";
    string perid ="";
    string pername="";
    string perdepid="";
   string name = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        
       
       
        if (!IsPostBack)
        {

            if (Session["perid"] != null)
            {
                adminid=Session["id"].ToString();
                admin na=new admin ();
               DataTable n= na.idinfo(adminid,Page);
                Label5.Text = n.Rows[0]["adminname"].ToString();
                perid = Session["perid"].ToString();
                pername = Session["pername"].ToString();
                perdepid = Session["perdepid"].ToString();
                dbind();
                Label1.Text = pername;
                string sql = "select * from department where depid=" + perdepid;
                DataTable nam = GenericDataAccess.ExecuteSelectCommand(sql, Page);
                Label2.Text = nam.Rows[0]["dename"].ToString();
                Label3.Text = nam.Rows[0]["sectype"].ToString();
            }
            else
            {
                Response.Redirect("~/error.aspx");
            }
        }
        else
        {
            double m=0;
            for (int i = 0; i < DataList1.Items.Count; i++)
            {
                CheckBox cd = DataList1.Items[i].FindControl ("select") as CheckBox;
                if (cd.Checked == true)
                {
                    Label mt = DataList1.Items[i].FindControl("btotalmoney") as Label;
                  m+=  Convert.ToDouble(mt.Text);
                }
            }
            string mm = Convert.ToString(m *(100-Convert.ToDouble(Label3.Text)) / 100);
            Label4.Text = mm;
        }
            
    }
    public void dbind()
    {
        bill data = new bill();
        string type = Session["type"].ToString();
        if (type == "医院管理员")
        {
            bill aidtohid =new bill ();
            string hosid= aidtohid.adminidtohosid(adminid,Page).Rows [0]["hosid"].ToString();
           
            DataTable pm = data.conhpunpay(hosid, perid, Page);

            DataList1.DataSource = pm.DefaultView;
            DataList1.DataBind();
        }
        else if (type == "药店管理员")
        {
            bill aidtodid = new bill();
            string drugid = aidtodid.adminidtodrugstoreid(adminid,Page).Rows [0]["drugstoreid"].ToString();
            DataTable pm = data.condsunpay(drugid, perid, Page);
            DataList1.DataSource = pm.DefaultView;
            DataList1.DataBind();
        }
    }
    //private DataTable paymenu(int id, Page p)
    //{
    //    string sql = "select * from consume where personid="+id+"and hosid and payed is null";
    //   DataTable menu= GenericDataAccess.ExecuteSelectCommand(sql, Page);
    //   return menu;
    //}
    protected void Button1_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < DataList1.Items.Count; i++)
        {
            CheckBox d =DataList1.Items[i].FindControl("select") as CheckBox;
            if (d.Checked == true)
            {
                int conid;
                Label id = DataList1.Items[i].FindControl("consumeid") as Label;
                conid = Convert.ToInt32(id.Text);
                payedment(conid);
                Response.Write("<script language=javascript>alert('付款成功')</script>");
                Response.Redirect("paymenu.aspx");
 
            }
        }
    }

    protected void payedment(int id)
    {
        string sql = "update consume set payed='已付款' where consumid=" + id;
        GenericDataAccess.ExecuteNonQuery(sql,Page);
        
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -