sync2.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Reflection;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. namespace SiteCore.Handler
  6. {
  7. public partial class sync2 : BaseHandler, IHttpHandler, IRequiresSessionState
  8. {
  9. public void ProcessRequest(HttpContext context)
  10. {
  11. //if (CurrentUser == null)
  12. //{
  13. // ReturnLoginMsg("操作己过期,请重新登录!");
  14. // return;
  15. //}
  16. con = context;
  17. String methodName = GetString("t");
  18. Type type = this.GetType();
  19. MethodInfo method = type.GetMethod(methodName);
  20. if (method == null) throw new Exception("method is null");
  21. if (methodName.IndexOf("get_") == -1)
  22. {
  23. //using (new SessionScope())
  24. //{
  25. try
  26. {
  27. method.Invoke(this, null);
  28. //if (operate_Tag != "") WebLog.SysLog(CurrentUser.UserID,operate_Tag);
  29. //else WebLog.SysLog(CurrentUser.UserID, methodName);
  30. }
  31. catch (Exception ex)
  32. {
  33. //WebLog.SysLog(CurrentUser.UserID, ex);
  34. returnErrorMsg("操作失败!" + ex.Message);
  35. }
  36. //}
  37. }
  38. else
  39. {
  40. try
  41. {
  42. method.Invoke(this, null);
  43. }
  44. catch (Exception ex)
  45. {
  46. //XLog.SaveLog(CurrentUser.UserID, ex.Message);
  47. returnErrorMsg("操作失败!" + ex.Message);
  48. }
  49. }
  50. }
  51. }
  52. }