calcfee.aspx.cs

来自「asp.net 2.0的教务管理软件源码」· CS 代码 · 共 59 行

CS
59
字号
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 Personal_CalcFee : System.Web.UI.Page
{
    decimal p;
    decimal q;
    DateTime d1;
    DateTime d2;
    int de_ID;
    LoginInfo My;
    protected void Page_Load(object sender, EventArgs e)
    {
        My = new LoginInfo(Session["LoginID"]);
        if (My.LoginID == 0) Response.Redirect("~/Signin.aspx");

        d1 = Convert.ToDateTime(Request["d1"]);
        d2 = Convert.ToDateTime(Request["d2"]);
        de_ID = Convert.ToInt32(Request["de_ID"]);
        lblCalcEmployee.Text = My.LoginName;
        panSign.Visible = IsPostBack;
        panFormula.Visible = !IsPostBack;
        lblStartDate.Text = d1.ToShortDateString();
        lblEndDate.Text = d2.ToShortDateString();
        lblCalcDate.Text = DateTime.Now.ToShortDateString();
        litDepartment.Text = DBExec.ExecGetObject("SELECT de_Name FROM J_Department WHERE de_ID="+de_ID).ToString();
    }

    protected void btnCalc_Click(object sender, EventArgs e)
    {
        try
        {
            p = Convert.ToDecimal(txtP.Text) / 100;
            q = Convert.ToDecimal(txtQ.Text) / 100;
        }
        catch 
        {
            return;
        }
        SqlDataSource1.SelectParameters[4] = new Parameter("p", TypeCode.Decimal, p.ToString());
        SqlDataSource1.SelectParameters[5] = new Parameter("q", TypeCode.Decimal, q.ToString());
     }
    protected void GridView1_DataBound(object sender, EventArgs e)
    {
        if (GridView1.Rows.Count > 0)
        {
            GridView1.Rows[GridView1.Rows.Count-1].Cells[1].Text = "合 计";
        }
    }
}

⌨️ 快捷键说明

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