protected void loginButton_Click( object sender , EventArgs e ) { dbModule dm = new dbModule(); pbModule pm = new pbModule(); string uCode = ucodeTextbox.Text.Trim(); string uPass = upassTextbox.Text.Trim(); if ( !pm.isValidString( uCode) || !pm.isValidString( uPass ) ) { errors.Text = Resources.Resource.strNotValidString; return; } int result = dm.adminLogin( uCode , uPass ); switch ( result ) { case -1 : errors.Text = Resources.Resource.strWrongPasswordString; break; case 0: errors.Text = Resources.Resource.strWrongUsernameString; break; case 1: Security s = new Security(); s.setSecurity( priCode.xtgly ); s.setUserCode(ucodeTextbox.Text.Trim()); s.setUserName( dm.getUnameByUcode(uCode, priCode.xtgly ) ); Session["sec"] = s; Session["usercode"] = s.getUserCode(); Response.Redirect( "adminDefault.aspx" ); break; default: errors.Text = Resources.Resource.strDuplicateUserNameString; break; } }
protected void Button1_Click( object sender , EventArgs e ) { pbModule pm = new pbModule(); string xsxh = XSXHTextBox.Text.Trim(); if ( !pm.isValidString( xsxh ) ) { messageLabel.Text = Resources.Resource.strNotValidString; return; } dbModule dm = new dbModule(); string xsxm = dm.getXsxmByXh( xsxh ); if ( xsxm.Equals( "error!" ) ) { messageLabel.Text = Resources.Resource.strNotFoundString; return; } int syjhid = Convert.ToInt32( Request["ID"] ); Security sec = Session["sec"] as Security; string shrid = sec.getUserCode(); if ( dm.cfxk( syjhid , xsxh ) != 0 )//重复选课 { messageLabel.Text = Resources.Resource.strDuplicateXKString; return; } dm.sqxk( syjhid , xsxh , shrid ); Response.Redirect( Request.Url.AbsoluteUri ); }
protected void sxButton_Click( object sender , EventArgs e ) { pbModule pm = new pbModule(); string sxtj = sxtjTextBox.Text.Trim(); if ( pm.hasForbiddenChar( sxtj ) ) { messageLabel.Text = Resources.Resource.strNotValidShaiXuan; return; } else { Session["sxtj"] = sxtj; Response.Redirect( "aadm_jsxx_bj.aspx" ); } }
protected void Button1_Click( object sender , EventArgs e ) { pbModule pm = new pbModule(); if ( !pm.isValidIntString( syfzTextBox.Text.Trim() ) || !pm.isValidIntString( mzrsTextBox.Text.Trim() ) ) { messageLabel.Text = Resources.Resource.strNotValidInt; return; } dbModule dm = new dbModule(); int syid = Convert.ToInt32( Request["id"] ); string bhqz = sybhTextBox.Text.Trim(); int syfz = Convert.ToInt32( syfzTextBox.Text.Trim() ); int mzrs = Convert.ToInt32( mzrsTextBox.Text.Trim() ); string jsid = syjsDDL.SelectedValue; int sysid = Convert.ToInt32( syddDDL.SelectedValue ); dm.syfz( syid , bhqz, syfz , mzrs,sysid,jsid ); messageLabel.Text = Resources.Resource.strOperateSuccess; }
protected void Button1_Click(object sender, EventArgs e) { dbModule dm = new dbModule(); pbModule pm = new pbModule(); string oldpass = oldpassTextbox.Text.Trim(); string newpass1 = newpassTextbox1.Text.Trim(); string newpass2 = newpassTextbox2.Text.Trim(); if ( !pm.isValidString( oldpass) || !pm.isValidString( newpass1 )||!pm.isValidString(newpass2) ) { errors.Text = Resources.Resource.strNotValidString; return; } if (pm.isNullString(newpass1)) { errors.Text = ""; } Security s1 = Session["sec"] as Security; if (s1 == null) { errors.Text = "sorry"; return; } string username = s1.getUserCode(); if (dm.aadmLogin ( username , oldpass )==1) { if (newpass1==newpass2) { String sqlstr = "update t_glyxxb set dlmm='" + newpass1 + "' where dlm='" + username + "'"; if (dm.updatePasswd(sqlstr)==1) Response.Write("密码修改成功"); else Response.Write("密码修改失败"); } else Response.Write("两次密码输入不一致"); } else Response.Write("旧密码错误"); }
protected void Button1_Click(object sender, EventArgs e) { pbModule pm = new pbModule(); string xsxh = XSXHTextBox.Text.Trim(); if (!pm.isValidString(xsxh)) { messageLabel.Text = Resources.Resource.strNotValidString; return; } dbModule dm = new dbModule(); string xsxm = dm.getXsxmByXh(xsxh); if (xsxm.Equals("error!")) { messageLabel.Text = Resources.Resource.strNotFoundString; return; } string xslb = dm.getXslbByXh(xsxh); string yqlb = DetailsView1.Rows[5].Cells[1].Text; int syjhid = Convert.ToInt32(Request["ID"]); Security sec = Session["sec"] as Security; string shrid = sec.getUserCode(); if ( dm.cfxk( syjhid , xsxh ) != 0 )//重复选课 { messageLabel.Text = Resources.Resource.strDuplicateXKString; return; } if (xslb.Trim().Equals(yqlb) || yqlb.Equals("不限")) { dm.sqxk(syjhid ,xsxh ,shrid); messageLabel.Text = "学生:" + xsxm + "已经添加!"; } else { messageLabel.Text = "学生类别:" + xslb + "与实验要求类别:" + yqlb + "不一致,无法添加该学生:" + xsxm; return; } }
protected void loginButton_Click( object sender , EventArgs e ) { dbModule dm = new dbModule(); pbModule pm = new pbModule(); string uCode = ucodeTextbox.Text.Trim(); string uPass = upassTextbox.Text.Trim(); if ( !pm.isValidString( uCode) || !pm.isValidString( uPass ) ) { errors.Text = Resources.Resource.strNotValidString; return; } int result = 0; Security s = new Security(); string url = ""; switch (Convert.ToInt32(lb_DropList.SelectedValue)) { case 0://学生 result = dm.xsLogin(uCode, uPass); url = "stuDefault.aspx"; s.setSecurity(priCode.xs); s.setUserName(dm.getUnameByUcode(uCode, priCode.xs)); s.setUserXy(dm.getUxyByUcode(uCode, priCode.xs)); break; case 1://任课教师 result = dm.jsLogin(uCode, uPass); url = "teaDefault.aspx"; s.setUserName(dm.getUnameByUcode(uCode, priCode.js)); s.setUserXy(dm.getUxyByUcode(uCode, priCode.js)); s.setSecurity(priCode.js); break; case 2://实验教师 result = dm.eadmLogin(uCode, uPass); url = "eadmDefault.aspx"; s.setSecurity(priCode.sygly); s.setUserName(dm.getUnameByUcode(uCode, priCode.sygly)); s.setUserXy(dm.getUxyByUcode(uCode, priCode.sygly)); break; case 3://管理员 result = dm.adminLogin(uCode, uPass); url = "adminDefault.aspx"; s.setSecurity(priCode.xtgly); s.setUserName(dm.getUnameByUcode(uCode, priCode.xtgly)); s.setUserXy(dm.getUxyByUcode(uCode, priCode.xtgly)); break; case 4://教务管理员 result = dm.aadmLogin(uCode, uPass); url = "aadmDefault.aspx"; s.setSecurity(priCode.jwgly); s.setUserName(dm.getUnameByUcode(uCode, priCode.jwgly)); s.setUserXy(dm.getUxyByUcode(uCode, priCode.jwgly)); break; } switch ( result ) { case -1 : errors.Text = Resources.Resource.strWrongPasswordString; break; case 0: errors.Text = Resources.Resource.strWrongUsernameString; break; case 1: s.setUserCode(ucodeTextbox.Text.Trim()); Session["sec"] = s; Session["usercode"] = s.getUserCode(); Response.Redirect(url); break; default: errors.Text = Resources.Resource.strDuplicateUserNameString; break; } }