/** * 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.business { /// /// 订单财务管理 /// public partial class SendAllIntLookBTable : BasePage { EC_OrderBasicBLL _eC_OrderBasicBLL = null; OA_StaffBLL bll_OA_StaffBLL = null; /// /// 初始化构造 /// public SendAllIntLookBTable() { _eC_OrderBasicBLL = new EC_OrderBasicBLL(); bll_OA_StaffBLL = new OA_StaffBLL(); } /// /// 加载事件 /// /// /// 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(); } /// /// 默认执行方法 /// private void Page_Load_Default() { UCPager1.AspNetPager.PageChanged += AspNetPager_PageChanged; this.btn_Search.Click += btn_Search_Click; this.txtCommission.Value = CY.Config.WebInfo.Instance.FirmOrderAgencyFee; if (!IsPostBack && !IsCallback) { Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象 SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();//印刷业务类型业务逻辑操作类对象 this.selPrintTypes.DataSource = _sysInquiry_PrintingTypeBLL.SelectUsedModles(); this.selPrintTypes.DataBind(); this.selPrintTypes.Items.Add(new ListItem("其他", "-1")); this.selOrderTypes.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单类型"); this.selPayStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单支付状态"); this.selOrderStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单状态"); this.selCustormerLevels.DataSource = _sys_DictionaryBLL.GetDataByType("客户重要程度"); this.selCustormerLevels.DataBind(); this.selOrderTypes.DataBind(); this.selPayStates.DataBind(); this.selOrderStates.DataBind(); this.selPrintTypes.Items.Insert(0, new ListItem("全部", "")); this.selOrderTypes.Items.Insert(0, new ListItem("全部", "")); this.selPayStates.Items.Insert(0, new ListItem("全部", "")); this.selOrderStates.Items.Insert(0, new ListItem("全部", "")); this.selCustormerLevels.Items.Insert(0, new ListItem("全部", "")); this.selPrintTypes.Value = this.selOrderTypes.Value = this.selPayStates.Value = this.selOrderStates.Value = this.selCustormerLevels.Value = ""; //业务经理 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.selBusinessManagerId.Value = Request["StuffKeyId"]; //客户经理 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()); } } /// /// 搜索按钮点击事件 /// /// /// private void btn_Search_Click(object sender, EventArgs e) { Dictionary searchParam = new Dictionary(); Guid customeid = MyConvert.ConvertToGuid(Request["customeid"]); if (!Guid.Empty.Equals(customeid)) SetParamValue(searchParam, 0, customeid); SetParamValue(searchParam, 1, CurrentUser.MemberId); SetParamValue(searchParam, 2, this.txtOrderId.Value.Trim()); SetParamValue(searchParam, 3, this.txtCustormerName.Value.Trim()); SetParamValue(searchParam, 4, this.txtBeginData.Value.Trim()); SetParamValue(searchParam, 5, this.txtEndDate.Value.Trim()); SetParamValue(searchParam, 6, this.selPrintTypes.Value); SetParamValue(searchParam, 7, this.selOrderTypes.Value); SetParamValue(searchParam, 8, this.selOrderStates.Value); SetParamValue(searchParam, 9, this.selPayStates.Value); SetParamValue(searchParam, 10, this.txtCreaterName.Value.Trim()); SetParamValue(searchParam, 11, this.selCustormerLevels.Value); SetParamValue(searchParam, 12, this.selAccountManagerId.Value); SetParamValue(searchParam, 13, this.selBusinessManagerId.Value); SearchParam = searchParam; UCPager1.AspNetPager.CurrentPageIndex = 1;//重置页数 //再次查询 AspNetPager_PageChanged(UCPager1.AspNetPager, new EventArgs()); } /// /// 设置查询参数方法 /// /// 设置目标 /// 键 /// 值 private static void SetParamValue(Dictionary 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); } } /// /// 分页事件 /// /// /// 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 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 ?? 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"); } } /// /// 查询参数 /// private Dictionary SearchParam { get { return ViewState["SearchParam"] as Dictionary; } set { ViewState["SearchParam"] = value; } } } }