protected void Page_Load(object sender, EventArgs e) { //获取页面参数 this.datebegin = DTRequest.GetQueryString("datebegin").Trim(); this.dateend = DTRequest.GetQueryString("dateend").Trim(); if (!string.IsNullOrEmpty(DTRequest.GetQueryString("joborderindex").Trim())) { this.joborderindex = int.Parse(DTRequest.GetQueryString("joborderindex").Trim()); } if (!Page.IsPostBack) { ChkAdminLevel("sys_manager", DTEnums.ActionEnum.View.ToString()); //检查权限 //显示参数到页面 if (!string.IsNullOrEmpty(this.datebegin)) { txtDataBegin.Text = this.datebegin; } else { txtDataBegin.Text = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)).ToString("yyyy-MM-dd"); this.datebegin = txtDataBegin.Text; } if (!string.IsNullOrEmpty(this.dateend)) { txtDataEnd.Text = this.dateend; } else { txtDataEnd.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.dateend = txtDataEnd.Text; } //绑定工单列表 TreeBind(ddlJobOrder); //设置选中项 ddlJobOrder.SelectedIndex = this.joborderindex; //取得登录系统用户信息 Model.manager model = GetAdminInfo(); BLL.manager bll = new BLL.manager(); RptBind("dept_id=" + "'" + model.dept_id + "' and (role_value>" + bll.GetRoleValue(model.role_id) + " or user_name='" + model.user_name + "')" + CombSqlTxt(this.datebegin, this.dateend, ddlJobOrder.SelectedValue)); } }
//显示工时汇总 public string ShowTimeSum() { //取得登录系统用户信息 Model.manager model = GetAdminInfo(); BLL.manager bll = new BLL.manager(); StringBuilder strReturn = new StringBuilder(); string strWhere = "dept_id=" + "'" + model.dept_id + "' and (role_value>" + bll.GetRoleValue(model.role_id) + " or user_name='" + model.user_name + "')" + CombSqlTxt(this.datebegin, this.dateend, ddlJobOrder.SelectedValue); BLL.working_hour bll1 = new BLL.working_hour(); DataSet ds = bll1.GetDeptTimeSum(strWhere); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; strReturn.Append("<tr>"); strReturn.Append("<td colspan=4></td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">共计 " + dr["count"] + " 条</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\" >合计:</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">" + dr["sum_working"] + "</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\">" + dr["sum_journey"] + "</td>"); strReturn.Append("<td style=\"font-weight:bold;color:red\" colspan=2>" + dr["sum_overtime"] + "</td>"); strReturn.Append("</tr>"); } return(strReturn.ToString()); }