public void ProcessRequest(HttpContext context) { Logging logging = new Logging(); try { string CHECKRIDDLE = context.Request.Form["CHECKRIDDLE"];//获取题组号 logging.Infolog(typeof(isriddlegot), $" GET CHECKRIDDLE={CHECKRIDDLE}"); yuanxiao.LoginMoudle status = new yuanxiao.LoginMoudle(); string gotPname = dbwork.SelectSingle("Pname", "RiddleGroup", $" GID={CHECKRIDDLE}");//查询对应题组号用户ID的值,如果为0,那说明没有,如果有,就要查询到对应用户ID的名字并返回 if (gotPname != "") { status.status = gotPname;//如果已经被选掉了,就返回被谁选掉了 } else { status.status = "0";//没有人选调,就返回0 } context.Response.Write(JsonConvert.SerializeObject(status)); logging.Infolog(typeof(isriddlegot), $".ashx RETURN {JsonConvert.SerializeObject(status)}"); context.Response.End(); } catch (Exception ex) { if (ex.Message != "正在中止线程。" && ex.Message != "Thread was being aborted.") { logging.Errorlog(typeof(isriddlegot), ex.Message); context.Response.Write("app error"); context.Response.End(); } } }
public void ProcessRequest(HttpContext context) { Logging logging = new Logging(); try { string GID = context.Request.Form["GID"]; string COSTTIME = context.Request.Form["COSTTIME"]; logging.Infolog(typeof(pushcosttime), $" GET GID={GID},Password={COSTTIME}"); dbwork.UpdateSet("Rcosttime`Lasttime", $"{COSTTIME}`{DateTime.Now.ToString()}", "RiddleGroup", $" GID={GID}"); yuanxiao.LoginMoudle status = new yuanxiao.LoginMoudle(); status.status = "OK"; context.Response.Write(JsonConvert.SerializeObject(status)); context.Response.End(); } catch (Exception ex) { if (ex.Message != "正在中止线程。" && ex.Message != "Thread was being aborted.") { logging.Errorlog(typeof(pushcosttime), ex.Message); context.Response.Write("app error"); context.Response.End(); } } }
public void ProcessRequest(HttpContext context) { Logging logging = new Logging(); try { string GID = context.Request.Form["GID"]; string USER = context.Request.Form["USER"]; logging.Infolog(typeof(chooseriddle), $" GET GID={GID},USER={USER}"); yuanxiao.LoginMoudle status = new yuanxiao.LoginMoudle(); string GotName = CommonClass.dbwork.SelectSingle("Pname", "RiddleGroup", $" GID={GID}"); if (GotName == "") { string PID = CommonClass.dbwork.SelectSingle("PID", "Persons", $" Pname='{USER}'"); if (PID == "") { status.status = "error"; } else { int updateRowsCount = CommonClass.dbwork.UpdateSet("PID`Pname`Rrecord`Rcosttime`Lasttime", $"{PID}`{USER}`~~~~`00:00`{DateTime.Now.ToString()}", "RiddleGroup", $"GID={GID}"); if (updateRowsCount > 0) { status.status = "ok"; } else { status.status = "error"; } } } else { status.status = GotName; } string reval = Newtonsoft.Json.JsonConvert.SerializeObject(status); context.Response.Write(reval); logging.Infolog(typeof(chooseriddle), $" RETURN {reval}"); context.Response.End(); } catch (Exception ex) { if (ex.Message != "正在中止线程。" && ex.Message != "Thread was being aborted.") { logging.Errorlog(typeof(chooseriddle), ex.Message); context.Response.Write("app error"); context.Response.End(); } } }
public void ProcessRequest(HttpContext context) { Logging logging = new Logging(); try { string GID = context.Request.Form["GID"]; string PNUM = context.Request.Form["PNUM"]; string ANSWER = context.Request.Form["ANSWER"]; logging.Infolog(typeof(checkanswer), $" GET GID={GID},PNUM={PNUM},ANSWER={ANSWER}"); string[] RiddleNums = dbwork.SelectSingle("Griddles", "RiddleGroup", $"GID={GID}").Split('~'); string RiddleNum = RiddleNums[Convert.ToInt16(PNUM) - 1]; string rightAnswerStr = dbwork.SelectSingle("Ranswer", "Riddle", $"Rpnum={RiddleNum}"); yuanxiao.LoginMoudle status = new yuanxiao.LoginMoudle(); if (result.isAnswerRight(rightAnswerStr, ANSWER)) { status.status = "1"; } else { status.status = "0"; } string restr = Newtonsoft.Json.JsonConvert.SerializeObject(status); context.Response.Write(restr); logging.Infolog(typeof(checkanswer), $" RETURN {restr}"); context.Response.End(); } catch (Exception ex) { if (ex.Message != "正在中止线程。" && ex.Message != "Thread was being aborted.") { logging.Errorlog(typeof(checkanswer), ex.Message); context.Response.Write("app error"); context.Response.End(); } } }