?? qckmye_mod.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using com.unicafe.ui;
using com.unicafe.common;
using com.unicafe.security;
using com.ascs.plp.common;
using com.ascs.plp.publics;
namespace PLP.CWZZ.QCKMYE
{
/// <summary>
/// QCKMYE_MOD 的摘要說明。
/// </summary>
public class QCKMYE_MOD : com.unicafe.ui.UnicafePage
{
Com.Ascs.Plp.CW.CW_KMYE CW_KMYE = new Com.Ascs.Plp.CW.CW_KMYE();
Com.Ascs.Plp.CW.CW_KMYEMgr CW_KMYEMgr = new Com.Ascs.Plp.CW.CW_KMYEMgr();
protected System.Web.UI.WebControls.TextBox tb_QCYE;
protected System.Web.UI.WebControls.LinkButton datacheck;
protected System.Web.UI.WebControls.Label lb_JGDM;
protected System.Web.UI.WebControls.Label lb_KJND;
protected System.Web.UI.WebControls.Label lb_KJQJ;
protected System.Web.UI.WebControls.Label lb_KJKM;
protected System.Web.UI.WebControls.RangeValidator RangeValidator1;
SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// 在此處放置用戶代碼以初始化頁面
this.VerifyPage();
this.VerifyPage("zt_qcye_mgr");
this.CW_KMYE.KJND=this.Request.QueryString["KJND"];
this.CW_KMYE.KJQJ=this.Request.QueryString["KJQJ"];
this.CW_KMYE.JGDM=this.Request.QueryString["JGDM"];
this.CW_KMYE.KJKM=this.Request.QueryString["KJKM"];
this.CW_KMYE = this.CW_KMYEMgr.GetCW_KMYE(this.CW_KMYE.KJND,this.CW_KMYE.KJQJ,this.CW_KMYE.JGDM,this.CW_KMYE.KJKM);
if(!this.IsPostBack)
{
this.lb_JGDM.Text=this.CW_KMYE.JGDM;
this.lb_KJKM.Text=this.CW_KMYE.KJKM;
this.lb_KJND.Text=this.CW_KMYE.KJND;
this.lb_KJQJ.Text=this.CW_KMYE.KJQJ;
this.tb_QCYE.Text=this.CW_KMYE.QCYE.ToString();
}
}
catch(Exception e1)
{
LogService.Write ("顯示期初余額時產生異常。");
LogService.Write (e1.Message);
Prompt.PromptError(this,"顯示期初余額時產生異常。");
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:該調用是 ASP.NET Web 窗體設計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.datacheck.Click += new System.EventHandler(this.LinkButton1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)
{
try
{
//----------------------------------------------------------------------------
//BEIGIN
//對表對象進行賦值
try
{
this.CW_KMYE.JGDM=this.lb_JGDM.Text;
this.CW_KMYE.KJKM=this.lb_KJKM.Text;
this.CW_KMYE.KJND=this.lb_KJND.Text;
this.CW_KMYE.KJQJ=this.lb_KJQJ.Text;
this.CW_KMYE.QCYE=Convert.ToDecimal(this.tb_QCYE.Text);
}
catch(Exception e1)
{
LogService.Write(e1.Message);
this.Response.Redirect("../../Publics/Error.aspx?errmsg=未能獲取起初余額的完整信息。");
return;
}
this.cn.Open();//啟動連接
SqlCommand mySqlCommand = new SqlCommand();
mySqlCommand.Connection=cn;
SqlTransaction myTrans = this.cn.BeginTransaction();//建立事務
mySqlCommand.Transaction = myTrans;//綁定事務
//調用修改方法進行修改
bool Flag = this.CW_KMYEMgr.HandleKMYE(mySqlCommand,this.CW_KMYE);
//執行完畢,提示后返回
if(Flag == true)
{
myTrans.Commit();
//獲取父頁面的當前頁索引
string PageIndex = this.Request.QueryString["PageIndex"];
//獲取父頁面的URL
string ReturnURL=string.Format("QCKMYE_View.aspx?KJND={0}&PageIndex={1}",this.lb_KJND.Text, PageIndex);
//刷新父頁面并關閉本窗口
Response.Write("<script language=javascript>window.opener.location='" + ReturnURL + "';window.close();</script>");
}
else
{
myTrans.Rollback();
//重定向到錯誤頁面
Response.Write("<script language=javascript>window.opener.location='../../Publics/Error.aspx?errmsg=期初余額未能成功修改。';</script>");
}
this.cn.Close();
}
catch(Exception e1)
{
LogService.Write ("修改期初余額時產生異常。");
LogService.Write (e1.Message);
Prompt.PromptError(this,"修改期初余額時產生異常。");
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -