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; using CY.BLL.Inquiry; using CY.Model.Inquiry; using System.Drawing; namespace CY.WebForm.Pages.business { public partial class OrderSonghuoanchiList : BasePage { Sys_CitySiteBLL bll_Sys_CitySiteBLL = null; EC_OrderBasicBLL _eC_OrderBasicBLL = null; OA_StaffBLL bll_OA_StaffBLL = null; AfterParameterInfoBLL _afterParameterInfoBLL = null; //初始化 public OrderSonghuoanchiList() { bll_Sys_CitySiteBLL = new Sys_CitySiteBLL(); _eC_OrderBasicBLL = new EC_OrderBasicBLL(); bll_OA_StaffBLL = new OA_StaffBLL(); _afterParameterInfoBLL = new AfterParameterInfoBLL(); } protected void Page_Load(object sender, EventArgs e) { UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged; if (!IsPostBack) { BindProvince(); InitialSelectData(); BindList(); } } //绑定省 protected void BindProvince() { this.selectProvince.Items.Clear(); if (CurrentUser.TrueType == "员工") this.selectProvince.DataSource = bll_Sys_CitySiteBLL.SelectStaffManageProvinceList(CurrentUser.TrueMemberId); else this.selectProvince.DataSource = bll_Sys_CitySiteBLL.SelectAllNextModel(0, 0, 1); this.selectProvince.DataTextField = "Name"; this.selectProvince.DataValueField = "Keyid"; this.selectProvince.DataBind(); this.selectProvince.Items.Insert(0, new ListItem("全部", "")); this.selectCity.Items.Insert(0, new ListItem("全部", "")); this.selectCounty.Items.Insert(0, new ListItem("全部", "")); } //改变省绑定市 protected void ChangeProvince(object sender, EventArgs e) { this.selectCity.Items.Clear(); this.selectCounty.Items.Clear(); Sys_CitySite m_Sys_CitySite = bll_Sys_CitySiteBLL.GetModelByKeyid(this.selectProvince.SelectedValue.ToInt32() ?? 0); if (m_Sys_CitySite != null) { if (CurrentUser.TrueType == "员工") this.selectCity.DataSource = bll_Sys_CitySiteBLL.SelectStaffManageCityList(m_Sys_CitySite.Keyid, CurrentUser.TrueMemberId); else this.selectCity.DataSource = bll_Sys_CitySiteBLL.SelectAllNextModel(m_Sys_CitySite.Keyid, 0, 2); this.selectCity.DataTextField = "Name"; this.selectCity.DataValueField = "Keyid"; this.selectCity.DataBind(); } this.selectCity.Items.Insert(0, new ListItem("全部", "")); this.selectCounty.Items.Insert(0, new ListItem("全部", "")); } //改变市绑定区 protected void ChangeCity(object sender, EventArgs e) { this.selectCounty.Items.Clear(); Sys_CitySite m_Sys_CitySite = bll_Sys_CitySiteBLL.GetModelByKeyid(this.selectCity.SelectedValue.ToInt32() ?? 0); if (m_Sys_CitySite != null) { if (CurrentUser.TrueType == "员工") this.selectCounty.DataSource = bll_Sys_CitySiteBLL.SelectStaffManageCountryList(m_Sys_CitySite.ProvinceId, m_Sys_CitySite.Keyid, CurrentUser.TrueMemberId); else this.selectCounty.DataSource = bll_Sys_CitySiteBLL.SelectProxyNextModel(m_Sys_CitySite.ProvinceId, m_Sys_CitySite.Keyid, 3); this.selectCounty.DataTextField = "Name"; this.selectCounty.DataValueField = "Keyid"; this.selectCounty.DataBind(); } this.selectCounty.Items.Insert(0, new ListItem("全部", "")); } //分页事件 protected void AspNetPager1_PageChanged(object src, EventArgs e) { BindList(); } //查询事件 protected void btn_Search_Click(object sender, EventArgs e) { BindList(); } protected void btn_Search_Click1(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button1.Text; BindList(); } protected void btn_Search_Click0(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button0.Text; BindList(); } protected void btn_Search_Click2(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button2.Text; BindList(); } protected void btn_Search_Click3(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button3.Text; BindList(); } protected void btn_Search_Click4(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button4.Text; BindList(); } protected void btn_Search_Click5(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button5.Text; BindList(); } protected void btn_Search_Click6(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button6.Text; BindList(); } protected void btn_Search_Click7(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button7.Text; BindList(); } protected void btn_Search_Click8(object sender, EventArgs e) { this.txtDeliveryTime.Value = this.Button8.Text; BindList(); } //加载查询条件 protected void InitialSelectData() { this.selBusinessManager.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, false); this.selBusinessManager.DataTextField = "Name"; this.selBusinessManager.DataValueField = "Keyid"; this.selBusinessManager.DataBind(); this.selBusinessManager.Items.Insert(0, new ListItem("全部", "")); this.Button0.Text = "逾期"; this.Button1.Text = "明天"; this.Button2.Text = "后天"; this.Button3.Text = "3天"; this.Button4.Text = "4天"; this.Button5.Text = "5天"; this.Button6.Text = "6天"; this.Button7.Text = "7天"; this.Button8.Text = "一周后"; } //绑定列表 private void BindList() { if (this.txtDeliveryTime.Value == "") { this.txtDeliveryTime.Value = this.Button1.Text; } if (this.txtDeliveryTime.Value == this.Button1.Text) { this.Button1.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button2.Text) { this.Button2.BorderColor = Color.Black; this.Button1.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button3.Text) { this.Button3.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button4.Text) { this.Button4.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button5.Text) { this.Button5.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button6.Text) { this.Button6.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button7.Text) { this.Button7.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button8.Text) { this.Button8.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button0.BorderColor = Color.LightBlue; } else if (this.txtDeliveryTime.Value == this.Button0.Text) { this.Button0.BorderColor = Color.Black; this.Button2.BorderColor = Color.LightBlue; this.Button3.BorderColor = Color.LightBlue; this.Button4.BorderColor = Color.LightBlue; this.Button5.BorderColor = Color.LightBlue; this.Button6.BorderColor = Color.LightBlue; this.Button1.BorderColor = Color.LightBlue; this.Button7.BorderColor = Color.LightBlue; this.Button8.BorderColor = Color.LightBlue; } DateTime? beginTime = null; DateTime? endTime = null; Pagination pa = new Pagination(); pa.PageSize = UCPager1.AspNetPager.PageSize; pa.PageIndex = UCPager1.AspNetPager.CurrentPageIndex; IEnumerable < EC_OrderBasic > eC_OrderBasics = _eC_OrderBasicBLL.GetModelPageListForSonghuoyanchis(pa, this.txtDeliveryTime.Value, this.selectProvince.SelectedItem.Text.Replace("全部", ""), this.selectCity.SelectedItem.Text.Replace("全部", ""), this.selectCounty.SelectedItem.Text.Replace("全部", ""), this.txtCustormerName.Value, this.selBusinessManager.Value, this.txtSellerOrderId.Value, this.txtDocumentName.Value, CurrentUser.MemberId); IList afterInfos = _afterParameterInfoBLL.GetModelList(); this.RepClientList.DataSource = eC_OrderBasics; this.RepClientList.DataBind(); UCPager1.AspNetPager.RecordCount = pa.RecordCount; } } }