protected void btninputrsxt_Click(object sender, EventArgs e) { HyoaClass.Hyoa_score Hyoa_score = new HyoaClass.Hyoa_score(); HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); Hyoa_score.hy_djsj_start = this.hy_djsj_start_1.Value; Hyoa_score.hy_djsj_end = this.hy_djsj_end_1.Value; Hyoa_score.hy_score = this.txtscortbyys.Text; DataTable dt3 = Hyoa_score.GetAllByScore(); for (int kk = 0; kk < dt3.Rows.Count; kk++) { //更新内容 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //文档ID Hyoa_flowmain.DOCID = Hyoa_global.GetRandom(); Hyoa_flowmain.hy_mudelid = "rsgl"; Hyoa_flowmain.hy_tableid = "6047076e-6a95-4fb8-aec8-5551d3900590"; Hyoa_flowmain.hy_flowid = ""; Hyoa_flowmain.hy_flowname = ""; Hyoa_flowmain.hy_curtacheid = ""; Hyoa_flowmain.hy_curtachename = ""; Hyoa_flowmain.hy_curclrid = ""; Hyoa_flowmain.hy_curclrname = ""; Hyoa_flowmain.hy_djrid = this.Session["hyuid"].ToString(); Hyoa_flowmain.hy_djrname = this.Session["hyuname"].ToString(); Hyoa_flowmain.hy_djrbmid = this.Session["hydeptid"].ToString(); Hyoa_flowmain.hy_djrbmname = this.Session["hydeptname"].ToString(); Hyoa_flowmain.hy_djsj = System.DateTime.Now.ToString(); Hyoa_flowmain.hy_bt = ""; Hyoa_flowmain.hy_content1 = ""; Hyoa_flowmain.hy_content2 = ""; Hyoa_flowmain.hy_content3 = ""; Hyoa_flowmain.hy_content4 = ""; Hyoa_flowmain.hy_content5 = ""; Hyoa_flowmain.hy_field1 = dt3.Rows[kk]["hy_username"].ToString(); Hyoa_flowmain.hy_field2 = dt3.Rows[kk]["hy_deptname"].ToString(); Hyoa_flowmain.hy_field3 = ""; Hyoa_flowmain.hy_field4 = ""; Hyoa_flowmain.hy_field5 = ""; Hyoa_flowmain.hy_field6 = dt3.Rows[kk]["hy_officetel"].ToString(); Hyoa_flowmain.hy_field7 = dt3.Rows[kk]["hy_hometel"].ToString(); Hyoa_flowmain.hy_field8 = dt3.Rows[kk]["hy_mobile"].ToString(); Hyoa_flowmain.hy_field9 = dt3.Rows[kk]["hy_virtualnumber"].ToString(); Hyoa_flowmain.hy_field10 = dt3.Rows[kk]["hy_userid"].ToString(); Hyoa_flowmain.hy_field11 = "考试得分"; Hyoa_flowmain.hy_field12 = this.txtscort.Text; Hyoa_flowmain.hy_field13 = ""; Hyoa_flowmain.hy_field14 = ""; Hyoa_flowmain.hy_field15 = ""; Hyoa_flowmain.hy_field16 = ""; Hyoa_flowmain.hy_field17 = ""; Hyoa_flowmain.hy_field18 = ""; Hyoa_flowmain.hy_field19 = ""; Hyoa_flowmain.hy_field20 = ""; Hyoa_flowmain.hy_field21 = ""; Hyoa_flowmain.hy_field22 = ""; Hyoa_flowmain.hy_field23 = ""; Hyoa_flowmain.hy_field24 = ""; Hyoa_flowmain.hy_field25 = ""; Hyoa_flowmain.hy_field26 = ""; Hyoa_flowmain.hy_field27 = ""; Hyoa_flowmain.hy_field28 = ""; Hyoa_flowmain.hy_field29 = ""; Hyoa_flowmain.hy_field30 = ""; Hyoa_flowmain.hy_field31 = ""; Hyoa_flowmain.hy_field32 = ""; Hyoa_flowmain.hy_field33 = ""; Hyoa_flowmain.hy_field34 = ""; Hyoa_flowmain.hy_field35 = ""; Hyoa_flowmain.hy_field36 = 0; Hyoa_flowmain.hy_field37 = 0; Hyoa_flowmain.hy_field38 = 0; Hyoa_flowmain.hy_field39 = 0; Hyoa_flowmain.hy_field40 = 0; Hyoa_flowmain.hy_field41 = ""; Hyoa_flowmain.hy_field42 = ""; Hyoa_flowmain.hy_field43 = ""; Hyoa_flowmain.hy_field44 = ""; Hyoa_flowmain.hy_field45 = ""; Hyoa_flowmain.hy_field46 = ""; Hyoa_flowmain.hy_field47 = ""; Hyoa_flowmain.hy_field48 = ""; Hyoa_flowmain.hy_field49 = ""; Hyoa_flowmain.hy_field50 = ""; Hyoa_flowmain.hy_field51 = ""; Hyoa_flowmain.hy_field52 = ""; Hyoa_flowmain.hy_field53 = ""; Hyoa_flowmain.hy_field54 = ""; Hyoa_flowmain.hy_field55 = ""; Hyoa_flowmain.hy_field56 = ""; Hyoa_flowmain.hy_field57 = ""; Hyoa_flowmain.hy_field58 = ""; Hyoa_flowmain.hy_field59 = ""; Hyoa_flowmain.hy_field60 = ""; Hyoa_flowmain.Insert(); } this.Response.Write("<script>alert('"+dt3.Rows.Count.ToString()+"条考试信息,成功导入到人事系统中!')</script>"); }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; HyoaClass.Hyoa_score Hyoa_score = new HyoaClass.Hyoa_score(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); Hyoa_score.ID = Hyoa_global.GetRandom(); Hyoa_score.hy_userid = this.Session["hyuid"].ToString(); Hyoa_score.hy_score = this.txtsumscore.Text; Hyoa_score.hy_djsj = System.DateTime.Now.ToString(); Hyoa_score.Insert(); ////处理完成后的提示及跳转 //if (this.txtifpop.Value == "") //{ // Response.Write("<script>alert('" + ls_tip + "');</script>"); //} //else //{ // Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); //} }
private void DataPlay(int PageNo) { ////判断当前用户是否有新建删除权限 //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) //{ // this.isrole.Value = "1"; // this.tdnewdoc.Visible = true; //新建 // this.tddeldoc.Visible = true; //删除 //} //else //{ // this.isrole.Value = "0"; // this.tdnewdoc.Visible = false; //新建 // this.tddeldoc.Visible = false; //删除 //} //得到当前页号 this.curpage.Text = PageNo.ToString(); HyoaClass.Hyoa_score Hyoa_score = new HyoaClass.Hyoa_score(); DataTable dt; Hyoa_score.hy_djsj_start = this.hy_djsj_start_1.Value; Hyoa_score.hy_djsj_end = this.hy_djsj_end_1.Value; dt = Hyoa_score.GetscoresUnionByUser(); DataTable dt2 = Hyoa_score.GetAvgScores(); this.lbavg.Text = dt2.Rows[0][0].ToString(); DataTable tempTable = dt.Clone(); for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); }