求好心人讲解一下asp.net代码
各位高手帮忙解释下每行代码的意思。感谢!!!!(大体思路也可以)支付方式:
public partial class Manger_Payment : System.Web.UI.Page
{
MangerClass mcObj = new MangerClass();
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["AID"]) == "")
{
Response.Redirect("Fail.aspx");
}
if (!IsPostBack)
{
if (this.Request.QueryString["Action"] == "Manage")
{
lblAction.Text = "支付方式管理";
gvPayBind();
}
else if (this.Request.QueryString["Action"] == "Add")
{
lblAction.Text = "添加支付方式信息";
}
else if (this.Request.QueryString["Action"] == "Modify")
{
lblAction.Text = "修改支付方式信息";
GetPayInfo();
}
}
}
public void gvPayBind()
{
DataSet ds = mcObj.ReturnPayDs("PayInfo");
gvPay.DataSource = ds.Tables["PayInfo"].DefaultView;
gvPay.DataBind();
}
protected void gvPay_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvPay.PageIndex = e.NewPageIndex;
gvPayBind();
}
protected void gvPay_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int P_Int_PayID = Convert.ToInt32(gvPay.DataKeys[e.RowIndex].Value.ToString());
mcObj.DeletePayInfo(P_Int_PayID);
gvPayBind();
}
public void GetPayInfo()
{
DataSet ds = mcObj.ReturnPayDsByID(Convert.ToInt32(this.Request["PayID"].ToString()), "PayInfo");
txtName.Text = ds.Tables["PayInfo"].Rows[0][1].ToString();
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.Request.QueryString["Action"] == "Add")
{
if (txtName.Text == "")
{
Response.Write("<script>alert('请输入完整信息')</script>");
return;
}
else
{
mcObj.InsertPay(txtName.Text.Trim());
Response.Write("<script>alert('添加成功!')</script>");
return;
}
}
else if (this.Request.QueryString["Action"] == "Modify")
{
if (txtName.Text == "")
{
Response.Write("<script>alert('请输入完整信息')</script>");
return;
}
else
{
mcObj.UpdatePay(Convert.ToInt32(this.Request["PayID"].ToString()), txtName.Text.Trim());
Response.Write("<script>alert('修改成功!')</script>");
return;
}
}
}
}