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

📄 edithomechargefee.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;
using System.Data.SqlClient;

public partial class edithomechargefee1 : System.Web.UI.Page
{
    BaseClass bc = new BaseClass();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Convert.ToString(Session["UID"]) == "")
        {
            Response.Redirect("login.aspx");

        }


        if (!IsPostBack)
        {
            bc.ExecDropDownList(name, "select * from chargeFeeType", "name", "typeID");
            this.bind();

        }
    }


    protected void bind()
    {

    


        string ownerID = Request.QueryString["ID"].ToString();
        string sql = "select * from v_homefee where ID='" + ownerID + "'";
        // Response.Write(sql);
        //  Response.End();
        SqlDataReader sdr = bc.ExecRead(sql);
        if (sdr.Read())
        {
            Label1.Text = sdr["ownerID"].ToString();//单元名称
            Number.Text = sdr["number"].ToString();//
            Pirce.Text = sdr["price"].ToString();
            Payment.Text = sdr["payment"].ToString();
            FactPayment.Text = sdr["factpayment"].ToString();
            NotPayment.Text = sdr["notpayment"].ToString();
            start.Text = sdr["startDate"].ToString();
            txthandle.Text = sdr["handle"].ToString();

        }
        else
        {
            Response.Write("获取数据失败");
            return;
        }

       

 
    }



    protected void Button1_Click(object sender, EventArgs e)
    {
        string ID = Request.QueryString["ID"].ToString();
        string typeID = name.SelectedItem.Value;//收费类型

        int Number = Math.Abs(Convert.ToInt32(this.Number.Text));//数量
        int Pirce = Math.Abs(Convert.ToInt32(this.Pirce.Text));//价格


        int Payment = Math.Abs(Convert.ToInt32(Request["Payment"]));//应付
        int FactPayment = Math.Abs(Convert.ToInt32(this.FactPayment.Text));//已付
        int NotPayment = Math.Abs(Convert.ToInt32(Request["NotPayment"]));//未付
        string handle1 = Session["adminName"].ToString();//经手人
        //判断用户金额
        if (Number * Pirce < Payment)
        {
            Response.Write("<script>alert('应付金额填写错误');history.back()</script>");
            Response.End();
        }



        string startDate = start.Text;//开始日期

        string addName = Session["adminName"].ToString();//添加人
        string addDate = DateTime.Now.ToShortDateString();//添加日期



        string sql = "update homechargefee set typeID=" + typeID + ",number=" + Number + ",price=" + Pirce;
        sql = sql + ",payment=" + Payment + ",factpayment=" + FactPayment + ",notpayment=" + NotPayment + ",logindate='" + addDate;
        sql = sql + "',handle='" + handle1 + "',addName='" + addName + "' where ID=" + ID;
       // Response.Write(sql);
         //Response.End();

        if (bc.ExecSql(sql))
        {
            Response.Write("<script language=javascript>alert('修改成功!');location='homechargefee.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert(修改失败,请重试!');</script>");
            return;
        }



    }


  
}
    

      

      


⌨️ 快捷键说明

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