private void GetMemberGrade(HttpContext context)
 {
     context.Response.ContentType = "application/json";
     try
     {
         new StringBuilder();
         IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades();
         List <SimpleGradeClass> list2        = new List <SimpleGradeClass>();
         if (memberGrades.Count > 0)
         {
             foreach (MemberGradeInfo info in memberGrades)
             {
                 SimpleGradeClass item = new SimpleGradeClass {
                     GradeId = info.GradeId,
                     Name    = info.Name
                 };
                 list2.Add(item);
             }
         }
         var type = new {
             type = "success",
             data = list2
         };
         string s = JsonConvert.SerializeObject(type);
         context.Response.Write(s);
     }
     catch (Exception exception)
     {
         context.Response.Write("{\"type\":\"error\",data:\"" + exception.Message + "\"}");
     }
 }
Example #2
0
 private void GetUserCustomGroupAndGrade(HttpContext context)
 {
     context.Response.ContentType = "application/json";
     try
     {
         new StringBuilder();
         IList <CustomGroupingInfo> customGroupingList = CustomGroupingHelper.GetCustomGroupingList();
         List <CustomGroup>         list2 = new List <CustomGroup>();
         if (customGroupingList.Count > 0)
         {
             foreach (CustomGroupingInfo info in customGroupingList)
             {
                 CustomGroup item = new CustomGroup
                 {
                     id   = info.Id,
                     Name = info.GroupName
                 };
                 list2.Add(item);
             }
         }
         new StringBuilder();
         IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades();
         List <SimpleGradeClass> list4        = new List <SimpleGradeClass>();
         if (memberGrades.Count > 0)
         {
             foreach (MemberGradeInfo info2 in memberGrades)
             {
                 SimpleGradeClass class2 = new SimpleGradeClass
                 {
                     GradeId = info2.GradeId,
                     Name    = info2.Name
                 };
                 list4.Add(class2);
             }
         }
         var type = new
         {
             type      = "success",
             data      = list2,
             gradedata = list4
         };
         string s = JsonConvert.SerializeObject(type);
         context.Response.Write(s);
     }
     catch (Exception exception)
     {
         context.Response.Write("{\"type\":\"error\",data:\"" + exception.Message + "\"}");
     }
 }
Example #3
0
 public void ProcessRequest(HttpContext context)
 {
     wid = context.Session[DTKeys.SESSION_WEB_ID] as string;
     if (string.IsNullOrEmpty(wid))
     {
         return;
     }
     context.Response.ContentType = "text/plain";
     try
     {
         new StringBuilder();
         IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades(this.wid);
         List <SimpleGradeClass> list2        = new List <SimpleGradeClass>();
         if (memberGrades.Count > 0)
         {
             foreach (MemberGradeInfo info in memberGrades)
             {
                 SimpleGradeClass item = new SimpleGradeClass {
                     GradeId = info.GradeId,
                     Name    = info.Name
                 };
                 list2.Add(item);
             }
         }
         var type = new {
             type = "success",
             data = list2
         };
         string s = JsonConvert.SerializeObject(type);
         context.Response.Write(s);
     }
     catch (Exception exception)
     {
         context.Response.Write("{\"type\":\"error\",data:\"" + exception.Message + "\"}");
     }
 }