protected void Page_Load(object sender, EventArgs e) { LoginCheck.AdManage(6); if (!IsPostBack) { this.Panel1.Visible = true; this.Select1.Items.Add(new ListItem("顶级栏目", "0")); menid = LoginCheck.getadminid(); bd(menid); if (Request.QueryString["id"] != null) { this.Panel1.Visible = false; this.Panel2.Visible = true; string id = Request.QueryString["id"].ToString(); string sql = "select id,ClassId,title,depth from tb_U_schoolfl where id='" + id + "'"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); if (ds.Tables[0].Rows.Count > 0) { TextBox1.Text = ds.Tables[0].Rows[0]["title"].ToString(); Select1.Value = ds.Tables[0].Rows[0]["ClassId"].ToString(); } } } }
protected void Button1_Click(object sender, EventArgs e) { string MenuId = LoginCheck.getadminid(); string username = this.TextBox1.Text.Trim(); string userpwd = Encryp.DESEncrypt(this.TextBox2.Text.Trim()); string tell = this.TextBox4.Text.Trim(); string xuehao = this.TextBox5.Text.Trim(); string xname = this.TextBox6.Text.Trim(); string sqls = "select * from tb_User where UserName='******'"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sqls); if (ds.Tables[0].Rows.Count == 0) { string sql = "insert into tb_User(UserName,UserPwd,GroupId,classid,islock)values('" + username + "','" + userpwd + "',1,'" + MenuId + "',0)"; HXD.DBUtility.SQLHelper.ExecuteScalar(sql); Session["AdminManage"] = username; System.Threading.Thread.Sleep(1000); string sql2 = "select id from tb_User where UserName='******' and datediff(mi,RegTime,getdate())<=1"; string icd = HXD.DBUtility.SQLHelper.ExecuteScalar(sql2).ToString(); Session["userid"] = icd; string sql3 = "insert into tb_U_User (Id,Tel,msn,name)values('" + icd + "','" + tell + "','" + xuehao + "','" + xname + "')"; HXD.DBUtility.SQLHelper.ExecuteScalar(sql3); Response.Redirect("user/twolist.aspx"); } else { Response.Write("用户名已存在"); } }
protected void Button1_Click(object sender, EventArgs e) { string classid = LoginCheck.getadminid(); string icd = Session["userid"].ToString(); string title = this.TextBox1.Text; //string mb_id = this.Select2.Value; string str_se = this.Select1.Value; //判断有没有上级 string sqll = "select mb_id from tb_U_schoolfl where Id='" + str_se + "'"; int scid = int.Parse(HXD.DBUtility.SQLHelper.ExecuteScalar(sqll).ToString()); string sql2 = "select COUNT(id) from tb_U_schoolfl where sid='" + classid + "' and mb_id='" + scid + "'"; int cunid = int.Parse(HXD.DBUtility.SQLHelper.ExecuteScalar(sql2).ToString()); if (cunid == 0) { int sid = pdsj(str_se); string sql = "insert into tb_U_schoolfl (title,ClassId,Sid,Depth,menuid)values('" + title + "','" + str_se + "','" + menid + "','" + sid + "','1')"; HXD.DBUtility.SQLHelper.ExecuteScalar(sql); Response.Redirect("new_fl.aspx"); } else { HXD.Common.StringDeal.Alter("该类目下只能有一个分类!"); } }
protected void Page_Load(object sender, EventArgs e) { LoginCheck.AdManage(5); if (!IsPostBack) { string classid = LoginCheck.getadminid(); bd(classid); if (Request.QueryString["wzid"] != null) { string wzid = Request.QueryString["wzid"].ToString(); string sql = "select * from tb_U_info where id=" + wzid; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); if (ds.Tables[0].Rows.Count > 0) { this.TextBox1.Text = ds.Tables[0].Rows[0]["title"].ToString(); this.TextBox2.Text = ds.Tables[0].Rows[0]["note"].ToString(); this.container.Value = ds.Tables[0].Rows[0]["Content"].ToString(); this.Select1.Value = ds.Tables[0].Rows[0]["ClassId"].ToString(); } this.Panel1.Visible = false; this.Panel2.Visible = true; } else { this.Panel1.Visible = true; this.Panel2.Visible = false; } } }
protected void Button1_Click(object sender, EventArgs e) { //string MenuId= Request.QueryString["MenuId"].ToString(); string MenuId = LoginCheck.getadminid(); string username = this.txtAdminName.Value.Trim(); string userpwd = Encryp.DESEncrypt(this.TextBox2.Text.Trim()); string email = this.TextBox4.Text.Trim(); string tell = this.TextBox5.Text.Trim(); string dw_name = this.TextBox6.Text.Trim(); string sqls = "select * from tb_User where UserName='******'"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sqls); if (ds.Tables[0].Rows.Count == 0) { string sql = "insert into tb_User(UserName,UserPwd,GroupId,classid,islock)values('" + username + "','" + userpwd + "',6,'" + MenuId + "',0)"; HXD.DBUtility.SQLHelper.ExecuteScalar(sql); System.Threading.Thread.Sleep(1000); string sql2 = "select id from tb_User where UserName='******' "; string icd = HXD.DBUtility.SQLHelper.ExecuteScalar(sql2).ToString(); string sql3 = "insert into tb_U_User (Id,Tel,msn,name,sc_id)values('" + icd + "','" + tell + "','" + email + "','" + dw_name + "','" + MenuId + "')"; HXD.DBUtility.SQLHelper.ExecuteScalar(sql3); Response.Redirect("user/"); } else { StringDeal.Alter("用户名已存在"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoginCheck.AdManage(5); string classid = LoginCheck.getadminid(); bd(classid); } }
protected void Button3_Click(object sender, EventArgs e) { int scholl_id = int.Parse(LoginCheck.getadminid()); string name = this.Text1.Value; string sql = "select a.id,UserName,RegTime,islock from tb_User as a,tb_U_User as b where a.id=b.id and a.Classid=" + scholl_id + " and a.GroupId=1 and (a.UserName like '%" + name + "%' or b.Name like '%" + name + "%') order by Sort desc,a.id desc;"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); this.Repeater1.DataSource = ds; this.Repeater1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string classid = LoginCheck.getadminid(); bdlhead(classid); //if (RoomID == 1) //{ // h_str = " active"; //} }
protected void Button3_Click(object sender, EventArgs e) { string name = this.uname.Value.Trim(); string scholl_id = LoginCheck.getadminid(); //string sql = "SELECT * from tb_User where Classid='" + scholl_id + "' and GroupId=5 and username like '%" + name + "%'or order by id"; string sql = "SELECT a.id,UserName,islock,RegTime from tb_User as a,tb_U_user as b where a.Classid='" + scholl_id + "' and a.Id=b.Id and a.GroupId=5 and (a.UserName like '%" + name + "%' or b.Name like '%" + name + "%') order by a.id"; Repeater1.DataSource = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); Repeater1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { LoginCheck.AdManage(); getztOperation(); if (!IsPostBack) { // string sqlc = "select id,FstudentNo,Fscore,posttime from t_exam_results where [Fresultid] in(select distinct Fresultid from t_exam_subitems_score where Fsubitemid='" + Fsubitemid + "' and [Fscore] >='" + Fscore + "' and [wid] ='" + wid + "')"; string Fsubitemid = Request.QueryString["Fsubitemid"].ToString().Trim(); string Fscore = Request.QueryString["Fscore"].ToString().Trim(); string wid = Request.QueryString["wid"].ToString().Trim(); //string MenuId = Session["userid"].ToString(); //string sql_mid = "select Classid from tb_User where id=" + MenuId; int scholl_id = int.Parse(LoginCheck.getadminid()); //string sql = "SELECT * from tb_User where Classid='" + scholl_id + "' and GroupId=1 order by id"; //Repeater1.DataSource = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); //Repeater1.DataBind(); HXD.ModelField.BLL.Model bll = new HXD.ModelField.BLL.Model(); HXD.ModelField.Model.Model mod = new HXD.ModelField.Model.Model(); //select * from t_exam_results where Fpaperid=1 and Fscore>160 and wid= mod.Condition = " Fpaperid='" + Fsubitemid + "' and Fscore >='" + Fscore + "' and wid ='" + wid + "'"; mod.FieldList = "FstudentNo,Fscore,posttime"; mod.TableName = "t_exam_results"; mod.Sort = "Sort desc"; mod.PageSize = 20; mod.PageIndex = HXD.Common.StringDeal.ToInt(Request.QueryString["page"]); DataSet ds1 = bll.ModelList(mod); DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset("select id,FstudentNo,Fscore,posttime from t_exam_results where Fpaperid='" + Fsubitemid + "' and Fscore >='" + Fscore + "' and wid ='" + wid + "' order by Sort desc;"); this.Repeater1.DataSource = ds1; this.Repeater1.DataBind(); HXD.Common.SgqPage pg = new HXD.Common.SgqPage(); pg.PageSize = mod.PageSize; pg.PageIndex = mod.PageIndex; pg.RecordCount = (int)ds1.Tables[1].Rows[0][0]; this.Literal1.Text = pg.PageView2(); if (pg.RecordCount == 0) { this.Literal1.Text = "暂无数据!"; } ds.Clear(); ds.Dispose(); ds1.Clear(); ds1.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { LoginCheck.AdManage(); if (Request.QueryString["answers"] != null) //Request.QueryString["MenuId"] { string sc_id = LoginCheck.getadminid(); //学校ID string answers = Request.QueryString["answers"].ToString(); //答案 string wid = Request.QueryString["wid"].ToString(); //答案 answers = answers.Remove(0, 2); int paperID2 = int.Parse(Request.QueryString["paperid"].ToString()); //量表名称 string UserName = Session["AdminManage"].ToString(); //"maidi007";用户名 string Userid = Session["userid"].ToString(); //string answers = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|2|2|2|2|2|2|2|2|2|2|2|2|2|2|2";//scl-90 //string answers = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0"; //int paperID2 = 2; Scorer scorer = Scorer.CreateScorer(paperID2); string resultText; float totalScore; int[] scoreArray; scorer.Score(paperID2, answers, out resultText, out totalScore, out scoreArray); int[] subitemIds = null; float[] subitemScoreArray = null; bool seniorScoreResult = scorer.SeniorScore(paperID2, answers, scoreArray, UserName, ref resultText, out subitemIds, out subitemScoreArray); scorer.Diagnose(paperID2, answers, UserName, scoreArray, totalScore, subitemScoreArray, ref resultText); int resultid = int.Parse(Session["userid"].ToString()); //string wid = DateTime.Now.ToString("yyyyMMddHHmmssfff"); SaveResult(resultid, UserName, paperID2, answers, scoreArray, totalScore, resultText, GetTestNum(paperID2), wid, sc_id); if (seniorScoreResult) { SaveSubItemResult(UserName, resultid, subitemIds, subitemScoreArray, wid, sc_id); } if (IsPCPaper(paperID2)) { string sql = "update tb_U_Message set state=2 where rid='" + wid + "' and uid='" + Userid + "'"; HXD.DBUtility.SQLHelper.ExecuteNonQuery(sql); Response.Write("结果已提交到服务器,谢谢你完成此调查所有问题。"); //base.get_Response().Write("结果已提交到服务器,谢谢你完成此调查所有问题。"); } else { string sql = "update tb_U_Message set state=2 where rid='" + wid + "' and uid='" + Userid + "'"; HXD.DBUtility.SQLHelper.ExecuteNonQuery(sql); //Response.Write(resultText); } } }
protected void Button1_Click(object sender, EventArgs e) { string clssid = Request.QueryString["cid"].ToString(); string icd = Session["userid"].ToString(); string title = this.TextBox1.Text; string str_se = this.Select1.Value; menid = LoginCheck.getadminid(); //判断有没有上级 int sid = pdsj(str_se); string sql = "insert into tb_U_schoolfl (title,ClassId,Sid,Depth,menuid)values('" + title + "','" + str_se + "','" + menid + "','" + sid + "','" + clssid + "')"; HXD.DBUtility.SQLHelper.ExecuteScalar(sql); Response.Redirect("sc_fl.aspx?cid=" + clssid); }
protected void Button1_Click(object sender, EventArgs e) { string MenuId = Session["userid"].ToString(); int xid = int.Parse(Request.QueryString["id"].ToString()); string title = this.TextBox1.Text.Trim(); string note = this.TextBox2.Text.Trim(); //string path = HttpContext.Current.Server.MapPath(formfile); //string tag = this.TextBox3.Text.Trim(); string content = this.container.Value.Trim(); //string str_se = "2"; string sc_id = LoginCheck.getadminid(); string sql2 = "insert into tb_U_Message (ClassId,Content,zxs_id,uid,state,yy_time) values('" + sc_id + "','" + content + "','" + MenuId + "','" + xid + "','5','" + DateTime.Now.ToString() + "')"; //string sql = "insert into tb_U_Message(Title,Note,Content,ClassId,userid,zxs_id)values('" + title + "','" + note + "','" + content + "','" + str_se + "','" + MenuId + "','" + tag + "')"; HXD.DBUtility.SQLHelper.ExecuteNonQuery(sql2); StringDeal.Alter("提交成功!", "fd_gt.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string m = LoginCheck.getadminid();//学校ID //string m = ConfigurationSettings.AppSettings["School_ID"].ToString(); //ConfigurationSection. str_num = m; bdlhead(m); bdtw(m); bd_xydt(m); bd_tz(m); bd_new1(m); bd_new2(m); bd_new3(m); bd_new4(m); bd_tw(m); } }
protected void bd() { string classid = LoginCheck.getadminid(); string sqld = "select id from tb_User where Classid=" + classid + " and GroupId=1"; string sql = "select id from tb_U_user where id in(" + sqld + ") "; //string sql2 = "select id,Fresultid,FstudentNo,Fpaperid,Fscore,Fresult,postTime from t_exam_results where Fresultid in(" + sql + ")"; //Repeater1.DataSource = HXD.DBUtility.SQLHelper.ExecuteDataset(sql2); //Repeater1.DataBind(); HXD.ModelField.BLL.Model bll = new HXD.ModelField.BLL.Model(); HXD.ModelField.Model.Model mod = new HXD.ModelField.Model.Model(); mod.Condition = ""; mod.FieldList = "[User_id],Creation_time"; mod.TableName = "tb_VortexDecompression"; mod.Sort = "Creation_time desc"; mod.PageSize = 20; mod.PageIndex = HXD.Common.StringDeal.ToInt(Request.QueryString["page"]); DataSet ds1 = bll.ModelList(mod); DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset("select top 20 id,Creation_time from tb_VortexDecompression order by Creation_time desc,id desc;"); this.Repeater1.DataSource = ds1; this.Repeater1.DataBind(); HXD.Common.SgqPage pg = new HXD.Common.SgqPage(); pg.PageSize = mod.PageSize; pg.PageIndex = mod.PageIndex; pg.RecordCount = (int)ds1.Tables[1].Rows[0][0]; this.Literal1.Text = pg.PageView2(); if (pg.RecordCount == 0) { this.Literal1.Text = "暂无数据!"; } ds.Clear(); ds.Dispose(); ds1.Clear(); ds1.Dispose(); }
protected void Button1_Click(object sender, EventArgs e) { //try //{ if (fuload.FileName == "") { //lbmsg.Text = "请选择文件"; //return null; StringDeal.Alter("请选择文件", "file.aspx"); } else { DataTable dt = xsldata(); //dataGridView2.DataSource = ds.Tables[0]; int errorcount = 0; //记录错误信息条数 int insertcount = 0; //记录插入成功条数 int updatecount = 0; //记录更新信息条数 //string strcon = "server=localhost;database=database1;uid=sa;pwd=sa"; //SqlConnection conn = new SqlConnection(strcon);//链接数据库 //conn.Open(); for (int i = 0; i < dt.Rows.Count; i++) { //dt.Rows[i]["Name"].ToString(); "Name"即为Excel中Name列的表头 string excl_xuehao = dt.Rows[i][0].ToString(); //学号 string excl_name = dt.Rows[i][1].ToString(); //姓名 string excl_sex = dt.Rows[i][2].ToString(); //性别 string excl_Birthday = dt.Rows[i][3].ToString(); //生日 string excl_nationality = dt.Rows[i][4].ToString(); //民族 string excl_address = dt.Rows[i][5].ToString(); //家庭住址 string excl_ksname = dt.Rows[i][6].ToString(); //科室名称 string excl_nianji = dt.Rows[i][7].ToString(); //年级 string excl_banji = dt.Rows[i][8].ToString(); //班级 string excl_tel = dt.Rows[i][9].ToString(); //电话号码 string excl_tel2 = dt.Rows[i][10].ToString(); //其他联系方式 string excl_jieji = dt.Rows[i][11].ToString(); //届级 string UserPwd = Encryp.DESEncrypt("123456"); //string userid = Session["userid"].ToString(); //string sqlcl = "select classid from tb_user where id=" + userid; //string MenuId = HXD.DBUtility.SQLHelper.ExecuteScalar(sqlcl).ToString(); string MenuId = LoginCheck.getadminid();//学校ID if (excl_xuehao != "" && excl_name != "" && excl_nianji != "" && excl_banji != "") { string sql = "select count(id) from tb_user where username='******'"; int count = Convert.ToInt32(HXD.DBUtility.SQLHelper.ExecuteScalar(sql)); if (count > 0) { updatecount++; } else { string sqlin1 = "insert into tb_User(UserName,UserPwd,GroupId,classid,islock)values('" + excl_xuehao + "','" + UserPwd + "',1,'" + MenuId + "',1)"; HXD.DBUtility.SQLHelper.ExecuteScalar(sqlin1); System.Threading.Thread.Sleep(100); string sqlin2 = "select id from tb_User where UserName='******' and datediff(mi,RegTime,getdate())<=1"; string icd = HXD.DBUtility.SQLHelper.ExecuteScalar(sqlin2).ToString(); Session["userid"] = icd; string sqlin3 = "insert into tb_U_User (Id,msn,name,sex,shengri,nationality,Address,ks_name,nianji,banji,tel,Mobile,jieji,sc_id)values('" + icd + "','" + excl_xuehao + "','" + excl_name + "','" + excl_sex + "','" + excl_Birthday + "','" + excl_nationality + "','" + excl_address + "','" + excl_ksname + "','" + excl_nianji + "','" + excl_banji + "','" + excl_tel + "','" + excl_tel2 + "','" + excl_jieji + "','" + MenuId + "')"; HXD.DBUtility.SQLHelper.ExecuteScalar(sqlin3); //string sqlinsert = "insert into users(Name,Sex,Age,Address) values('" + Name + "','" + Sex + "'," + Age + ",'" + Address + "')"; //HXD.DBUtility.SQLHelper.ExecuteNonQuery(sqlinsert); insertcount++; } } else { errorcount++; } } string msgg = insertcount + "条数据导入成功!" + updatecount + "条数据重复!" + errorcount + "条数据部分信息为空没有导入!"; StringDeal.Alter(msgg, "font_list2.aspx"); //catch (Exception ex) //{ }//} }
protected void Button2_Click(object sender, EventArgs e) { string sex = "", tj = "", stj = "", str_lb = ""; if (this.option1.Checked == true) { tj += "and sex='男'"; } if (this.option2.Checked == true) { tj += "and sex='女'"; } string str_mz = this.se_mz.Value;//民族 if (str_mz != "0") { tj += "and nationality='" + str_mz + "'"; } string str_jj = this.s123.SelectedValue;//届级 if (str_jj != "0") { tj += "and nianji='" + getsname(str_jj) + "'"; } string str_bj = this.Select2.SelectedValue;//班级 if (str_bj != "0") { tj += "and banji='" + getsname(str_bj) + "'"; } string strlb = this.Select3.Value;//量表 if (strlb == "0") { str_lb = ""; } else { str_lb = "and Fpaperid='" + strlb + "'"; } string name = this.TextBox1.Text;//名字 if (name != "") { tj += "and Name like '%" + name + "%'"; } string a_time = ks_time.Value;//开始时间 if (a_time != "") { str_lb += "and FtestTime>='" + a_time + "'"; } string b_time = js_time.Value;//结束时间 if (b_time != "") { str_lb += "and FtestTime<='" + b_time + "'"; } string classid = LoginCheck.getadminid(); string sqld = "select id from tb_User where Classid=" + classid + " and GroupId=1"; string sql = "select id from tb_U_user where id in(" + sqld + ") " + tj + ""; string sqlcc = "select FstudentNo,Name,nianji,banji,Fpaperid,Fscore,Fresult,FtestTime,Fresultid,wid from t_exam_results as a,tb_U_User as b where a.Fresultid=b.id and a.Fresultid in(" + sql + ") " + str_lb + ""; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sqlcc); DataTable dt = new DataTable(); DataColumn col = new DataColumn("学号", System.Type.GetType("System.String")); DataColumn col1 = new DataColumn("姓名", System.Type.GetType("System.String")); DataColumn col2 = new DataColumn("年级", System.Type.GetType("System.String")); DataColumn col3 = new DataColumn("班级", System.Type.GetType("System.String")); DataColumn col4 = new DataColumn("量表名称", System.Type.GetType("System.String")); DataColumn col5 = new DataColumn("得分", System.Type.GetType("System.String")); DataColumn col6 = new DataColumn("结果", System.Type.GetType("System.String")); DataColumn col7 = new DataColumn("因子结果", System.Type.GetType("System.String")); DataColumn col8 = new DataColumn("发布时间", System.Type.GetType("System.String")); dt.Columns.Add(col); dt.Columns.Add(col1); dt.Columns.Add(col2); dt.Columns.Add(col3); dt.Columns.Add(col4); dt.Columns.Add(col5); dt.Columns.Add(col6); dt.Columns.Add(col7); dt.Columns.Add(col8); DataRow row = dt.NewRow(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { row = dt.NewRow(); string Fpaperid = ds.Tables[0].Rows[i]["Fpaperid"].ToString(); row[0] = ds.Tables[0].Rows[i]["FstudentNo"].ToString(); row[1] = ds.Tables[0].Rows[i]["Name"].ToString(); row[2] = ds.Tables[0].Rows[i]["nianji"].ToString(); row[3] = ds.Tables[0].Rows[i]["banji"].ToString(); row[4] = getlbname(Fpaperid); row[5] = ds.Tables[0].Rows[i]["Fscore"].ToString(); row[6] = ds.Tables[0].Rows[i]["Fresult"].ToString(); row[7] = getyinzi(ds.Tables[0].Rows[i]["FstudentNo"].ToString(), ds.Tables[0].Rows[i]["wid"].ToString()); row[8] = ds.Tables[0].Rows[i]["FtestTime"].ToString(); dt.Rows.Add(row); } } System.Collections.SortedList List = new System.Collections.SortedList(); List.Add(0, "学号"); List.Add(1, "姓名"); List.Add(2, "年级"); List.Add(3, "班级"); List.Add(4, "量表名称"); List.Add(5, "得分"); List.Add(6, "结果"); List.Add(7, "因子结果"); List.Add(8, "发布时间"); HXD.DALFactory.ExcelHelper.ExportByWeb(dt, "测评结果", "报表.xls"); // Excelout.ExportByWeb(dt, "excel导出", "报表.xls"); string sds = "2017-09-04 17:22:31"; DateTime sd = DateTime.Parse(sds); HXD.DALFactory.Timess.DateStringFromNow(sd); }
protected void Button3_Click(object sender, EventArgs e) { string sex = "", tj = "", stj = "", str_lb = ""; if (this.option1.Checked == true) { tj += "and sex='男'"; } if (this.option2.Checked == true) { tj += "and sex='女'"; } string str_mz = this.se_mz.Value;//民族 if (str_mz != "0") { tj += "and nationality='" + str_mz + "'"; } string str_jj = this.s123.SelectedValue;//届级 if (str_jj != "0") { tj += "and nianji='" + getsname(str_jj) + "'"; } string str_bj = this.Select2.SelectedValue;//班级 if (str_bj != "0") { tj += "and banji='" + getsname(str_bj) + "'"; } string strlb = this.Select3.Value;//量表 if (strlb == "0") { HXD.Common.StringDeal.Alter("必须选择量表!"); } else { str_lb = "and Fpaperid='" + strlb + "'"; } string name = this.TextBox1.Text;//名字 if (name != "") { tj += "and Name like '%" + name + "%'"; } string a_time = ks_time.Value;//开始时间 if (a_time != "") { str_lb += "and FtestTime>='" + a_time + "'"; } string b_time = js_time.Value;//结束时间 if (b_time != "") { str_lb += "and FtestTime<='" + b_time + "'"; } string classid = LoginCheck.getadminid(); string sqld = "select id from tb_User where Classid=" + classid + " and GroupId=1"; string sql = "select id from tb_U_user where id in(" + sqld + ") " + tj + ""; string sqlcc = "select FstudentNo,Name,nianji,banji,Fpaperid,Fscore,Fresult,FtestTime,Fresultid,wid from t_exam_results as a,tb_U_User as b where a.Fresultid=b.id and a.Fresultid in(" + sql + ") " + str_lb + ""; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sqlcc); DataTable dt = new DataTable(); string sqllb = "select Fsubitemname from t_exam_subitems where Fpaperid='" + strlb + "' order by Fsortfield"; DataSet dslb = HXD.DBUtility.SQLHelper.ExecuteDataset(sqllb); dt.Columns.Add("学号", System.Type.GetType("System.String")); dt.Columns.Add("姓名", System.Type.GetType("System.String")); dt.Columns.Add("年级", System.Type.GetType("System.String")); dt.Columns.Add("班级", System.Type.GetType("System.String")); dt.Columns.Add("量表名称", System.Type.GetType("System.String")); dt.Columns.Add("得分", System.Type.GetType("System.String")); dt.Columns.Add("结果", System.Type.GetType("System.String")); if (dslb.Tables[0].Rows.Count > 0) { for (int i = 0; i < dslb.Tables[0].Rows.Count; i++) { dt.Columns.Add(dslb.Tables[0].Rows[i]["Fsubitemname"].ToString(), System.Type.GetType("System.String")); } } dt.Columns.Add("发布时间", System.Type.GetType("System.String")); DataRow row = dt.NewRow(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { row = dt.NewRow(); string Fpaperid = ds.Tables[0].Rows[i]["Fpaperid"].ToString(); row["学号"] = ds.Tables[0].Rows[i]["FstudentNo"].ToString(); row["姓名"] = ds.Tables[0].Rows[i]["Name"].ToString(); row["年级"] = ds.Tables[0].Rows[i]["nianji"].ToString(); row["班级"] = ds.Tables[0].Rows[i]["banji"].ToString(); row["量表名称"] = getlbname(Fpaperid); row["得分"] = ds.Tables[0].Rows[i]["Fscore"].ToString(); row["结果"] = ds.Tables[0].Rows[i]["Fresult"].ToString(); //dt.Rows.Add(getyinzi(ds.Tables[0].Rows[i]["FstudentNo"].ToString(), ds.Tables[0].Rows[i]["wid"].ToString())); string sqlsa = "select Fsubitemname,Fscore from t_exam_subitems_score as a,t_exam_subitems as b where a.Fsubitemid=b.Fsubitemid and a.FstudentNo='" + ds.Tables[0].Rows[i]["FstudentNo"].ToString() + "' and a.wid='" + ds.Tables[0].Rows[i]["wid"].ToString() + "' order by Fsortfield"; DataSet dsa = HXD.DBUtility.SQLHelper.ExecuteDataset(sqlsa); if (dsa.Tables[0].Rows.Count > 0) { for (int ii = 0; ii < dsa.Tables[0].Rows.Count; ii++) { string Fsubitemname = dsa.Tables[0].Rows[ii]["Fsubitemname"].ToString(); row[Fsubitemname] = dsa.Tables[0].Rows[ii]["Fscore"].ToString(); } } row["发布时间"] = ds.Tables[0].Rows[i]["FtestTime"].ToString(); dt.Rows.Add(row); } } HXD.DALFactory.ExcelHelper.ExportByWeb(dt, "测评结果", "报表.xls"); // Excelout.ExportByWeb(dt, "excel导出", "报表.xls"); string sds = "2017-09-04 17:22:31"; DateTime sd = DateTime.Parse(sds); HXD.DALFactory.Timess.DateStringFromNow(sd); }
/// <summary> /// 绑定量表 /// </summary> /// <param name="id"></param> /* protected void lb(string userid) * { * string setting = LoginCheck.LbManage(int.Parse(Session["userid"].ToString())); * //string sql1 = "select UserSetting from tb_User where id=" + userid; * //string UserSetting = HXD.DBUtility.SQLHelper.ExecuteScalar(sql1).ToString(); * setting = setting.Substring(1); * setting = setting.Substring(0, setting.Length - 1); * setting = setting.Replace("m", "0"); * string sql = "select Fpaperid,Fpapername from t_exam_paper where [User_id] in (" + setting + ")"; * DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); * * }*/ protected void Button1_Click(object sender, EventArgs e) { string sex = "", tj = "", stj = "", str_lb = ""; if (this.option1.Checked == true) { tj += "and sex='男'"; } if (this.option2.Checked == true) { tj += "and sex='女'"; } string str_mz = this.se_mz.Value;//民族 if (str_mz != "0") { tj += "and nationality='" + str_mz + "'"; } string name = this.TextBox1.Text;//名字 if (name != "") { tj += "and Name like '%" + name + "%'"; } string a_time = ks_time.Value;//开始时间 if (a_time != "") { str_lb += "and postTime>='" + a_time + "'"; } string b_time = js_time.Value;//结束时间 if (b_time != "") { str_lb += "and postTime<='" + b_time + "'"; } string classid = LoginCheck.getadminid(); string sqld = "select id from tb_User where Classid=" + classid + " and GroupId=1"; string sql = "select id from tb_U_user where id in(" + sqld + ") " + tj + ""; //string sql2 = "select id,Fresultid,FstudentNo,Fpaperid,Fscore,Fresult,postTime from t_exam_results where Fresultid in(" + sql + ")"; //Repeater1.DataSource = HXD.DBUtility.SQLHelper.ExecuteDataset(sql2); //Repeater1.DataBind(); HXD.ModelField.BLL.Model bll = new HXD.ModelField.BLL.Model(); HXD.ModelField.Model.Model mod = new HXD.ModelField.Model.Model(); mod.Condition = " Fresultid in(" + sql + ") " + str_lb + ""; mod.FieldList = "Fresultid,FstudentNo,Fpaperid,Fscore,Fresult,postTime"; mod.TableName = "t_exam_results"; mod.Sort = "postTime desc"; mod.PageSize = 20; mod.PageIndex = HXD.Common.StringDeal.ToInt(Request.QueryString["page"]); DataSet ds1 = bll.ModelList(mod); DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset("select top 20 id,Fresultid,FstudentNo,Fpaperid,Fscore,Fresult,postTime from t_exam_results where Fresultid in(" + sql + ") " + str_lb + " order by postTime desc,id desc;"); this.Repeater1.DataSource = ds1; this.Repeater1.DataBind(); HXD.Common.SgqPage pg = new HXD.Common.SgqPage(); pg.PageSize = mod.PageSize; pg.PageIndex = mod.PageIndex; pg.RecordCount = (int)ds1.Tables[1].Rows[0][0]; this.Literal1.Text = pg.PageView2(); if (pg.RecordCount == 0) { this.Literal1.Text = "暂无数据!"; } ds.Clear(); ds.Dispose(); ds1.Clear(); ds1.Dispose(); }
protected void Button1_Click1(object sender, EventArgs e) { string xsurl = ""; // if((Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "") if (Request.QueryString["ReturnUrl"] != null) { xsurl = Request.QueryString["ReturnUrl"].ToString(); xsurl = xsurl.Replace("[@]", "&"); } else { xsurl = "user/twolist.aspx"; } string url = ""; string uname = this.username.Value; uname = uname.Replace("'", ""); uname = HXD.Common.StringDeal.RemoveUnsafeHtml(uname); string userpsw = Encryp.DESEncrypt(this.pwd.Value); string classid = LoginCheck.getadminid(); string sql = "select * from tb_User where UserName='******' and UserPwd='" + userpsw + "' and classid='" + classid + "'"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); if (ds.Tables[0].Rows.Count > 0) { bool stra = bool.Parse(ds.Tables[0].Rows[0]["islock"].ToString()); if (stra == true) { Session["AdminManage"] = ds.Tables[0].Rows[0]["UserName"].ToString(); Session["userid"] = ds.Tables[0].Rows[0]["id"].ToString(); int groupid = int.Parse(ds.Tables[0].Rows[0]["GroupId"].ToString()); switch (groupid) { case 7: //局长 url = "Edu/ulist.aspx"; break; case 6: //校长 url = "edumaste/olist.aspx"; break; case 5: //老师 url = "user/tlist.aspx"; break; case 1: //学生 url = xsurl; break; default: break; } Response.Redirect(url); } else { Response.Redirect("user/"); } } else { Response.Write("用户名或密码错误"); } }