예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Modelx m = new Modelx();
        //string uid = m.UID;
        //string uid=(string)Session["uid"];
        //string UserSerIDen = (string )Session["UserSerID"];
        //string UserSerIDen = Request["UserSerID"];
        string uid = Request["UserID"];

        if (uid == null)
        {
            uid = (string)Session["uid"];
        }
        //if (UserSerIDen == null) { Response.Redirect("Login.aspx"); }
        if (uid != null)
        {
            //UserSerID = encryption.DeCode(UserSerIDen);
            //string UserSerID = "104165";
            string    UserSerID = m.getPSerIDByUserID(uid).ToString();
            DataTable dt        = ms.SelectSql("select * from v_userlist where UserSerID='" + UserSerID + "'");
            if (dt.Rows.Count > 0)
            {
                UserType = dt.Rows[0]["UserType"].ToString();
            }
            DataTable dm = ms.SelectSql("select * from v_userlist2 where UserSerID='" + UserSerID + "'");
            if (dm.Rows.Count > 0)
            {
                userphoto = dm.Rows[0]["userphoto"].ToString();
                teaname   = dm.Rows[0]["TeaName"].ToString();
            }
        }
    }
예제 #2
0
 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;
 }
예제 #3
0
    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;
    }
예제 #4
0
    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;
    }
예제 #5
0
    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;
    }
예제 #6
0
    /// <summary>
    /// 通过当前最后一条week记录的weeknum列得到当前是第几周,如果无记录,则插入一条,算做第一周。
    /// </summary>
    /// <returns>当前是第几周</returns>
    public int getWeeknum()
    {
        int weeknum = 0;

        dt = ms.SelectSql("select top 1 * from YXZ_week order by weeknum desc;");
        if (dt.Rows.Count > 0)
        {
            weeknum = Convert.ToInt32(dt.Rows[0][0]);
        }
        else
        {
            ms.ExeSql("insert into YXZ_week (weeknum,leftnum,date) values(1,4,getdate());");
            weeknum = 1;
        }
        return(weeknum);
    }
예제 #7
0
 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;
 }
예제 #8
0
    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;
    }