2025-03-27 15:05:14 +08:00

425 lines
20 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuperMap.RealEstate.CoreFrameWork;
using SuperMap.RealEstate.Web.UI.WebControls;
using SuperMap.RealEstate.Utility;
using System.Data;
using SuperMap.RealEstate.Web.Utility;
using SuperMap.RealEstate.Enums;
namespace SuperMap.RealEstate.PropertyManage.Modules.HoseFundInfo
{
public partial class Default : SuperMap.RealEstate.Web.UI.Page
{
#region
string District_ID
{
get
{
if (ViewState["District_ID"] == null)
{
if (Request["District_ID"] == null)
return "";
ViewState["District_ID"] = Request["District_ID"].ToString().ToDecrypt();
}
return ViewState["District_ID"].ToString();
}
}
string Building_ID
{
get
{
if (ViewState["Building_ID"] == null)
{
if (Request["Building_ID"] == null)
return "";
ViewState["Building_ID"] = Request["Building_ID"].ToString().ToDecrypt();
}
return ViewState["Building_ID"].ToString();
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
//初始化并加载列表
GridViewEx1.SelectingWithInit<Storage.Business.HouseFund>(ObjectDataSource1, GridPageEx1,
DictionaryHelper.GetDictionary(this.Transaction, "oprate_type", "Imputation_Type", "RendType", "RendStand"));
//工具条按钮事件
//设置回车焦点按钮
SetControlClientAction(ButtonSearch);
//GetBuildingInfo(null);
}
//查询
protected void ButtonSearch_CallBackClick(object sender, ClientSetEventArgs e)
{
GridViewEx1.Selecting<Storage.Business.HouseFund>(ObjectDataSource1, GridPageEx1);
//设置UI变化
e.SetOuterHtml(GridViewEx1, GridViewEx1.OuterHTML);
e.SetOuterHtml(GridPageEx1, GridPageEx1.OuterHTML);
}
//翻页事件
protected void GridPageEx1_CallBackPageChanged(object src, ClientSetEventArgs e)
{
GridViewEx1.Pagging<Storage.Business.HouseFund>(ObjectDataSource1, GridPageEx1);
//设置UI变化
e.SetOuterHtml(GridViewEx1, GridViewEx1.OuterHTML);
}
//查询SQL设置
protected void GridViewEx1_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
//搜索选项的搜索条件过滤
if (!TextBox_Search.Text.Equals(string.Empty))
{
if (CheckBoxExOrParams.Checked)
e.AddOrParams(LayoutButton_Search, TextBox_Search.Text, CheckBoxExOrParams.Checked);
}
//排序
e.AddOrderByParams(LayoutButton_OrderBy, CheckBoxExOrderBy.Checked);
}
protected void GridViewEx1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//添加ID
e.Row.Attributes.Add("id", this.GridViewEx1.DataKeys[e.Row.RowIndex].Values[0].ToEncrypt());
e.Row.Attributes.Add("name", this.GridViewEx1.DataKeys[e.Row.RowIndex].Values[0].ToEncrypt());
if (this.GridViewEx1.DataKeys[e.Row.RowIndex].Values[1].ToString().Replace("&nbsp;", "") == "1")
{
//e.Row.Cells[7].BackColor = System.Drawing.Color.Green;
e.Row.Cells[5].ForeColor = System.Drawing.Color.Green;
e.Row.Cells[5].Text = "已缴";
}
else
{
e.Row.Cells[5].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[5].Text = "未缴";
}
e.Row.Cells[3].Text = "<a href='javascript:;' onclick=" + GetOpenPopDialogClientScript("/PropertyManage/Modules/BuildDetailsTablePage.aspx?Building_ID=" + this.GridViewEx1.DataKeys[e.Row.RowIndex].Values[2].ToString().ToEncrypt(), "BuildDetailsTablePage", 1200, 800, true, false, true) + ">" + e.Row.Cells[3].Text + "</a>";
//e.Row.Cells[7].BackColor = System.Drawing.Color.Yellow;
//e.Row.Attributes.Add("onclick","");
}
}
protected void LayoutButton1_CallBackClick(object sender, ClientSetEventArgs e)
{
}
protected void GridViewEx1_DataRowPopDialogRequest(object sender, DataRowPopDialogRequestArgs e)
{
//e.Add("House_ID", GridViewEx1.DataKeys[e.Row.RowIndex][0].ToString().ToEncrypt());
//e.Add("HouseFund_ID", GridViewEx1.DataKeys[e.Row.RowIndex][1].ToString().ToEncrypt());
}
protected void CallBackButtonBuildTable_CallBackClick(object sender, ClientSetEventArgs e)
{
//e.ExcuteClientScript(GetOpenPopDialogClientScript("/PropertyManage/Modules/BuildDetailsTablePage.aspx?Building_ID=" + Building_ID.ToEncrypt(), "BuildDetailsTablePage", 1200, 800, true, false, true));
}
protected void DropDownListEx_Oprate_Type_CallBackSetControl(object sender, ClientSetEventArgs e)
{
ButtonSearch_CallBackClick(sender, e);
}
protected void GridViewEx1_CallBackClick(object sender, ClientSetEventArgs e)
{
string RowID = e.Argument;
//创建缴款记录
//当前幢基本信息
#region
StringBuilder _Content = new StringBuilder();
_Content.Append(GetTabChar(0) + "<Table class=\"GridView\" style=\"width:1000px\">");
_Content.Append(GetTabChar(0) + "<Tr>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "缴交编号");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "缴交类别");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "缴交标准");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "缴交面积");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "金额");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "票据号");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "缴款标记(是/否)");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + "操作类型");
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "</Tr>");
Storage.Business.House _House = new Storage.Business.House(this.Transaction);
_House.House_ID_Encrypt = e.Argument;
_House.Select();
Dictionary<string, object> _Dictionary = new Dictionary<string, object>();
_Dictionary.Add("House_ID", e.Argument.ToDecrypt());
DataTable _DataTable = _House.ExecuteDataTable("Select Building_ID,Serialno,RendType,RendStand,Build_Area,HouseFund_Amount,Bill_NO,Payment_Flag,Oprate_Type From V_HouseFund where House_ID=:House_ID", _Dictionary);
foreach (DataRow _DataRow in _DataTable.Rows)
{
_Content.Append(GetTabChar(0) + "<Tr>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + _DataRow["Serialno"].ToString());
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + (string.IsNullOrEmpty(_DataRow["RendType"].ToString()) ? "" : EnumHelper.ToDescription<Enums.RendType>(_DataRow["RendType"].ToString())));
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + (string.IsNullOrEmpty(_DataRow["RendStand"].ToString()) ? "" : DictionaryHelper.GetFieldEnumName("RendStand",_DataRow["RendStand"].ToString(),this.Transaction)));// _DataRow["RendStand"].ToString());
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + _DataRow["Build_Area"].ToString());
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + _DataRow["HouseFund_Amount"].ToString());
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + _DataRow["Bill_NO"].ToString());
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + EnumHelper.ToDescription<Enums.Payment_Flag>(_DataRow["Payment_Flag"].ToString()));
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "<Td>");
_Content.Append(GetTabChar(1) + EnumHelper.ToDescription<Enums.Oprate_Type>(_DataRow["Oprate_Type"].ToString()));
_Content.Append(GetTabChar(1) + "</Td>");
_Content.Append(GetTabChar(1) + "</Tr>");
}
_Content.Append(GetTabChar(0) + "</Table>");
#endregion
#region
StringBuilder _ContentBuilding = new StringBuilder();
_ContentBuilding.Append(GetTabChar(0) + "<Table class=\"GridView\" style=\"width:1000px\">");
_ContentBuilding.Append(GetTabChar(0) + "<Tr>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "房屋总数");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "住宅金额");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "住宅面积");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "非住宅金额");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "非住宅面积");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "预售归集额");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "初始归集额");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + "测量号");
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "</Tr>");
_DataTable = _House.ExecuteDataTable("Select Building_ID,district_id,Building_Address,graphics_code,House_AllCount,Fund_Sum,House_Count,House_Fund_Sum,House_Build_Area,NotHouse_Fund_Sum,NotHouse_Count,NotHouse_Build_Area,Presell_Fund_Sum,Init_Fund_Sum From v_statis_fund_building_finance where building_id=" + _House.Building_ID.Value.ToString());
foreach (DataRow _DataRow in _DataTable.Rows)
{
_ContentBuilding.Append(GetTabChar(0) + "<Tr>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["House_AllCount"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["House_Fund_Sum"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["House_Build_Area"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["NotHouse_Fund_Sum"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["NotHouse_Build_Area"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["Presell_Fund_Sum"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["Init_Fund_Sum"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "<Td>");
_ContentBuilding.Append(GetTabChar(1) + _DataRow["graphics_code"].ToString());
_ContentBuilding.Append(GetTabChar(1) + "</Td>");
_ContentBuilding.Append(GetTabChar(1) + "</Tr>");
}
_ContentBuilding.Append(GetTabChar(0) + "</Table>");
#endregion
decimal _PayMoney, _NoPayMoney, _BaLance;
double _PayBuild_Area, _NoPayBuild_Area, _Build_Area, _Nonresidential_Build_Area;
int _House_AllCount, _House_Count, _House_OtherCount, _House_PayCount, _House_NotPayCount;
Storage.Business.Building _Building = new Storage.Business.Building(this.Transaction);
_Building.Select(_House.Building_ID);
_Building.Payment_Statistics(out _PayMoney, out _NoPayMoney, out _PayBuild_Area,
out _NoPayBuild_Area, out _BaLance, out _Build_Area, out _Nonresidential_Build_Area,
out _House_AllCount, out _House_Count, out _House_OtherCount, out _House_PayCount, out _House_NotPayCount);
StringBuilder _ContentBuildingOther = new StringBuilder();
_ContentBuildingOther.Append(GetTabChar(0) + "<Table class=\"GridView\" style=\"width:1000px\">");
#region 1
_ContentBuildingOther.Append(GetTabChar(0) + "<Tr>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "总面积");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "已缴面积");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "未缴面积");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "其他面积");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "已缴金额");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "未缴金额");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "总户数");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "已缴户数");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "未缴户数");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "可用余额");
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
#endregion
_ContentBuildingOther.Append(GetTabChar(1) + "</Tr>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _Build_Area.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _PayBuild_Area.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _NoPayBuild_Area.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _Nonresidential_Build_Area.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _PayMoney.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _NoPayMoney.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _House_AllCount.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _House_PayCount.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _House_NotPayCount.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "<Td>");
_ContentBuildingOther.Append(GetTabChar(1) + _BaLance.ToString());
_ContentBuildingOther.Append(GetTabChar(1) + "</Td>");
_ContentBuildingOther.Append(GetTabChar(1) + "</Tr>");
_ContentBuildingOther.Append(GetTabChar(0) + "</Table>");
e.ExcuteClientScript("Table_AddRowByID('" + this.GridViewEx1.ClientID + "','" + RowID + "','" + (this.GridViewEx1.Columns.Count) + "','" + _Content.ToString() + "','" + _ContentBuilding + "','" + _ContentBuildingOther.ToString() + "');");
}
string GetTabChar(int TabCount)
{
StringBuilder _TabChar = new StringBuilder();
int _Count = TabCount * 4;
for (int i = 0; i < _Count; i++)
{
_TabChar.Append("&nbsp;");
}
return _TabChar.ToString(); ;
}
}
}