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 addButton_Click( object sender , EventArgs e ) { string sysmc = MCTextBox.Text.Trim(); string sysdd = DDTextBox.Text.Trim(); string sysms = MSTextBox.Text.Trim(); int sysrl = Convert.ToInt32(RLTextBox.Text.Trim()); int syslxid = Convert.ToInt32( SYSLXDDL.SelectedValue ); int ttpbs = 0;// = Convert.ToInt32(TTPBTextBox.Text.Trim()); dbModule dm = new dbModule(); int i = dm.addSysxx( sysmc , sysdd , sysrl , syslxid , sysms , ttpbs ); switch ( i ) { case 1://正常添加成功 messageLabel.Text = Resources.Resource.strAddNewSuccess; MCTextBox.Text = ""; DDTextBox.Text = ""; MSTextBox.Text = ""; RLTextBox.Text = ""; SYSLXDDL.DataBind(); //TTPBTextBox.Text = ""; break; default://添加失败 messageLabel.Text = Resources.Resource.strAddNewFailed; break; } }
protected void addButton_Click( object sender , EventArgs e ) { string symc = MCTextBox.Text.Trim(); string sykcid = SYKCDDL.SelectedValue; int sylxid = Convert.ToInt32( SYLXDDL.SelectedValue ); int sylbid = Convert.ToInt32( SYLBDDL.SelectedValue ); int syyqid = Convert.ToInt32( SYYQDDL.SelectedValue ); int syzlbid = Convert.ToInt32(SYZLBDDL.SelectedValue); int syxs = Convert.ToInt32( SYXSTextBox.Text.Trim() ); string nrdxz = ""; string yrdxz = ""; string syjj = SYJJTextBox.Text.Trim(); dbModule dm = new dbModule(); int i = dm.addSyxx( symc , sykcid , sylxid , sylbid , syyqid , syzlbid , syxs , nrdxz , yrdxz , syjj ); switch ( i ) { case 1://正常添加成功 messageLabel.Text = Resources.Resource.strAddNewSuccess; MCTextBox.Text = ""; SYXSTextBox.Text = ""; //NRDXZTextBox.Text = ""; //YRDXZTextBox.Text = ""; SYKCDDL.DataBind(); SYLXDDL.DataBind(); SYLBDDL.DataBind(); SYYQDDL.DataBind(); SYZLBDDL.DataBind(); SYJJTextBox.Text = ""; break; default://添加失败 messageLabel.Text = Resources.Resource.strAddNewFailed; break; } }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { if (s.getUserXy().ToString() != "") { SqlDataSource1.SelectCommand = "SELECT [ID], [KCBH], [KCMC], [JSID], [JSXM], [KCXX],[KCXS], [SFAPSY], [SKRS] FROM [V_KCJBXXB] WHERE [XYID] = " + s.getUserXy().ToString() + " ORDER BY [KCBH],KCMC,JSXM"; } else { SqlDataSource1.SelectCommand = "SELECT [ID], [KCBH], [KCMC], [JSID], [JSXM], [KCXX],[KCXS], [SFAPSY], [SKRS] FROM [V_KCJBXXB] ORDER BY [KCBH],KCMC,JSXM"; } } else { if (s.getUserXy().ToString() != "") { SqlDataSource1.SelectCommand = "SELECT [ID], [KCBH], [KCMC], [JSID], [JSXM], [KCXX],[KCXS], [SFAPSY], [SKRS] FROM [V_KCJBXXB] WHERE [XYID] = " + s.getUserXy().ToString() + " AND (kcbh like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or kcxx like '%" + sxtj + "%' ) ORDER BY KCBH,KCMC,JSXM"; } else { SqlDataSource1.SelectCommand = "SELECT [ID], [KCBH], [KCMC], [JSID], [JSXM], [KCXX],[KCXS], [SFAPSY], [SKRS] FROM [V_KCJBXXB] WHERE (kcbh like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or kcxx like '%" + sxtj + "%' ) ORDER BY KCBH,KCMC,JSXM"; } } }
protected void addButton_Click(object sender, EventArgs e) { string symc = MCTextBox.Text.Trim(); //int syxs = Convert.ToInt32(SYXSTextBox.Text.Trim()); string syjj = SYJJTextBox.Text.Trim(); string sydt = SYRQTextBox.Text.Trim(); string kssj = sydt + " " + s1.SelectedValue + ":" + s2.SelectedValue; string jssj = sydt + " " + s3.SelectedValue + ":" + s4.SelectedValue; int sysid = Convert.ToInt32(syfjDDL.SelectedValue); Security sec = Session["sec"] as Security; string sqrid = sec.getUserCode(); dbModule dm = new dbModule(); int i = dm.addZzsjxm( symc , syjj , sqrid ,sysid,kssj ,jssj ); switch (i) { case 1://正常添加成功 messageLabel.Text = Resources.Resource.strAddNewSuccess; MCTextBox.Text = ""; //SYXSTextBox.Text = ""; SYJJTextBox.Text = ""; break; default://添加失败 messageLabel.Text = Resources.Resource.strAddNewFailed; break; } }
protected void addButton_Click( object sender , EventArgs e ) { dbModule dm = new dbModule(); string xh = XHTextBox.Text.Trim(); string xsxm = XMTextBox.Text.Trim(); string sjh = SJHTextBox.Text.Trim(); string yjdz = YJDZTextBox.Text.Trim(); int nj = Convert.ToInt32( NJTextBox.Text.Trim() ); int xyid = Convert.ToInt32( XYDDL.SelectedValue ); int xslbid = Convert.ToInt32(LBDDL.SelectedValue); int zyid = Convert.ToInt32(ZYDDL.SelectedValue); int i = dm.addXsxx( xh , xsxm , sjh , yjdz , xyid , xslbid , zyid,nj ); switch ( i ) { case 1://正常添加成功 messageLabel.Text = Resources.Resource.strAddNewSuccess; XHTextBox.Text = ""; XMTextBox.Text = ""; SJHTextBox.Text = ""; YJDZTextBox.Text = ""; XYDDL.DataBind(); LBDDL.DataBind(); ZYDDL.DataBind(); break; default://添加失败 messageLabel.Text = Resources.Resource.strAddNewFailed; break; } }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } dbModule dm = new dbModule(); SqlDataSource1.SelectCommand = "SELECT [ID], [GLYXM], [SYSID], [GLYID], [SYSMC], [SYSDD] FROM [V_SYSGLY]"; if (s.getUserXy() != "") { SqlDataSource1.SelectCommand = "SELECT [ID], [GLYXM], [SYSID], [GLYID], [SYSMC], [SYSDD] FROM [V_SYSGLY] WHERE [GLYXY] = "+ s.getUserXy(); GLYSDS.SelectCommand = "SELECT [DLM], [GLYXM] FROM [T_GLYXXB] WHERE ([GLYLX] = @GLYLX) AND ([GLYXY] = " + s.getUserXy() + ") ORDER BY [GLYXM]"; SYSSDS.SelectCommand= "SELECT [ID], [LXMC] FROM [D_SYSLXB] WHERE [XYID] = " + s.getUserXy(); SYFJSDS.SelectCommand = "SELECT [ID], [SYSMC], [SYSLXID] FROM [T_SYSXXB] WHERE ([SYSLXID] = @SYSLXID)"; } if ( !IsPostBack ) { //SYFJDDL.DataSourceID = "SYFJSDS"; //SYFJDDL.DataTextField = "SYSMC"; //SYFJDDL.DataValueField = "ID"; //SYFJDDL.DataBind(); } }
protected void Button1_Click( object sender , EventArgs e ) { int syid = Convert.ToInt32(Request["id"]); string jjyy = jjyyTextBox.Text.Trim(); dbModule dm = new dbModule(); dm.spsjxmjj( syid , jjyy ); messageLabel.Text = Resources.Resource.strOperateSuccess; jjyyTextBox.Text = ""; }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } dbModule dm = new dbModule(); int syid = Convert.ToInt32( Request["id"] ); symcTextBox.Text = dm.getSymcBySyid(syid); kcmcTextBox.Text = dm.getKcmcBySyid(syid); string kcbh = dm.getKcidBySyid( syid ); syddSDS.SelectCommand = "SELECT [ID], [SYSDD], [SYSMC] FROM [T_SYSXXB] where id = 0 or [ID] IN (select sysid from v_gly_sys_kc where glyid='" + s.getUserCode() + "' and kcid='" + kcbh + "')"; }
protected void addButton_Click( object sender , EventArgs e ) { int skrs=0; int kcxs=0; string kcbh = KCBHTextBox.Text.Trim(); string kcmc = KCMCTextBox.Text.Trim(); string jsid = JSDDL.SelectedValue; string kcxx = KCXXTextBox.Text.Trim(); try { kcxs = Convert.ToInt32(KCXSTextBox.Text.Trim()); } catch { messageLabel.Text = Resources.Resource.strNotValidInt; } try { skrs = Convert.ToInt32(SKRSTextBox.Text.Trim()); } catch { messageLabel.Text = Resources.Resource.strNotValidInt; } dbModule dm = new dbModule(); Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } int xyid = Int32.Parse(s.getUserXy()); int i = dm.addKcxx(kcbh, kcmc, jsid, kcxx, kcxs, skrs, xyid); switch ( i ) { case 1://正常添加成功 messageLabel.Text = Resources.Resource.strAddNewSuccess; KCBHTextBox.Text = ""; KCMCTextBox.Text = ""; KCXXTextBox.Text = ""; KCXSTextBox.Text = ""; SKRSTextBox.Text = ""; JSDDL.DataBind(); break; default://添加失败 messageLabel.Text = Resources.Resource.strAddNewFailed; break; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dbModule dm = new dbModule(); int id = Convert.ToInt32(Request["id"]); if (id != null) { lbldate.Text = dm.getTongZhiDateById(id); lblmsg.Text = dm.getTongZhiNeiRongById(id); lbltitle.Text = dm.getTongZhiBiaoTiById(id); lblusername.Text = dm.getTongZhiFaBuById(id); } } }
protected void GridView1_RowUpdating( object sender , GridViewUpdateEventArgs e ) { int sysid = Convert.ToInt32( e.NewValues["SYSID"].ToString() ); //string syxn = e.OldValues["SYXN"].ToString(); //int syxq = Convert.ToInt32( e.OldValues["SYXQ"].ToString() ); int syz = Convert.ToInt32( e.NewValues["SYZ"].ToString() ); int syxingq = Convert.ToInt32( e.NewValues["SYXINGQ"].ToString() ); int syks = Convert.ToInt32( e.NewValues["SYKS"].ToString() ); dbModule dm = new dbModule(); if ( dm.cfjh( sysid , "noneed" , 0 , syz , syxingq , syks ) != 0 ) { messageLabel.Text = "实验安排冲突,已强制安排实验。"; //Resources.Resource.strDuplicateSJString; e.Cancel = false; return; } messageLabel.Text = ""; }
protected void btnExport_Click(object sender, EventArgs e) { Security s= Session["sec"] as Security; if (s==null) { Response.Redirect("error.aspx"); } string jsid = s.getUserCode(); dbModule dm = new dbModule(); string kcbh = KCDDL.SelectedValue; int syid= Convert.ToInt32(SYDDL.SelectedValue); DataTable dt = dm.getSyqdqk( kcbh ,syid,jsid ); GridView1.DataSource = dt; GridView1.DataBind(); GridView1.Caption = KCDDL.SelectedItem.Text + "---" + SYDDL.SelectedItem.Text + "签到情况"; string fileName = "export.xls"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); System.IO.StringWriter sw = new System.IO.StringWriter(sb); HtmlTextWriter htw = new HtmlTextWriter(sw); Page page = new Page(); HtmlForm form = new HtmlForm(); // Deshabilitar la validación de eventos, sólo asp.net 2 page.EnableEventValidation = false; // Realiza las inicializaciones de la instancia de la clase Page que requieran los diseñadores RAD. page.DesignerInitialize(); page.Controls.Add(form); form.Controls.Add(GridView1); page.RenderControl(htw); Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); Response.Charset = "UTF-8"; Response.ContentEncoding = System.Text.Encoding.Default; Response.Write(sb.ToString()); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [ID], [SYBH], [SYMC], [KCMC], [JSXM], [SYSMC], [SYRS], [SYXN], [SYXINGQ], [SYXQ], [SYSDD], [XINGQMC], [ZMC], [MC],[SYZLBID],[XSLB], [sqrs], [sprs] FROM [V_XKRSB]"; } else { SqlDataSource1.SelectCommand = "SELECT [ID], [SYBH], [SYMC], [KCMC], [JSXM], [SYSMC], [SYRS], [SYXN], [SYXINGQ], [SYXQ], [SYSDD], [XINGQMC], [ZMC], [MC],[SYZLBID],[XSLB], [sqrs], [sprs] FROM [V_XKRSB] where ( sybh like '%" + sxtj + "%' or symc like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or syxn like '%" + sxtj + "%' or syxq like '%" + sxtj + "%' or zmc like '%" + sxtj + "%' or xingqmc like '%" + sxtj + "%' or mc like '%" + sxtj + "%')"; } }
protected void Page_Load(object sender, EventArgs e) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [ID], [SYBH], [SYMC], [KCMC], [JSXM], [SYSMC], [SYRS], [SYXN], [SYXINGQ], [SYXQ], [SYSDD], [XINGQMC], [ZMC], [MC], [sqrs], [sprs] FROM [V_YWCXSRSB] where sqzt=1 and syid in (select syid from t_syxxb where kcid in (select id from v_kcxxb where id in( select kcbh from t_kcxxb where id in (select kcid from t_xsxkb where xsxh='" + s.getUserCode() + "')) and (xslb='不限' or xslb='" + dm.getXslbByXh(s.getUserCode()) + "'))) order by sybh"; } else { SqlDataSource1.SelectCommand = "SELECT [ID], [SYBH], [SYMC], [KCMC], [JSXM], [SYSMC], [SYRS], [SYXN], [SYXINGQ], [SYXQ], [SYSDD], [XINGQMC], [ZMC], [MC], [sqrs], [sprs] FROM [V_YWCXSRSB] where sqzt=1 and syid in (select syid from t_syxxb where kcid in (select id from v_kcxxb where id in( select kcbh from t_kcxxb where id in (select kcid from t_xsxkb where xsxh='" + s.getUserCode() + "')) and (xslb='不限' or xslb='" + dm.getXslbByXh(s.getUserCode()) + "')" + " and (sybh like '%" + sxtj + "%' or symc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or sysdd like '%" + sxtj + "%' or zmc like '%" + sxtj + "%' or mc like '%" + sxtj + "%' or syxn like '%" + sxtj + "%' or syxq like '%" + sxtj + "%'))) order by sybh"; } }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if ( s == null ) { Response.Redirect( "error.aspx" ); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [ID],[SYBH], [SYID], [SYJSID], [JSXM], [SYSID], [SYXN], [SYRS], [SYKS], [SYSDD], [SYZ], [SYXQ], [XSXM], [SQRID], [SYJJ], [SYXS], [SYMC], [SYXINGQ], [XYMC], [SJH], [YJDZ], [LBMC], [XYID], [ZYID], [ZYMC], [XSLBID],[XINGQMC],[ZMC],[MC],[KSSJ],[JSSJ] FROM [V_ZZSJXMJHB] ORDER BY [SYBH]"; } else { SqlDataSource1.SelectCommand = "SELECT [ID],[SYBH], [SYID], [SYJSID], [JSXM], [SYSID], [SYXN], [SYRS], [SYKS], [SYSDD], [SYZ], [SYXQ], [XSXM], [SQRID], [SYJJ], [SYXS], [SYMC], [SYXINGQ], [XYMC], [SJH], [YJDZ], [LBMC], [XYID], [ZYID], [ZYMC], [XSLBID],[XINGQMC],[ZMC],[MC],[KSSJ],[JSSJ] FROM [V_ZZSJXMJHB] where (sybh like '%" + sxtj + "%' or symc like '%" + sxtj + "%' or sysmc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or syxn like '%" + sxtj + "%') ORDER BY [SYBH]"; } }
protected void Page_Load(object sender, EventArgs e) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [ID],[KCID], [SYID], [SYBH], [SYMC], [KCMC], [SYRS], [SYKS], [SYSID], [SYJSID], [SYSMC],[SYSDD], [JSXM], [SYXN], [SYXQ], [SYZ], [SYXINGQ],[MC],[XINGQMC],[ZMC] FROM [V_SYJHXXB] where SYJSID ='" + s.getUserCode() + "' ORDER BY [SYXN], [SYXQ],[SYZ],[SYXINGQ]"; } else { SqlDataSource1.SelectCommand = "SELECT [ID],[KCID], [SYID], [SYBH], [SYMC], [KCMC], [SYRS], [SYKS], [SYSID], [SYJSID], [SYSMC],[SYSDD], [JSXM], [SYXN], [SYXQ], [SYZ], [SYXINGQ],[MC],[XINGQMC],[ZMC] FROM [V_SYJHXXB] where (symc like '%" + sxtj + "%' or sysdd like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or syxn like '%" + sxtj + "%' or syxq like '%" + sxtj + "%' or zmc like '%" + sxtj + "%' or xingqmc like '%" + sxtj + "%' or mc like '%" + sxtj + "%') and SYJSID ='" + s.getUserCode() + "' ORDER BY [SYXN], [SYXQ],[SYZ],[SYXINGQ]"; } }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if ( s == null ) { Response.Redirect( "error.aspx" ); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [ID], [SYMC], [KCID], [KCMC], [SYLBID], [SYLXID], [SYYQID], [LBMC], [LXMC], [SYZLBID],[XSLB],[SYXS],[NRDXZ],[YRDXZ],[SYJJ],[YQMC],[JSXM] FROM [V_SYSJXMXXB] where sqzt=-1 and kcid in (select kcid from v_gly_sys_kc where glyid='" + s.getUserCode() + "') ORDER BY [SYMC],[KCMC]"; } else { SqlDataSource1.SelectCommand = "SELECT [ID], [SYMC], [KCID], [KCMC], [SYLBID], [SYLXID], [SYYQID], [LBMC], [LXMC], [SYZLBID],[XSLB],[SYXS],[NRDXZ],[YRDXZ],[SYJJ],[YQMC],[JSXM] FROM [V_SYSJXMXXB] where sqzt=-1 and kcid in (select kcid from v_gly_sys_kc where glyid='" + s.getUserCode() + "') and (symc like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or lbmc like '%" + sxtj + "%' or lxmc like '%" + sxtj + "%') ORDER BY [SYMC],[KCMC]"; } }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if ( s == null ) { Response.Redirect( "error.aspx" ); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [SYKSSJ],[SYJSSJ],[SYSDD] ,[SJXMMC], [XMJJ], [SQRID], [SQZT], [XSXM], [XYID], [ZYID], [XSLBID], [SJH], [YJDZ], [ZYMC], [LBMC], [XYMC], [ID] FROM [V_ZZSJXMSQB] where sqzt=-1 order by SJXMMC"; } else { SqlDataSource1.SelectCommand = "SELECT [SYKSSJ],[SYJSSJ],[SYSDD] ,[SJXMMC], [XMJJ], [SQRID], [SQZT], [XSXM], [XYID], [ZYID], [XSLBID], [SJH], [YJDZ], [ZYMC], [LBMC], [XYMC], [ID] FROM [V_ZZSJXMSQB] where sqzt=-1 and ( SJXMMC like '%" + sxtj + "%' or syjj like '%" + sxtj + "%' or xsxm like '%" + sxtj + "%' or xymc like '%" + sxtj + "%' or zymc like '%" + sxtj + "%' or sjh like '%" + sxtj + "%' or yjdz like '%" + sxtj + "%' ) ORDER BY [SJXMMC]"; } }
protected void Page_Load(object sender, EventArgs e) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if (sxtj == "" || sxtj == null) { SqlDataSource1.SelectCommand = "SELECT ID,SYMC,SYBH,KCMC,JSXM,SYSDD,ZMC,XINGQMC,MC,XKZT,SQSJ,SYZT,JRSJ,LKSJ,syxn,syxq,syz,syxingq,syks FROM V_SYXKB WHERE XSXH='" + s.getUserCode() + "' ORDER BY syxn,syxq,syz,syxingq,syks"; } else { SqlDataSource1.SelectCommand = "SELECT ID,SYMC,SYBH,KCMC,JSXM,SYSDD,ZMC,XINGQMC,MC,XKZT,SQSJ,SYZT,JRSJ,LKSJ,syxn,syxq,syz,syxingq,syks FROM V_SYXKB WHERE XSXH='" + s.getUserCode() + "' and (symc like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or sybh like '%" + sxtj + "%' or zmc like '%" + sxtj + "%' or xingqmc like '%" + sxtj + "%' or syxn like '%" + sxtj + "%' or syxq like '%" + sxtj + "%' or mc like '%" + sxtj + "%' or sysdd like '%" + sxtj + "%') ORDER BY syxn,syxq,syz,syxingq,syks"; } //SqlDataSource1.SelectCommand = "SELECT ID,SYMC,SYBH,KCMC,JSXM,SYSDD,ZMC,XINGQMC,MC,XKZT,SQSJ,SYZT,JRSJ,LKSJ FROM V_SYXKB WHERE XSXH='" + s.getUserCode() + "'"; }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT [GZH], [JSXM], [ZC], [XYMC], [LBMC], [SJH], [YJDZ], [JSJJ], [XYID], [JSLB] FROM [V_JSJBXXB] WHERE [XYID] = "+s.getUserXy().ToString()+" ORDER BY [GZH]"; } else { SqlDataSource1.SelectCommand = "SELECT [GZH], [JSXM], [ZC], [XYMC], [LBMC], [SJH], [YJDZ], [JSJJ], [XYID], [JSLB] FROM [V_JSJBXXB] where [XYID] = " + s.getUserXy().ToString() + " AND (gzh like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or zc like '%" + sxtj + "%' or xymc like '%" + sxtj + "%' or lbmc like '%" + sxtj + "%' or sjh like '%" + sxtj + "%' or yjdz like '%" + sxtj + "%' ) ORDER BY [GZH]"; } SqlDataSource3.SelectCommand = "SELECT [ID], [XYMC] FROM [D_XYXXB] WHERE [ID] = " + s.getUserXy().ToString(); }
protected void Page_Load(object sender, EventArgs e) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if (sxtj == "" || sxtj == null) { SqlDataSource1.SelectCommand = "SELECT [KCBH], [KCMC], [JSID], [JSXM], [SYFS] FROM [V_XSSYFS] where XSXH='" + s.getUserCode() + "' ORDER BY [KCMC], [JSXM]"; } else { SqlDataSource1.SelectCommand = "SELECT [KCBH], [KCMC], [JSID], [JSXM], [SYFS] FROM [V_XSSYFS] WHERE XSXH='" + s.getUserCode() + "' and (kcbh like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or jsxm like '%" + sxtj + "%' or jsid like '%" + sxtj + "%' ) ORDER BY [KCMC], [JSXM]"; } //SqlDataSource1.SelectCommand = "SELECT ID,SYMC,SYBH,KCMC,JSXM,SYSDD,ZMC,XINGQMC,MC,XKZT,SQSJ,SYZT,JRSJ,LKSJ FROM V_SYXKB WHERE XSXH='" + s.getUserCode() + "'"; }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT XSXH,XSXM, XYID, ZYID, XSLBID, SJH,NJ, YJDZ,ZYMC,LBMC,XYMC FROM V_XSJBXX WHERE [XYID] = " + s.getUserXy().ToString(); } else { SqlDataSource1.SelectCommand = "SELECT XSXH,XSXM, XYID, ZYID, XSLBID, SJH,NJ, YJDZ,ZYMC,LBMC,XYMC FROM V_XSJBXX where [XYID] = " + s.getUserXy().ToString() + " AND xsxh like '%" + sxtj + "%' or xsxm like '%" + sxtj + "%' or xymc like '%" + sxtj + "%' or zymc like '%" + sxtj + "%' or lbmc like '%" + sxtj + "%' or sjh like '%" + sxtj + "%' or yjdz like '%" + sxtj + "%'"; } SqlDataSource3.SelectCommand = "SELECT [ID], [XYMC] FROM [D_XYXXB] WHERE [ID] = " + s.getUserXy().ToString(); }
protected void addButton_Click( object sender , EventArgs e ) { Security s = Session["sec"] as Security; string strBiaoTi = txtBiaoTi.Text; string strNeiRong = txtNeiRong.Text; string strFaBuRen = s.getUserName(); dbModule dm = new dbModule(); int i = dm.addTongZhi(strBiaoTi, strNeiRong, strFaBuRen); switch ( i ) { case 1://正常添加成功 messageLabel.Text = Resources.Resource.strAddNewSuccess; txtBiaoTi.Text = ""; txtNeiRong.Text = ""; break; default://添加失败 messageLabel.Text = Resources.Resource.strAddNewFailed; break; } }
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 Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if (s == null) { Response.Redirect("error.aspx"); } dbModule dm = new dbModule(); SqlDataSource1.SelectCommand = "SELECT [ID], [GLYXM], [SYSID], [GLYID], [SYSMC], [SYSDD] FROM [V_SYSGLY] where sysid in (select sysid from t_sysxxb where syslxid =" + dm.getZrSYSID( s.getUserCode()) +")"; SqlDataSource4.SelectCommand = "select id ,sysmc from t_sysxxb where syslxid =" + dm.getZrSYSID( s.getUserCode() ); if ( !IsPostBack ) { GLYDDL.DataSource = SqlDataSource3; GLYDDL.DataTextField = "GLYXM"; GLYDDL.DataValueField = "DLM"; GLYDDL.DataBind(); SYSDDL.DataSource = SqlDataSource4; SYSDDL.DataTextField = "SYSMC"; SYSDDL.DataValueField = "ID"; SYSDDL.DataBind(); } }
protected void Page_Load( object sender , EventArgs e ) { Security s = Session["sec"] as Security; if ( s == null ) { Response.Redirect( "error.aspx" ); } string sxtj = Session["sxtj"] as string; dbModule dm = new dbModule(); int flag = 0; int syjhid = 0; try { flag = Convert.ToInt32(Request["flag"]); syjhid = Convert.ToInt32(Request["id"]); } catch { flag = 0; } if (flag == 1) { dm.setSyjhSqzt(syjhid); Response.Redirect("eadm_syjh_bj.aspx"); } if ( sxtj == "" || sxtj == null ) { SqlDataSource1.SelectCommand = "SELECT sqzt,[ID],[KCID],[JSXM], [SYID], [SYBH], [SYMC], [KCMC], [SYRS], [SYKS], [SYSID], [SYJSID], [SYSMC],[SYSDD], [SYXN], [SYXQ], [SYZ], [SYXINGQ],[MC],[XINGQMC],[ZMC] FROM [V_SYJHXXB] where kcid in (select kcid from v_gly_sys_kc where glyid='" + s.getUserCode() + "') ORDER BY [SYMC], [SYBH]"; } else { SqlDataSource1.SelectCommand = "SELECT sqzt,[ID],[KCID], [SYID],[JSXM], [SYBH], [SYMC], [KCMC], [SYRS], [SYKS], [SYSID], [SYJSID], [SYSMC],[SYSDD],[SYXN], [SYXQ], [SYZ], [SYXINGQ],[MC],[XINGQMC],[ZMC] FROM [V_SYJHXXB] where kcid in (select kcid from v_gly_sys_kc where glyid='" + s.getUserCode() + "') and (sybh like '%" + sxtj + "%' or JSXM like '%" + sxtj + "%' or kcmc like '%" + sxtj + "%' or sysmc like '%" + sxtj + "%' or SYSDD like '%" + sxtj + "%' or syxn like '%" + sxtj + "%') ORDER BY [SYMC], [SYBH]"; } if (!IsPostBack) { //JSSDS.SelectCommand = "SELECT [ID], [SYMC]+'(' + [JSXM] + ')' as SYMC FROM [V_SYJBXXB] where kcid in (select kcid from v_gly_sys_kc where glyid='" + s.getUserCode() + "') ORDER BY [SYMC]"; SYSSDS.SelectCommand = "SELECT [ID], [SYSDD] FROM [T_SYSXXB] WHERE id in (select sysid from v_gly_sys_kc where glyid='" + s.getUserCode() + "') and ([ID] <> @ID) ORDER BY [SYSDD]"; } }
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; } }