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) { Modelx m = new Modelx(); msbase ms = new msbase(); DataTable dt = null; ArrayList al = new ArrayList(); string uid = Request["UserID"]; Session["uid"] = uid; if (uid == null || m.getUserTypeByUserID(uid) ==null|| !m.getUserTypeByUserID(uid).Equals("T")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //string uid = m.UID; m.setNewWeek(); decimal pSerID = m.getPSerIDByUserID(uid); string sqlstm = "select * from YXZ_stuAppt where pSerID=" + pSerID + " order by weeknum desc;"; dt = ms.SelectSql(sqlstm); for (int i = 0; i < dt.Rows.Count;i++) { Modelx.stuAppt stu = new Modelx.stuAppt(); stu.SerID = Convert.ToDecimal(dt.Rows[i][0]); stu.UserID = m.getStuIDBySerID(stu.SerID); stu.StuName = m.getSnameBySerID(stu.SerID); stu.semavail = Convert.ToInt32(dt.Rows[i][1]); stu.pSerID = Convert.ToDecimal(dt.Rows[i][2]); stu.date = Convert.ToDateTime(dt.Rows[i][3]); stu.status = Convert.ToInt32(dt.Rows[i][4]); stu.weeknum = Convert.ToInt32(dt.Rows[i][5]); al.Add(stu); } Context.Items["al"] = al; }
protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); msbase ms = new msbase(); DataTable dt = null; ArrayList al = new ArrayList(); string uid = Request["UserID"]; Session["uid"] = uid; if (uid == null || m.getUserTypeByUserID(uid) == null || !m.getUserTypeByUserID(uid).Equals("T")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //string uid = m.UID; m.setNewWeek(); decimal pSerID = m.getPSerIDByUserID(uid); string sqlstm = "select * from YXZ_stuAppt where pSerID=" + pSerID + " order by weeknum desc;"; dt = ms.SelectSql(sqlstm); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.stuAppt stu = new Modelx.stuAppt(); stu.SerID = Convert.ToDecimal(dt.Rows[i][0]); stu.UserID = m.getStuIDBySerID(stu.SerID); stu.StuName = m.getSnameBySerID(stu.SerID); stu.semavail = Convert.ToInt32(dt.Rows[i][1]); stu.pSerID = Convert.ToDecimal(dt.Rows[i][2]); stu.date = Convert.ToDateTime(dt.Rows[i][3]); stu.status = Convert.ToInt32(dt.Rows[i][4]); stu.weeknum = Convert.ToInt32(dt.Rows[i][5]); al.Add(stu); } 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; ArrayList allApptmt = new ArrayList(); ArrayList p = new ArrayList(); string uid = Request["UserID"]; if (uid != null) { Session["uid"] = uid; } string userid = (string)Session["uid"]; if (userid == null || m.getUserTypeByUserID(userid) == null || !(m.getUserTypeByUserID(userid).Equals("Q") || m.getUserTypeByUserID(userid).Equals("M") || m.getUserTypeByUserID(userid).Equals("X"))) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //string uid = m.UID; m.setNewWeek(); int weeknum = m.getWeeknum(); m.principalInit(weeknum); string sqlstm1 = "select top(2) * from YXZ_principal where district='江锦';"; string sqlstm2 = "select top(2) * from YXZ_principal where district='采荷';"; dt = ms.SelectSql(sqlstm1); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); p.Add(pr); } dt = ms.SelectSql(sqlstm2); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); p.Add(pr); } for (int i = 0; i < p.Count; i++) { string sqlstm = "select * from YXZ_stuAppt where pSerID=" + ((Modelx.principal)p[i]).SerID + " order by weeknum desc;"; dt = ms.SelectSql(sqlstm); ArrayList apptmt = new ArrayList(); for (int j = 0; j < dt.Rows.Count; j++) { Modelx.stuAppt stu = new Modelx.stuAppt(); stu.SerID = Convert.ToDecimal(dt.Rows[j][0]); stu.semavail = Convert.ToInt32(dt.Rows[j][1]); stu.pSerID = Convert.ToDecimal(dt.Rows[j][2]); stu.date = Convert.ToDateTime(dt.Rows[j][3]); stu.weeknum = Convert.ToInt32(dt.Rows[j][5]); stu.StuName = m.getSnameBySerID(stu.SerID); apptmt.Add(stu); } allApptmt.Add(apptmt); } //for (int i = 0; i < al2.Count; i++) //{ // string sqlstm = "select * from YXZ_stuAppt where pSerID=" + ((Model.principal)al2[i]).SerID + ";"; // dt = ms.SelectSql(sqlstm); // Model.prst prst = new Model.prst(); // if (dt.Rows.Count > 0) // { // prst.sSerID = Convert.ToDecimal(dt.Rows[0][0]); // prst.sname = m.getSnameBySerID(prst.sSerID); // prst.semavail = Convert.ToInt32(dt.Rows[0][1]); // prst.pSerID = Convert.ToDecimal(dt.Rows[0][2]); // prst.pname = ((Model.principal)al2[i]).name; // prst.date = Convert.ToDateTime(dt.Rows[0][3]); // prst.status = Convert.ToInt32(dt.Rows[0][4]); // } // else // { // prst.pSerID = ((Model.principal)al2[i]).SerID; // prst.pname = ((Model.principal)al2[i]).name; // } // alprst.Add(prst); //} Context.Items["p"] = p; Context.Items["allApptmt"] = allApptmt; }
protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); Modelx.stuAppt stuAppt = new Modelx.stuAppt(); msbase ms = new msbase(); DataTable dt = null; string sqlstm; string sqlstm1; string sqlstm2; int t = 0, weeknum = 0; ArrayList al = new ArrayList(); ArrayList al1 = new ArrayList(); ArrayList al2 = new ArrayList(); /* sqlstm="select * from principal;"; cmd = new SqlCommand(sqlstm, conn); dr = cmd.ExecuteReader(); while(dr.Read()) { al.Add( dr.GetString(1)); } Context.Items["prcpl"] = al; dbh.closeConn(cmd, dr);*/ stuAppt.UserID = (string)Session["uid"]; if (stuAppt.UserID == null || m.getUserTypeByUserID(stuAppt.UserID) ==null|| !m.getUserTypeByUserID(stuAppt.UserID).Equals("S")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //stuAppt.UserID = m.uid; stuAppt.SerID = m.getSerIDByUserID(stuAppt.UserID); m.setNewWeek(); weeknum = m.getWeeknum(); Context.Items["weeknum"] = weeknum; sqlstm = "select * from YXZ_stuAppt where SerID=" + stuAppt.SerID + ";"; dt = ms.SelectSql(sqlstm); if (dt.Rows.Count > 0) { stuAppt.semavail = Convert.ToInt32(dt.Rows[0][1]); stuAppt.weeknum = Convert.ToInt32(dt.Rows[0][5]); if (stuAppt.semavail == 0) { stuAppt.pSerID = Convert.ToDecimal(dt.Rows[0][2]); stuAppt.date = Convert.ToDateTime(dt.Rows[0][3]); stuAppt.status = Convert.ToInt32(dt.Rows[0][4]); } } stuAppt.StuName = m.getSnameBySerID(stuAppt.SerID); Session["stu"] = stuAppt; //sqlstm = "select * from YXZ_rec where sSerID=" + stuAppt.SerID + " and pSerID=" + stuAppt.pSerID + " order by time;"; //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); //} //Context.Items["al"] = al; t = m.getWeekleft(weeknum); Context.Items["weekleft"] = t; m.principalInit(weeknum); sqlstm1 = "select top(2) * from YXZ_principal where district='江锦' and avail=1;"; sqlstm2 = "select top(2) * from YXZ_principal where district='采荷' and avail=1;"; dt = ms.SelectSql(sqlstm1); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); al1.Add(pr); } Context.Items["al1"] = al1; dt = ms.SelectSql(sqlstm2); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); al2.Add(pr); } Context.Items["al2"] = al2; }
protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); msbase ms = new msbase(); DataTable dt = null; ArrayList allApptmt= new ArrayList(); ArrayList p= new ArrayList(); string uid = Request["UserID"]; if (uid != null) { Session["uid"] = uid; } string userid=(string)Session["uid"]; if (userid == null || m.getUserTypeByUserID(userid) ==null|| !(m.getUserTypeByUserID(userid).Equals("Q") || m.getUserTypeByUserID(userid).Equals("M") || m.getUserTypeByUserID(userid).Equals("X"))) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //string uid = m.UID; m.setNewWeek(); int weeknum = m.getWeeknum(); m.principalInit(weeknum); string sqlstm1 = "select top(2) * from YXZ_principal where district='江锦';"; string sqlstm2 = "select top(2) * from YXZ_principal where district='采荷';"; dt = ms.SelectSql(sqlstm1); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); p.Add(pr); } dt = ms.SelectSql(sqlstm2); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); p.Add(pr); } for (int i = 0; i < p.Count; i++) { string sqlstm = "select * from YXZ_stuAppt where pSerID=" + ((Modelx.principal)p[i]).SerID + " order by weeknum desc;"; dt = ms.SelectSql(sqlstm); ArrayList apptmt = new ArrayList(); for(int j=0;j<dt.Rows.Count;j++) { Modelx.stuAppt stu = new Modelx.stuAppt(); stu.SerID = Convert.ToDecimal(dt.Rows[j][0]); stu.semavail = Convert.ToInt32(dt.Rows[j][1]); stu.pSerID = Convert.ToDecimal(dt.Rows[j][2]); stu.date = Convert.ToDateTime(dt.Rows[j][3]); stu.weeknum= Convert.ToInt32(dt.Rows[j][5]); stu.StuName = m.getSnameBySerID(stu.SerID); apptmt.Add(stu); } allApptmt.Add(apptmt); } //for (int i = 0; i < al2.Count; i++) //{ // string sqlstm = "select * from YXZ_stuAppt where pSerID=" + ((Model.principal)al2[i]).SerID + ";"; // dt = ms.SelectSql(sqlstm); // Model.prst prst = new Model.prst(); // if (dt.Rows.Count > 0) // { // prst.sSerID = Convert.ToDecimal(dt.Rows[0][0]); // prst.sname = m.getSnameBySerID(prst.sSerID); // prst.semavail = Convert.ToInt32(dt.Rows[0][1]); // prst.pSerID = Convert.ToDecimal(dt.Rows[0][2]); // prst.pname = ((Model.principal)al2[i]).name; // prst.date = Convert.ToDateTime(dt.Rows[0][3]); // prst.status = Convert.ToInt32(dt.Rows[0][4]); // } // else // { // prst.pSerID = ((Model.principal)al2[i]).SerID; // prst.pname = ((Model.principal)al2[i]).name; // } // alprst.Add(prst); //} Context.Items["p"] = p; Context.Items["allApptmt"] = allApptmt; }
protected void Page_Load(object sender, EventArgs e) { Modelx m = new Modelx(); Modelx.stuAppt stuAppt = new Modelx.stuAppt(); msbase ms = new msbase(); DataTable dt = null; string sqlstm; string sqlstm1; string sqlstm2; int t = 0, weeknum = 0; ArrayList al = new ArrayList(); ArrayList al1 = new ArrayList(); ArrayList al2 = new ArrayList(); /* sqlstm="select * from principal;"; * cmd = new SqlCommand(sqlstm, conn); * dr = cmd.ExecuteReader(); * while(dr.Read()) { * al.Add( dr.GetString(1)); * } * Context.Items["prcpl"] = al; * dbh.closeConn(cmd, dr);*/ stuAppt.UserID = (string)Session["uid"]; if (stuAppt.UserID == null || m.getUserTypeByUserID(stuAppt.UserID) == null || !m.getUserTypeByUserID(stuAppt.UserID).Equals("S")) { Session["uid"] = null; Context.Response.Redirect("http://oa.chsx.cn/ISchoolOs/mainlogin.aspx"); } //stuAppt.UserID = m.uid; stuAppt.SerID = m.getSerIDByUserID(stuAppt.UserID); m.setNewWeek(); weeknum = m.getWeeknum(); Context.Items["weeknum"] = weeknum; sqlstm = "select * from YXZ_stuAppt where SerID=" + stuAppt.SerID + ";"; dt = ms.SelectSql(sqlstm); if (dt.Rows.Count > 0) { stuAppt.semavail = Convert.ToInt32(dt.Rows[0][1]); stuAppt.weeknum = Convert.ToInt32(dt.Rows[0][5]); if (stuAppt.semavail == 0) { stuAppt.pSerID = Convert.ToDecimal(dt.Rows[0][2]); stuAppt.date = Convert.ToDateTime(dt.Rows[0][3]); stuAppt.status = Convert.ToInt32(dt.Rows[0][4]); } } stuAppt.StuName = m.getSnameBySerID(stuAppt.SerID); Session["stu"] = stuAppt; //sqlstm = "select * from YXZ_rec where sSerID=" + stuAppt.SerID + " and pSerID=" + stuAppt.pSerID + " order by time;"; //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); //} //Context.Items["al"] = al; t = m.getWeekleft(weeknum); Context.Items["weekleft"] = t; m.principalInit(weeknum); sqlstm1 = "select top(2) * from YXZ_principal where district='江锦' and avail=1;"; sqlstm2 = "select top(2) * from YXZ_principal where district='采荷' and avail=1;"; dt = ms.SelectSql(sqlstm1); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); al1.Add(pr); } Context.Items["al1"] = al1; dt = ms.SelectSql(sqlstm2); for (int i = 0; i < dt.Rows.Count; i++) { Modelx.principal pr = new Modelx.principal(); pr.SerID = Convert.ToDecimal(dt.Rows[i][0]); pr.name = dt.Rows[i][2].ToString(); pr.district = dt.Rows[i][3].ToString(); pr.avail = Convert.ToInt32(dt.Rows[i][4]); pr.weeknum = Convert.ToInt32(dt.Rows[i][5]); al2.Add(pr); } Context.Items["al2"] = al2; }