|
/**
|
* OrderReceiveMoney.aspx.cs
|
*
|
* 功 能: 订单财务管理
|
* 类 名: OrderFinancial
|
*
|
* Ver 变更日期 负责人 变更内容
|
* ───────────────────────────────────
|
* V0.01 2013-5-28 14:35 吴崎均 初版
|
*
|
*/
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.BLL.EC;
|
using CY.BLL.Sys;
|
using CY.Model;
|
using CY.Infrastructure.Common;
|
using CY.BLL;
|
|
namespace CY.WebForm.Pages.financial
|
{
|
/// <summary>
|
/// 订单财务管理
|
/// </summary>
|
public partial class OrderFinancial : BasePage
|
{
|
|
EC_OrderBasicBLL _eC_OrderBasicBLL = null;
|
OA_StaffBLL bll_OA_StaffBLL = null;
|
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public OrderFinancial()
|
{
|
_eC_OrderBasicBLL = new EC_OrderBasicBLL();
|
bll_OA_StaffBLL = new OA_StaffBLL();
|
}
|
|
/// <summary>
|
/// 加载事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
try
|
{
|
switch (Request["Target"])
|
{
|
case "":
|
break;
|
default:
|
Page_Load_Default();
|
return;
|
}
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
Response.Clear();
|
Response.Write("-1");
|
}
|
|
|
Response.End();
|
|
}
|
|
/// <summary>
|
/// 默认执行方法
|
/// </summary>
|
private void Page_Load_Default()
|
{
|
UCPager1.AspNetPager.PageChanged += AspNetPager_PageChanged;
|
btn_Search.Click += btn_Search_Click;
|
txtCommission.Value = CY.Config.WebInfo.Instance.FirmOrderAgencyFee;
|
|
|
if (!IsPostBack && !IsCallback)
|
{
|
Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象
|
SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();//印刷业务类型业务逻辑操作类对象
|
|
selPrintTypes.DataSource = _sysInquiry_PrintingTypeBLL.SelectUsedModles();
|
selPrintTypes.DataBind();
|
this.selPrintTypes.Items.Add(new ListItem("其他", "-1"));
|
|
selOrderTypes.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单类型");
|
selPayStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单支付状态");
|
selOrderStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单状态");
|
selCustormerLevels.DataSource = _sys_DictionaryBLL.GetDataByType("客户重要程度");
|
|
selCustormerLevels.DataBind();
|
selOrderTypes.DataBind();
|
selPayStates.DataBind();
|
selOrderStates.DataBind();
|
|
selPrintTypes.Items.Insert(0, new ListItem("全部", ""));
|
selOrderTypes.Items.Insert(0, new ListItem("全部", ""));
|
selPayStates.Items.Insert(0, new ListItem("全部", ""));
|
selOrderStates.Items.Insert(0, new ListItem("全部", ""));
|
selCustormerLevels.Items.Insert(0, new ListItem("全部", ""));
|
|
selPrintTypes.Value =
|
selOrderTypes.Value =
|
selOrderStates.Value =
|
selCustormerLevels.Value = "";
|
selPayStates.Value = "0";
|
|
|
//业务经理
|
this.selBusinessManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, false);
|
this.selBusinessManagerId.DataTextField = "Name";
|
this.selBusinessManagerId.DataValueField = "Keyid";
|
this.selBusinessManagerId.DataBind();
|
this.selBusinessManagerId.Items.Insert(0, new ListItem("全部", ""));
|
this.selBusinessManagerId.Items.Insert(1, new ListItem(CurrentUser.ShortName, "0"));
|
//客户经理
|
this.selAccountManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true);
|
this.selAccountManagerId.DataTextField = "Name";
|
this.selAccountManagerId.DataValueField = "Keyid";
|
this.selAccountManagerId.DataBind();
|
this.selAccountManagerId.Items.Insert(0, new ListItem("全部", ""));
|
this.selAccountManagerId.Items.Insert(1, new ListItem(CurrentUser.ShortName, "0"));
|
|
//初次数据加载
|
btn_Search_Click(btn_Search, new EventArgs());
|
}
|
}
|
|
/// <summary>
|
/// 搜索按钮点击事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void btn_Search_Click(object sender, EventArgs e)
|
{
|
Dictionary<int, object> searchParam = new Dictionary<int, object>();
|
Guid customeid = MyConvert.ConvertToGuid(Request["customeid"]);
|
if (!Guid.Empty.Equals(customeid))
|
SetParamValue(searchParam, 0, customeid);
|
SetParamValue(searchParam, 1, CurrentUser.MemberId);
|
SetParamValue(searchParam, 2, txtOrderId.Value.Trim());
|
SetParamValue(searchParam, 3, txtCustormerName.Value.Trim());
|
SetParamValue(searchParam, 4, txtBeginData.Value.Trim());
|
SetParamValue(searchParam, 5, txtEndDate.Value.Trim());
|
SetParamValue(searchParam, 6, selPrintTypes.Value);
|
SetParamValue(searchParam, 7, selOrderTypes.Value);
|
SetParamValue(searchParam, 8, selOrderStates.Value);
|
SetParamValue(searchParam, 9, selPayStates.Value);
|
SetParamValue(searchParam, 10, txtCreaterName.Value.Trim());
|
SetParamValue(searchParam, 11, selCustormerLevels.Value);
|
SetParamValue(searchParam, 12, selAccountManagerId.Value);
|
SetParamValue(searchParam, 13, selBusinessManagerId.Value);
|
|
SearchParam = searchParam;
|
UCPager1.AspNetPager.CurrentPageIndex = 1;//重置页数
|
//再次查询
|
AspNetPager_PageChanged(UCPager1.AspNetPager, new EventArgs());
|
}
|
|
/// <summary>
|
/// 设置查询参数方法
|
/// </summary>
|
/// <param name="target">设置目标</param>
|
/// <param name="key">键</param>
|
/// <param name="value">值</param>
|
private static void SetParamValue(Dictionary<int, object> target, int key, object value)
|
{
|
if (string.IsNullOrEmpty(string.Format("{0}", value)))
|
return;
|
else
|
{
|
}
|
|
if (target.ContainsKey(key))
|
{
|
target[key] = value;
|
}
|
else
|
{
|
target.Add(key, value);
|
}
|
}
|
|
/// <summary>
|
/// 分页事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void AspNetPager_PageChanged(object sender, EventArgs e)
|
{
|
//UCPager1.AspNetPager.PageSize = 3;
|
|
Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination()
|
{
|
PageSize = UCPager1.AspNetPager.PageSize,
|
PageIndex = UCPager1.AspNetPager.CurrentPageIndex
|
};
|
IEnumerable<EC_OrderBasic> result = _eC_OrderBasicBLL.SelectModelPage_Financial(pagination, SearchParam);
|
rptData.DataSource = result;
|
rptData.DataBind();
|
|
UCPager1.AspNetPager.RecordCount = pagination.RecordCount;
|
|
EC_OrderBasic m_EC_OrderBasic = _eC_OrderBasicBLL.SumOrderMoney_receive(pagination, SearchParam);
|
if (m_EC_OrderBasic != null)
|
{
|
//this.AllMoney.InnerText = (m_EC_OrderBasic.OrAllTradingMoney * 9 ?? 0).ToString("0.00");
|
//this.AlreadyMoney.InnerText = (m_EC_OrderBasic.OrAllPayedMoney * 9 ?? 0).ToString("0.00");
|
//this.NoMoney.InnerText = (m_EC_OrderBasic.OrAllUnPayedMoney * 9 ?? 0).ToString("0.00");
|
this.AllMoney.InnerText = (m_EC_OrderBasic.OrAllTradingMoney ?? 0).ToString("0.00");
|
this.AlreadyMoney.InnerText = (m_EC_OrderBasic.OrAllPayedMoney ?? 0).ToString("0.00");
|
this.NoMoney.InnerText = (m_EC_OrderBasic.OrAllUnPayedMoney ?? 0).ToString("0.00");
|
}
|
}
|
|
/// <summary>
|
/// 查询参数
|
/// </summary>
|
private Dictionary<int, object> SearchParam
|
{
|
get
|
{
|
return ViewState["SearchParam"] as Dictionary<int, object>;
|
}
|
set
|
{
|
ViewState["SearchParam"] = value;
|
}
|
}
|
}
|
}
|