?? qckmye_add.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 Com.Ascs.Plp.CW;
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_ADD 的摘要說明。
/// </summary>
public class QCKMYE_ADD :com.unicafe.ui.UnicafePage
{
SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
Com.Ascs.Plp.CW.CW_KMYE CW_KMYE = new Com.Ascs.Plp.CW.CW_KMYE();
protected System.Web.UI.WebControls.Label lb_KJND;
protected System.Web.UI.WebControls.Label lb_KJQJBH;
Com.Ascs.Plp.CW.CW_KJQJMgr CW_KJQJMgr = new Com.Ascs.Plp.CW.CW_KJQJMgr();
protected System.Web.UI.WebControls.Label lb_JGDM;
protected System.Web.UI.WebControls.LinkButton datacheck;
protected System.Web.UI.WebControls.TextBox KJKM;
protected System.Web.UI.WebControls.TextBox kmye;
protected System.Web.UI.WebControls.RangeValidator RangeValidator1;
Com.Ascs.Plp.CW.CW_KMYEMgr CW_KMYEMgr = new Com.Ascs.Plp.CW.CW_KMYEMgr();
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// this.VerifyPage();
// this.VerifyPage("zt_qcye_mgr");
// 在此處放置用戶代碼以初始化頁面
if (!this.IsPostBack) //判斷第一次顯示
{
ViewState["JGDM"]=this.CurrentJGXX.JGDM;
ViewState["KJND"]=this.Request.QueryString["KJND"];
this.lb_JGDM.Text=ViewState["JGDM"].ToString();
this.lb_KJND.Text=ViewState["KJND"].ToString();
ViewState["KJQJ"]=this.CW_KJQJMgr.GetQYKJQJ(ViewState["JGDM"].ToString(),ViewState["KJND"].ToString())[0];
this.lb_KJQJBH.Text=ViewState["KJQJ"].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.datacheck_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void datacheck_Click(object sender, System.EventArgs e)
{
try
{
//需要增加數據檢測
CW_KMYE.JGDM = this.lb_JGDM.Text;
CW_KMYE.KJND = this.lb_KJND.Text;
CW_KMYE.KJQJ = this.lb_KJQJBH.Text;
CW_KMYE.KJKM = this.KJKM.Text.Trim();
CW_KMYE.QCYE = Convert.ToDecimal(this.kmye.Text.Trim());
this.CW_KMYE.JFFSE=0;
this.CW_KMYE.DFFSE=0;
//新增會計科目
this.cn.Open();//啟動連接
SqlCommand mySqlCommand=new SqlCommand();
mySqlCommand.Connection=cn;
SqlTransaction myTrans = this.cn.BeginTransaction();//建立事務
mySqlCommand.Transaction = myTrans;//綁定事務
if (CW_KMYEMgr.HandleKMYE(mySqlCommand,CW_KMYE))
{
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();
//使用時將下面代碼中的"MainModel_1.aspx"改到特定頁面的打開頁面的URL
Response.Write("<script language=javascript>window.opener.location='../../Publics/Error.aspx?errmsg=該科目起初余額未能增加成功。';window.close();</script>");
}
cn.Close();
}
catch(Exception e1)
{
LogService.Write ("添加期初余額時產生異常。");
LogService.Write (e1.Message);
Prompt.PromptError(this,"添加期初余額時產生異常。");
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -