using BLL; using Model; using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.Door { public partial class InOutRecordStatistics : PageBase { /// /// 项目id /// public string ProjectId { get { return (string)ViewState["ProjectId"]; } set { ViewState["ProjectId"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.ProjectId = this.CurrUser.LoginProjectId; if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId) { this.ProjectId = Request.Params["projectId"]; } this.InitDropDownList(); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; this.txtDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); Search(); if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) { this.panelLeftRegion.Hidden = true; } } } private void InitDropDownList() { UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; this.InitDropDownList(); } #region 查询 private void Search() { HttpContext.Current.Session["InOutRecordStatisticInput"] = null; InOutRecordStatisticInput inOutRecordStatisticInput = new InOutRecordStatisticInput(); inOutRecordStatisticInput.ProjectId = this.ProjectId; inOutRecordStatisticInput.UnitId = this.drpUnit.SelectedValue==Const._Null?"" : this.drpUnit.SelectedValue; inOutRecordStatisticInput.TeamGroupId = this.drpWorkTeam.SelectedValue == null ? "" : this.drpWorkTeam.SelectedValue; inOutRecordStatisticInput.WorkPostId = this.drpWorkPost.SelectedValue == null ? "" : this.drpWorkPost.SelectedValue; inOutRecordStatisticInput.date = this.txtDate.SelectedDate.Value; inOutRecordStatisticInput.PersonName = this.txtName.Text.Trim(); HttpContext.Current.Session["InOutRecordStatisticInput"] = inOutRecordStatisticInput; panelCenterRegion.IFrameUrl = "./InOutRecordStatisticsGrid.aspx?"; panelCenterRegion.RefreshIFrame(); } protected void btnSearch_Click(object sender, EventArgs e) { Search(); } #endregion #region 下拉框选择事件 protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) { this.drpUnit.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpUnit.SelectedValueArray); this.drpWorkTeam.Items.Clear(); string unitIds = string.Empty; foreach (var item in this.drpUnit.SelectedValueArray) { unitIds += item + ","; } TeamGroupService.InitTeamGroupProjectUnitsDropDownList(this.drpWorkTeam, this.ProjectId, unitIds, true); } protected void drpWorkPost_SelectedIndexChanged(object sender, EventArgs e) { this.drpWorkPost.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpWorkPost.SelectedValueArray); } protected void drpWorkTeam_SelectedIndexChanged(object sender, EventArgs e) { this.drpWorkTeam.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpWorkTeam.SelectedValueArray); } #endregion } }