protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); string uid = (string)Session["uid"]; //string uid = m.uid; if (uid == null || m.getUserTypeByUserID(uid) ==null|| m.getUserTypeByUserID(uid).Equals("T") || m.getUserTypeByUserID(uid).Equals("S") || m.getUserTypeByUserID(uid).Equals("P")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } string pidEn = Request["pid"]; string sidEn = Request["sid"]; decimal pid = Convert.ToDecimal(encryption.DeCode(pidEn)); decimal sid = Convert.ToDecimal(encryption.DeCode(sidEn)); Modelx.paginationUnit = 8; int pageNow = Convert.ToInt32(Context.Request["pageNow"]); if (pageNow == 0) { pageNow = 1; } int pageTotal = 0; string sqlstm = "select count(*) from YXZ_rec where sSerID=" + sid + " and pSerID=" + pid + " ;"; if (m.getCount(sqlstm) % (Modelx.paginationUnit) == 0) { pageTotal = m.getCount(sqlstm) / (Modelx.paginationUnit); } else { pageTotal = m.getCount(sqlstm) / (Modelx.paginationUnit) + 1; } Context.Items["pageTotal"] = pageTotal; ArrayList al = m.getConvBySPSerID(sid, pid, pageNow); Context.Items["al"] = al; }
protected void Page_Load(object sender, EventArgs e) { string sidEn = Request["sid"]; string pidEn = Request["pid"]; Modelx m = new Modelx(); //string uid = m.UID; string uid = (string)Session["uid"]; if (uid == null || m.getUserTypeByUserID(uid) == null || !m.getUserTypeByUserID(uid).Equals("S")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //string page = Request["page"]; //if (page == null) { page = ""; } ArrayList al = null; Modelx.paginationUnit = 8; int pageNow = Convert.ToInt32(Context.Request["pageNow"]); if (pageNow == 0) { pageNow = 1; } int pageTotal = 0; //decimal sid = Convert.ToDecimal(encryption.DeCode(sidEn)); //decimal pid = Convert.ToDecimal(encryption.DeCode(pidEn)); Modelx.stuAppt stu = new Modelx.stuAppt(); stu = (Modelx.stuAppt)Session["stu"]; if (stu != null) { decimal sid = Convert.ToDecimal(stu.SerID); decimal pid = Convert.ToDecimal(stu.pSerID); string sqlstm2 = "select count(*) from YXZ_rec where sSerID=" + sid + " and pSerID=" + pid + " ;"; if (m.getCount(sqlstm2) % (Modelx.paginationUnit) == 0) { pageTotal = m.getCount(sqlstm2) / (Modelx.paginationUnit); } else { pageTotal = m.getCount(sqlstm2) / (Modelx.paginationUnit) + 1; } Context.Items["pageTotal"] = pageTotal; /*if (page.Equals("list")) { * al = m.getConvBySPSerID(Convert.ToDecimal( sidEn),Convert.ToDecimal( pidEn)); * }*/ // else // { al = m.getConvBySPSerID(sid, pid, pageNow); // } Context.Items["conv"] = al; } }
protected void Page_Load(object sender, EventArgs e) { string sidEn = Request["sid"]; string pidEn = Request["pid"]; Modelx m = new Modelx(); //string uid = m.UID; string uid = (string)Session["uid"]; if (uid == null || m.getUserTypeByUserID(uid) ==null|| !m.getUserTypeByUserID(uid).Equals("S")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //string page = Request["page"]; //if (page == null) { page = ""; } ArrayList al = null; Modelx.paginationUnit = 8; int pageNow = Convert.ToInt32(Context.Request["pageNow"]); if (pageNow == 0) { pageNow = 1; } int pageTotal = 0; //decimal sid = Convert.ToDecimal(encryption.DeCode(sidEn)); //decimal pid = Convert.ToDecimal(encryption.DeCode(pidEn)); Modelx.stuAppt stu = new Modelx.stuAppt(); stu = (Modelx.stuAppt)Session["stu"]; if (stu != null) { decimal sid = Convert.ToDecimal(stu.SerID); decimal pid = Convert.ToDecimal(stu.pSerID); string sqlstm2 = "select count(*) from YXZ_rec where sSerID=" + sid + " and pSerID=" + pid + " ;"; if (m.getCount(sqlstm2) % (Modelx.paginationUnit) == 0) { pageTotal = m.getCount(sqlstm2) / (Modelx.paginationUnit); } else { pageTotal = m.getCount(sqlstm2) / (Modelx.paginationUnit) + 1; } Context.Items["pageTotal"] = pageTotal; /*if (page.Equals("list")) { al = m.getConvBySPSerID(Convert.ToDecimal( sidEn),Convert.ToDecimal( pidEn)); }*/ // else // { al = m.getConvBySPSerID(sid, pid, pageNow); // } Context.Items["conv"] = al; } }
protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); string uid = (string)Session["uid"]; if (uid == null || m.getUserTypeByUserID(uid) == null || !m.getUserTypeByUserID(uid).Equals("T")) { Session["uid"] = null; Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } ArrayList al = new ArrayList(); decimal SerID = Convert.ToDecimal(encryption.DeCode(Request["sid"])); decimal pSerID = Convert.ToDecimal(encryption.DeCode(Request["pid"])); Modelx.paginationUnit = 8; int pageNow = Convert.ToInt32(Context.Request["pageNow"]); if (pageNow == 0) { pageNow = 1; } int pageTotal = 0; if (SerID != 0) { string sqlstm2 = "select count(*) from YXZ_rec where sSerID=" + SerID + " and pSerID=" + pSerID + " ;"; if (m.getCount(sqlstm2) % (Modelx.paginationUnit) == 0) { pageTotal = m.getCount(sqlstm2) / (Modelx.paginationUnit); } else { pageTotal = m.getCount(sqlstm2) / (Modelx.paginationUnit) + 1; } Context.Items["pageTotal"] = pageTotal; al = m.getConvBySPSerID(SerID, pSerID, pageNow); Context.Items["al"] = al; } }
protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); msbase ms = new msbase(); DataTable dt = null; string sqlstm = null; ArrayList al = new ArrayList(); ArrayList msgbox = new ArrayList(); ArrayList date = new ArrayList(); int pageNow = Convert.ToInt32(Context.Request["pageNow"]); if (pageNow == 0) { pageNow = 1; } Modelx.paginationUnit = 8; int pageTotal = 0; string act = Request["act"]; if (act == null) { if (m.getCount() % (Modelx.paginationUnit) == 0) { pageTotal = m.getCount() / (Modelx.paginationUnit); } else { pageTotal = m.getCount() / (Modelx.paginationUnit) + 1; } // sqlstm = "select * from rec where msg !=('') order by time desc;"; sqlstm = "select top " + Modelx.paginationUnit + " * from YXZ_rec where recID not in (select top " + (pageNow - 1) * Modelx.paginationUnit + " recID from YXZ_rec where isConvAnnounced=1 and msg!='' order by time desc ) and isConvAnnounced=1 and msg!=''order by time desc;"; } else if (encryption.DeCode(act).Equals("search")) { Context.Items["pageTotal"] = pageTotal; string date1 = Request["date1"]; string date2 = Request["date2"]; string s = "select count(*) from YXZ_rec where isConvAnnounced=1 and msg!=('') and time between '" + date1 + "' and '" + date2 + "';"; if (m.getCount(s) % (Modelx.paginationUnit) == 0) { pageTotal = m.getCount(s) / (Modelx.paginationUnit); } else { pageTotal = m.getCount(s) / (Modelx.paginationUnit) + 1; } sqlstm = "select top " + Modelx.paginationUnit + " * from YXZ_rec where recID not in (select top " + (pageNow - 1) * Modelx.paginationUnit + " recID from YXZ_rec where isConvAnnounced=1 and msg!=('') and time between '" + date1 + "' and '" + date2 + "' order by time desc ) and isConvAnnounced=1 and msg!=('') and time between '" + date1 + "' and '" + date2 + "' order by time desc;"; } Context.Items["pageTotal"] = pageTotal; //dt = ms.SelectSql(sqlstm); //for (int i = 0; i < dt.Rows.Count; i++) //{ // Model.rec rec = new Model.rec(); // rec.recID = Convert.ToInt32(dt.Rows[i][0]); // rec.sSerID = Convert.ToDecimal(dt.Rows[i][1]); // rec.pSerID =Convert.ToDecimal(dt.Rows[i][2]); // rec.question = dt.Rows[i][3].ToString(); // rec.msg = dt.Rows[i][4].ToString(); // rec.time = Convert.ToDateTime(dt.Rows[i][5]); // al.Add(rec); //} al = m.getAnnouncedConv(pageNow); for (int i = 0; i < al.Count; i++) { if (i == 0) { ArrayList msg = new ArrayList(); date.Add(((Modelx.rec)al[i]).time); msg.Add(al[i]); msgbox.Add(msg); } else { Modelx.rec lr = (Modelx.rec)al[i - 1]; Modelx.rec r = (Modelx.rec)al[i]; if (r.time.Year.CompareTo(lr.time.Year) != 0 || r.time.Day.CompareTo(lr.time.Day) != 0 || r.time.Month.CompareTo(lr.time.Month) != 0) { ArrayList msg = new ArrayList(); date.Add(r.time); msg.Add(r); msgbox.Add(msg); } else { int count = msgbox.Count; ArrayList mssg = (ArrayList)msgbox[count - 1]; mssg.Add(r); } } } Context.Items["msgbox"] = msgbox; Context.Items["date"] = date; }