using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL; using CY.Model; using CY.Infrastructure.Query; using CY.Infrastructure.Common; using CY.BLL.Sys; using CY.BLL.OA; using CY.BLL.EC; namespace CY.WebForm.Pages.business { public partial class xiaoshouyejiReprotKehu : BasePage { OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null; Sys_DictionaryBLL _Sys_DictionaryBLL = null; OA_StaffBLL bll_OA_StaffBLL = null; OA_CustomerApplyBLL bll_OA_CustomerApplyBLL = null; EC_MemberBasicBLL bll_EC_MemberBasicBLL = null; Sys_CitySiteBLL bll_Sys_CitySiteBLL = null; EC_OrderBasicBLL _eC_OrderBasicBLL = null; //初始化 public xiaoshouyejiReprotKehu() { _Sys_DictionaryBLL = new Sys_DictionaryBLL(); bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); bll_OA_StaffBLL = new OA_StaffBLL(); bll_OA_CustomerApplyBLL = new OA_CustomerApplyBLL(); bll_EC_MemberBasicBLL = new EC_MemberBasicBLL(); bll_Sys_CitySiteBLL = new Sys_CitySiteBLL(); _eC_OrderBasicBLL = new EC_OrderBasicBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindList(); } } //绑定列表 private void BindList() { string BusinessManagerId = Request["BusinessManagerId"]; string chaxuntimestart = Request["chaxuntimestart"]; string chaxuntimeend = Request["chaxuntimeend"]; string leixing = Request["leixing"]; DateTime datebegin = DateTime.Parse(chaxuntimestart); DateTime dateend = DateTime.Parse(chaxuntimeend).AddDays(1); Pagination pa = new Pagination(); pa.PageSize = 10000; pa.PageIndex = 1; if (leixing == "yingshoukuan") { Dictionary searchParam = new Dictionary(); SetParamValue(searchParam, 1, CurrentUser.MemberId); SetParamValue(searchParam, 2, ""); SetParamValue(searchParam, 3, ""); SetParamValue(searchParam, 4, chaxuntimestart); SetParamValue(searchParam, 5, dateend.ToString("yyyy-MM-dd")); SetParamValue(searchParam, 6, ""); SetParamValue(searchParam, 7, ""); SetParamValue(searchParam, 8, ""); SetParamValue(searchParam, 9, "");//付款状态 -1 SetParamValue(searchParam, 10, ""); SetParamValue(searchParam, 11, ""); SetParamValue(searchParam, 12, ""); SetParamValue(searchParam, 13, BusinessManagerId); SetParamValue(searchParam, 14, ""); SetParamValue(searchParam, 15, ""); SetParamValue(searchParam, 16, ""); SetParamValue(searchParam, 18, 0); SetParamValue(searchParam, 19, ""); SetParamValue(searchParam, 20, ""); SetParamValue(searchParam, 21, ""); List result = _eC_OrderBasicBLL.SelectModelPage_Seller(pa, searchParam).Select(x=>x.BuyerId).ToList(); this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.GetModelPageList(pa, CurrentUser.MemberId, "", null, null, "", BusinessManagerId, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", false, CurrentUser.TrueMemberId, CurrentUser.StaffId, "").Where(x => result.Contains(x.Keyid)); this.RepClientList.DataBind(); } else if (leixing == "xinzeng") { this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.GetModelPageList(pa, CurrentUser.MemberId, "", null, null, "", BusinessManagerId, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", false, CurrentUser.TrueMemberId, CurrentUser.StaffId, "").Where(x => x.CreateTime >= datebegin && x.CreateTime < dateend); this.RepClientList.DataBind(); }else if (leixing == "yishoukuan") { Dictionary searchParam = new Dictionary(); SetParamValue(searchParam, 1, CurrentUser.MemberId); SetParamValue(searchParam, 2, ""); SetParamValue(searchParam, 3, ""); SetParamValue(searchParam, 4, chaxuntimestart); SetParamValue(searchParam, 5, dateend.ToString("yyyy-MM-dd")); SetParamValue(searchParam, 6, ""); SetParamValue(searchParam, 7, ""); SetParamValue(searchParam, 8, ""); SetParamValue(searchParam, 9, "-1");//付款状态 SetParamValue(searchParam, 10, ""); SetParamValue(searchParam, 11, ""); SetParamValue(searchParam, 12, ""); SetParamValue(searchParam, 13, BusinessManagerId); SetParamValue(searchParam, 14, ""); SetParamValue(searchParam, 15, ""); SetParamValue(searchParam, 16, ""); SetParamValue(searchParam, 18, 0); SetParamValue(searchParam, 19, ""); SetParamValue(searchParam, 20, ""); SetParamValue(searchParam, 21, ""); List result = _eC_OrderBasicBLL.SelectModelPage_Seller(pa, searchParam).Select(x => x.BuyerId).ToList(); this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.GetModelPageList(pa, CurrentUser.MemberId, "", null, null, "", BusinessManagerId, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", false, CurrentUser.TrueMemberId, CurrentUser.StaffId, "").Where(x => result.Contains(x.Keyid)); this.RepClientList.DataBind(); } else if (leixing == "weishoukuan") { Dictionary searchParam = new Dictionary(); SetParamValue(searchParam, 1, CurrentUser.MemberId); SetParamValue(searchParam, 2, ""); SetParamValue(searchParam, 3, ""); SetParamValue(searchParam, 4, chaxuntimestart); SetParamValue(searchParam, 5, dateend.ToString("yyyy-MM-dd")); SetParamValue(searchParam, 6, ""); SetParamValue(searchParam, 7, ""); SetParamValue(searchParam, 8, ""); SetParamValue(searchParam, 9, "");//付款状态 SetParamValue(searchParam, 10, ""); SetParamValue(searchParam, 11, ""); SetParamValue(searchParam, 12, ""); SetParamValue(searchParam, 13, BusinessManagerId); SetParamValue(searchParam, 14, ""); SetParamValue(searchParam, 15, ""); SetParamValue(searchParam, 16, ""); SetParamValue(searchParam, 18, 0); SetParamValue(searchParam, 19, ""); SetParamValue(searchParam, 20, ""); SetParamValue(searchParam, 21, ""); List result = _eC_OrderBasicBLL.SelectModelPage_Seller(pa, searchParam).Where(x=>x.PayState!=-1).Select(x => x.BuyerId).ToList(); this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.GetModelPageList(pa, CurrentUser.MemberId, "", null, null, "", BusinessManagerId, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", false, CurrentUser.TrueMemberId, CurrentUser.StaffId, "").Where(x => result.Contains(x.Keyid)); this.RepClientList.DataBind(); } } /// /// 设置查询参数方法 /// /// 设置目标 /// 键 /// 值 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); } } } }