public string CreateCharts() { HyOperationlog HyOperationlog = new HyOperationlog(); DataTable dt = new DataTable(); string test = ""; dt = HyOperationlog.GetDataTableSystem("", ""); string strXML = ""; strXML += "<graph caption='系统情况分析' showNames='1' showValues='1' baseFontSize='12' xAxisName='统计类型' yAxisName='完成数' decimalPrecision='0' formatNumberScale='0'>"; string[] strArrayColors = new string[3] { "AFD8F8", "F6BD0F", "8BBA00" }; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { strXML += "<set name='" + dt.Rows[i]["hyOperationType"].ToString() + "记录数' value='" + dt.Rows[i]["totalCount"].ToString() + "' color='" + strArrayColors[i] + "' showValues='0' />"; } } else { strXML += "<set name='新增记录数' value='" + "" + "' color='AFD8F8' />"; strXML += "<set name='修改记录数' value='" + "" + "' color='F6BD0F' />"; strXML += "<set name='删除记录数' value='" + "" + "' color='8BBA00' />"; } strXML += "</graph>"; return FusionCharts.RenderChartHTML("FusionCharts/FCF_Column3D.swf", "ChartId", strXML, "myNext", "500", "400", false); }
//删除 protected void btndelinfo_Click(object sender, EventArgs e) { HyCommon HyCommon = new HyCommon(); string pageUrl = HyCommon.CombUrlTxt(ls_url, "page={0}&rnd={1}", page.ToString(), System.Guid.NewGuid().ToString()); string ls_tip = "删除成功!"; String[] v_uids = this.txtuids.Value.Split(','); for (int i = 0; i < v_uids.Length; i++) { HyOperationlog HyOperationlog = new HyOperationlog(); HyOperationlog.id = v_uids[i]; HyOperationlog.Delete(); } //写系统日志 Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (this.Request.QueryString["docid"] != null) { string ls_docid = this.Request.QueryString["docid"].ToString(); //根据文档ID得到记录 DAO db = new DAO(); string sql = "select * from hyp_flowmain where DOCID='" + ls_docid + "'"; DataTable dt = db.GetDataTable(sql); string ls_flowid, ls_flowname, ls_mudelid, ls_curtacheid, ls_curtachename; if (dt.Rows.Count > 0) { ls_flowid = dt.Rows[0]["hy_flowid"].ToString(); //流程ID ls_flowname = dt.Rows[0]["hy_flowname"].ToString(); //流程名称 ls_mudelid = dt.Rows[0]["hy_mudelid"].ToString(); //模块ID ls_curtacheid = dt.Rows[0]["hy_curtacheid"].ToString(); //当前环节ID ls_curtachename = dt.Rows[0]["hy_curtachename"].ToString(); //当前环节名称 HyOperationlog HyOperationlog = new HyOperationlog(); //制作表格式信息 this.txtCurrnetDocFlow.Text = HyOperationlog.GetCurrnetDocFlow(ls_docid, ls_flowid, ls_flowname, ls_mudelid, ls_curtacheid, ls_curtachename); } } }
// 数据绑定 private void RptBind() { if (this.ddl_user.SelectedValue != "") { this.lb_show.Text = " <tr height=\"22\" onmouseover=\"this.className='tr_over'\" onmouseout=\"this.className='tr_out'\" class=\"tr_out\">"; if (this.ddl_user.SelectedValue == "") { this.lb_show.Text += "<td align=\"center\">全体人员</td>"; } else { this.lb_show.Text += "<td align=\"center\">" + this.ddl_user.SelectedItem + " </td>"; } HyOperationlog hyOperationlog = new HyOperationlog(); hyOperationlog.hyuId = this.ddl_user.SelectedValue; string test = ""; //得到流程未结束的 DataTable dt = hyOperationlog.GetDataTableHandle(this.operateTime_s.Value, this.operateTime_e.Value, "0", out test); iNotOver = dt.Rows.Count; dt.Clear(); //得到流程结束的 dt = hyOperationlog.GetDataTableHandle(this.operateTime_s.Value, this.operateTime_e.Value, "1", out test); iOver = dt.Rows.Count; //执行某操作 this.lb_show.Text += "<td align=\"center\"> " + (iNotOver + iOver) + "</td>"; this.lb_show.Text += "<td align=\"center\">" + hyOperationlog.getFlowConsumeTime() + "</td>"; this.lb_show.Text += "<td align=\"center\">" + iNotOver + " </td>"; this.lb_show.Text += "<td align=\"center\">" + iOver + "</td>"; this.lb_show.Text += "</tr>"; this.lb_flash.Text += CreateCharts(); } }
//效能系统日志20150603 /// <summary> /// 保存时操作日志 /// </summary> /// <param name="contentType">文章类型</param> /// <param name="operationContent">操作内容</param> /// <param name="operationType">操作类型</param> private void hyXnxtSaveLogs(string contentType, string operationContent, string operationType) { HyOperationlog HyOperationlog = new HyOperationlog(); HyOperationlog.id = System.Guid.NewGuid().ToString(); HyOperationlog.hyuId = this.Session["hyuid"].ToString(); HyOperationlog.hyuName = this.Session["hyuname"].ToString(); HyOperationlog.hyuDeptid = this.Session["hydeptid"].ToString(); HyOperationlog.hyuDeptName = this.Session["hydeptname"].ToString(); HyOperationlog.hyTableID = this.hy_tableid.Text; HyOperationlog.hyTableNmae = this.lbltablename.Text; HyOperationlog.hyMudelID = this.hy_mudelid.Text; HyOperationlog.hyMudelNmae = hy_mudelname(); HyOperationlog.hyContentType = contentType; HyOperationlog.hyOperationContent = operationContent; HyOperationlog.hyOperationId = this.txtdocid.Value; HyOperationlog.hyOperationType = operationType; HyOperationlog.hyOperationTime = DateTime.Now.ToString(); HyOperationlog.hyOperationIp = getIp(); //电脑端登陆 HyOperationlog.hyLoginType = "0"; HyOperationlog.Insert(); }
private void getData() { this.lb_show.Text = " <tr height=\"22\" onmouseover=\"this.className='tr_over'\" onmouseout=\"this.className='tr_out'\" class=\"tr_out\">"; HyOperationlog HyOperationlog = new HyOperationlog(); DataTable dt = new DataTable(); int artTotal = 0; dt = HyOperationlog.GetDataTableSystem(this.operateTime_s.Value, this.operateTime_e.Value); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { this.lb_show.Text += "<td align=\"center\" >" + dt.Rows[i]["totalCount"].ToString() + "</td> "; artTotal += Convert.ToInt32(dt.Rows[i]["totalCount"].ToString()); } this.lb_show.Text += "<td align=\"center\" >" + artTotal + "</td> "; } this.lb_show.Text += "</tr>"; }
// 数据绑定 private void RptBind() { HyOperationlog hyOperationlog = new HyOperationlog(); HyCommon HyCommon = new HyCommon(); //对页数进行过滤 if (this.Request.QueryString["page"] != null) { this.page = int.Parse(HyCommon.Filter(this.Request.QueryString["page"].ToString())); } this.txtPageNum.Text = this.pageSize.ToString(); DataTable dt = new DataTable(); string test = ""; //得到数据 dt = hyOperationlog.getFlowTime(pageSize, page, this.ddl_table.SelectedValue, this.ddl_user.SelectedValue, "", this.operateTime_s.Value, this.operateTime_e.Value, this.txtKeyWord.Value, this.ddl_flow.SelectedValue, out test); //分页 if (dt.Rows.Count == 0) { totalCount = 0; } else { totalCount = hyOperationlog.getFlowTimeCount(this.ddl_table.SelectedValue, this.ddl_user.SelectedValue, "", this.operateTime_s.Value, this.operateTime_e.Value, this.txtKeyWord.Value, this.ddl_flow.SelectedValue); this.lblcount.Text = totalCount.ToString(); } StringBuilder stringBuilder = new StringBuilder(); //构造显示列 for (int i = 0; i < dt.Rows.Count; i++) { stringBuilder.Append("<tr height=\"22\" onmouseover=\"this.className='tr_over'\" onmouseout=\"this.className='tr_out'\"class=\"tr_out\">"); stringBuilder.Append("<td align=\"center\">" + (i + 1) + "</td>"); stringBuilder.Append("<td align=\"center\">" + dt.Rows[i]["hy_bt"].ToString() + "</td>"); stringBuilder.Append("<td align=\"center\">" + dt.Rows[i]["hy_djrname"].ToString() + "</td>"); stringBuilder.Append("<td align=\"center\">" + dt.Rows[i]["hy_djsj"].ToString() + "</td>"); stringBuilder.Append("<td align=\"center\" ><a href=\"#\" onclick=\"window.open('../ggdy/Hy_cklc.aspx?docid=" + dt.Rows[i]["docid"].ToString() + "&tableid=" + dt.Rows[i]["hy_tableid"].ToString() + "&rnd=" + System.Guid.NewGuid().ToString() + "','_blank','height=600,width=800,top=100,left=400,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')\" >流程耗时查看</a></td></tr>"); } this.lb_show.Text = stringBuilder.ToString(); string pageUrl = HyCommon.CombUrlTxt(ls_url, "page={0}&rnd={1}&txttableid={2}&txtuid={3}&operateTime_s={4}&operateTime_e={5}&txtKeyWord={6}&txtFlow={7}", "__id__", System.Guid.NewGuid().ToString(), this.ddl_table.SelectedValue, this.ddl_user.SelectedValue, this.operateTime_s.Value, this.operateTime_e.Value, this.txtKeyWord.Value, this.ddl_flow.SelectedValue); PageContent.InnerHtml = HyCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }