?? pzxm_view.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.PZGL
{
/// <summary>
/// PZXM_VIEW 的摘要說明。
/// </summary>
public class PZXM_VIEW : com.unicafe.ui.UnicafePage
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.DropDownList DDL_PZLX;
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.Label lb_ZDR;
protected System.Web.UI.WebControls.Label Label6;
protected System.Web.UI.WebControls.Label lb_SHR;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.Label Label8;
protected System.Web.UI.WebControls.Label lb_JFYE;
protected System.Web.UI.WebControls.Label Label10;
protected System.Web.UI.WebControls.Label lb_DFYE;
protected System.Web.UI.WebControls.LinkButton Linkbutton4;
SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
Com.Ascs.Plp.CW.CW_PZXM CW_PZXM = new Com.Ascs.Plp.CW.CW_PZXM();
Com.Ascs.Plp.CW.CW_PZXMMgr CW_PZXMMgr = new Com.Ascs.Plp.CW.CW_PZXMMgr();
Com.Ascs.Plp.CW.CW_PZ CW_PZ = new Com.Ascs.Plp.CW.CW_PZ();
Com.Ascs.Plp.CW.CW_PZMgr CW_PZMgr = new Com.Ascs.Plp.CW.CW_PZMgr();
protected System.Web.UI.WebControls.Label lb_ZDRQ;
protected System.Web.UI.WebControls.Label lb_FDS;
protected bool credit =false;
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// 在此處放置用戶代碼以初始化頁面
this.VerifyPage();
this.VerifyPage("zz_pzgl_mgr");
try
{
this.CW_PZ.PZBH=this.Request.QueryString["PZBH"];
this.CW_PZ.KJND=this.Request.QueryString["KJND"];
this.CW_PZ.KJQJ=this.Request.QueryString["KJQJ"];
this.CW_PZ.JGDM=this.Request.QueryString["JGDM"];
this.CW_PZ=this.CW_PZMgr.GetCW_PZ(this.CW_PZ.PZBH,this.CW_PZ.KJND,this.CW_PZ.KJQJ,this.CW_PZ.JGDM);
}
catch(Exception e1)
{
LogService.Write(e1.Message);
this.Response.Redirect("../../Publics/Error.aspx?errmsg=未能獲取憑證的完整信息。");
return;
}
if(!this.Page.IsPostBack)
{
ViewState["credit"] = credit; //首次加載時,將判斷標志賦值給一個視圖狀態值保存在客戶端
ViewState["sql"]= string.Format("SELECT * FROM VIEW_PZXM where JGDM='{0}' and KJND='{1}' and KJQJ='{2}' and PZBH='{3}'",this.CW_PZ.JGDM.ToString(),this.CW_PZ.KJND.ToString(),this.CW_PZ.KJQJ.ToString(),this.CW_PZ.PZBH.ToString()) ;
//判斷改憑證是否借貸平衡標記
this.JDPH(this.CW_PZ.KJND,this.CW_PZ.KJQJ,this.CW_PZ.JGDM,this.CW_PZ.PZBH);
//處理DataGrid控件(綁定DataGrid控件 -> 檢查是否需要定位 -> 給導航文本賦值)
if(CommonService.HandleDataGrid(this, ViewState["sql"].ToString(), DataGrid1, "DataMX", Label2, Label3, Label4) == false)
this.Response.Redirect("../../publics/Error.aspx?errmsg=在處理數據時發生錯誤。");
this.lb_ZDRQ.Text=this.CW_PZ.ZDRQ.ToString("yyyy'/'MM'/'dd");
this.lb_ZDR.Text=CWZZ.PZGL.PZ_VIEW.GetToEmpName(this.CW_PZ.ZDR);
this.DDL_PZLX.SelectedIndex=-1;
if(this.CW_PZ.PZLX.ToString().Trim()!=string.Empty)
this.DDL_PZLX.Items.FindByValue(this.CW_PZ.PZLX.ToString().Trim()).Selected=true;
this.lb_FDS.Text=this.CW_PZ.FDS.ToString();
this.lb_SHR.Text=CWZZ.PZGL.PZ_VIEW.GetToEmpName(this.CW_PZ.SHR);
}
else
{
//檢查回發的請求操作是否是要進入上頁或下頁
if(CommonService.PageNavigate(this, DataGrid1, "DataMX", Label2, Label3, Label4) == false)
this.Response.Redirect("../../publics/Error.aspx?errmsg=在處理數據時發生錯誤。");
}
}
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.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void JDPH(string KJND,string KJQJ,string JGDM,string PZBH)
{
//判斷改憑證是否借貸平衡標記
string[] sReturns=this.CW_PZMgr.PZJDPH(KJND,KJQJ,JGDM,PZBH);
ViewState["JDPH"]=sReturns[0];
ViewState["Mes"]=sReturns[1];
if(sReturns[0]!="NULL")
{
if(sReturns[2]!="NULL")
{
this.lb_JFYE.Text=sReturns[2];
}
else
{
this.lb_JFYE.Text=string.Empty;
}
if(sReturns[3]!="NULL")
{
this.lb_DFYE.Text=sReturns[3];
}
else
{
this.lb_DFYE.Text=string.Empty;
}
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -