Esempio n. 1
0
 private void addNew()
 {
     string title = theContext.Request.Form["title"];
     string body = theContext.Request.Form["body"];
     int uid = Convert.ToInt32(theContext.Session["id"]);
     string reveivers = theContext.Request.Form["receivers"];
     boolRst myRst = new boolRst();
     myRst.message = myMail.add(title, body, uid, reveivers).ToString();
     myRst.rst = myRst.message != "0" ? true : false;
     theContext.Response.Write(Data.Type.objToJson(myRst));
 }
Esempio n. 2
0
 private void addNew()
 {
     string title = theContext.Request.Form["title"];
     string body = theContext.Request.Form["body"];
     int uid = Convert.ToInt32(theContext.Session["id"]);
     int sid = Convert.ToInt32(theContext.Session["sid"]);
     short grade=Convert .ToInt16( theContext.Request.Form["grade"]);
     short subject = Convert.ToInt16(theContext.Request.Form["subject"]);
     boolRst myRst = new boolRst();
     myRst.rst = myCourseware.add(uid, sid, title, body, grade, subject);
     theContext.Response.Write(Data.Type.objToJson(myRst));
 }
Esempio n. 3
0
 private void login()
 {
     string id=theContext.Request.Form["id"];
     string key=theContext.Request.Form["key"];
     short permission=Convert .ToInt16(theContext.Request.Form ["permission"]) ;
     boolRst myRst = new boolRst();
     Hashtable[] theUser = myUser.login(id, key, permission);
     myRst.rst= theUser.Count()!=0 ? true : false;
     if (myRst.rst)
     {
         theContext.Session["isLogin"] = "******";
         foreach (DictionaryEntry infoPar in theUser[0])
         {
             theContext.Session[infoPar.Key.ToString()] = infoPar.Value.ToString();
         }
         theContext.Session["password"] = null;
     }
     theContext.Response.Write(Data.Type.objToJson(myRst));
 }
Esempio n. 4
0
 private void addNew()
 {
     Hashtable inQuery = new Hashtable();
     inQuery["@cid"] = theContext.Request.Form["cid"].ToString();
     inQuery["@uid"] = (theContext.Session["isLogin"] == null || theContext.Session["isLogin"].ToString() != "true") ? "0" : theContext.Session["id"].ToString();
     inQuery["@topic_title"] = theContext.Request.Form["title"].ToString();
     inQuery["@topic_body"] = theContext.Request.Form["body"].ToString();
     boolRst myRst = new boolRst();
     myRst.message=myTopic.addNew(Convert.ToInt32(inQuery["@cid"]), Convert.ToInt32(inQuery["@uid"]), inQuery["@topic_title"].ToString(), inQuery["@topic_body"].ToString()).ToString();
     myRst.rst = myRst.message == "0" ? false : true;
     theContext.Response.Write(Data.Type.objToJson(myRst));
 }
Esempio n. 5
0
 private void commentsNew()
 {
     Hashtable inQuery = new Hashtable();
     inQuery["@tid"] = theContext.Request.Form["tid"].ToString();
     inQuery["@uid"] = (theContext.Session["isLogin"] == null || theContext.Session["isLogin"].ToString() != "true") ? "0" : theContext.Session["id"].ToString();
     inQuery["@body"] = theContext.Request.Form["body"].ToString().Replace("\n", "<br/>");
     boolRst myRst = new boolRst();
     myRst.rst = myTopic.commentsAdd(Convert.ToInt32(inQuery["@tid"]), Convert.ToInt32(inQuery["@uid"]), inQuery["@body"].ToString());
     theContext.Response.Write(Data.Type.objToJson(myRst));
 }