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.BLL.Sys; using CY.Model; using CY.Infrastructure.Query; using CY.Infrastructure.Common; using System.Data; namespace CY.WebForm.Pages.workcar { //吴辉 //打印车辆交接记录 public partial class CarTransferPrint : BasePage { OA_CarTransferBll bll_OA_CarTransferBll = null; OA_CarDictionaryBLL bll_OA_CarDictionaryBLL = null; OA_DepartmentBll bll_OA_DepartmentBll = null; OA_StaffBLL bll_OA_StaffBLL = null; OA_CarManageBll bll_OA_CarManageBll = null; //初始化 public CarTransferPrint() { bll_OA_CarTransferBll = new OA_CarTransferBll(); bll_OA_CarDictionaryBLL = new OA_CarDictionaryBLL(); bll_OA_DepartmentBll = new OA_DepartmentBll(); bll_OA_StaffBLL = new OA_StaffBLL(); bll_OA_CarManageBll = new OA_CarManageBll(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.selTransferUseCarReconed.DataSource = bll_OA_CarDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "出车事由");//出车事由 this.selTransferUseCarReconed.DataValueField = "ParName"; this.selTransferUseCarReconed.DataTextField = "ParName"; this.selTransferUseCarReconed.DataBind(); this.selTransferUseCarReconed.Items.Insert(0, new ListItem("全部", "")); Pagination pa = new Pagination(); pa.PageSize = 500; pa.PageIndex = 1; this.selTransferDepart.DataSource = bll_OA_DepartmentBll.SelectModelPage(pa, CurrentUser.MemberId, "", "启用"); this.selTransferDepart.DataTextField = "Name"; this.selTransferDepart.DataValueField = "Keyid"; this.selTransferDepart.DataBind(); this.selTransferDepart.Items.Insert(0, new ListItem("全部", "")); this.selCarId.DataSource = bll_OA_CarManageBll.SelectModelPage(pa, CurrentUser.MemberId, "", "", null, null, null, null, null, "", null); this.selCarId.DataTextField = "CarNumber"; this.selCarId.DataValueField = "Keyid"; this.selCarId.DataBind(); this.selCarId.Items.Insert(0, new ListItem("全部", "")); } } //绑定数据 private void BindList() { Pagination pa = new Pagination(); pa.PageSize = 10000; pa.PageIndex = 1; this.RepClientList.DataSource = bll_OA_CarTransferBll.SelectModelPage(pa, CurrentUser.MemberId, this.selCarId.Value.ToInt32(), this.txtBeginViolationTime.Value.ToDateTime2(), this.txtEndViolationTime.Value.ToDateTime2(), "", this.selTransferUserCarPeople.Value, "", this.selTransferUseCarReconed.Value, this.txtTransferPilot.Value, "", "", null, null, this.selTransferIsBack.Value.ToInt32(), null, "", null, "", this.selTransferDepart.SelectedValue, "", null, null, null, ""); this.RepClientList.DataBind(); } //查询事件 protected void btn_Search_Click(object src, EventArgs e) { BindList(); } //部门修改 protected void selDepartmentId_SelectedIndexChanged(object sender, EventArgs e) { GetStaffByDep(this.selTransferDepart.SelectedValue.ToString()); } //员工获取 public void GetStaffByDep(string DepartmentId) { DataTable dt_Staff = bll_OA_StaffBLL.GetStaffByDep(CurrentUser.MemberId, DepartmentId); if (dt_Staff.Rows.Count > 0) { this.selTransferUserCarPeople.DataSource = dt_Staff; this.selTransferUserCarPeople.DataTextField = "Name"; this.selTransferUserCarPeople.DataValueField = "Name"; this.selTransferUserCarPeople.DataBind(); this.selTransferUserCarPeople.Items.Insert(0, new ListItem("全部", "")); this.selTransferUserCarPeople.Value = ""; } else { this.selTransferUserCarPeople.Items.Clear(); this.selTransferUserCarPeople.Items.Insert(0, new ListItem("全部", "")); } } } }