public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; string json = string.Empty; string subidstr = context.Request.Form["Subid"]; int subid = int.Parse(subidstr); string yearstr = context.Request.Form["Year"]; int year = int.Parse(yearstr); string stdid = context.Request.Form["Addstdid"]; string[] ArrayID = stdid.Split(','); for (int i = 0; i < ArrayID.Count(); ++i) { if (!ArrayID[i].Equals("gvPerUnSel_CBAll")) { if (!ArrayID[i].Equals("")) { CY.GFive.Core.Business.SubsidyRecordForStudent subforstd = new CY.GFive.Core.Business.SubsidyRecordForStudent(); subforstd.SubsidyID = subid; subforstd.Receiver = ArrayID[i]; subforstd.Year = year; subforstd.Save(); } } } json = "{success:true}"; context.Response.Write(json); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/json"; string json = string.Empty; string f1name = context.Request.Form["F1name"]; string f2name = context.Request.Form["F2name"]; string f3name = context.Request.Form["F3name"]; string f4name = context.Request.Form["F4name"]; string Stdcode = context.Request.Form["Stdcode"]; string yearstr = context.Request.Form["Year"]; int year = 0; string subidstr = context.Request.Form["Subid"]; int subid = 0; string helpreason = context.Request.Form["Helpreason"]; string classview = context.Request.Form["Classview"]; string schoolview = context.Request.Form["Schoolview"]; if (int.TryParse(subidstr,out subid) && int.TryParse(yearstr,out year) && Stdcode != null && Stdcode != "") { CY.GFive.Core.Business.SubsidyRecordForStudent subforstd = new CY.GFive.Core.Business.SubsidyRecordForStudent(); subforstd.SubsidyID = subid; subforstd.Year = year; subforstd.Receiver = Stdcode; subforstd.HelpReason = helpreason; subforstd.ClassView = classview; subforstd.SchoolView = schoolview; subforstd.Save(); if (f1name != null && f1name != "") { CY.GFive.Core.Business.Families familie = new CY.GFive.Core.Business.Families(); familie.Name = f1name; familie.Relations = context.Request.Form["F1relation"]; familie.Job = context.Request.Form["F1job"]; int age = 0; int.TryParse(context.Request.Form["F1age"],out age); familie.Age = age; familie.StdCode = Stdcode; familie.Save(); } if (f2name != null && f2name != "") { CY.GFive.Core.Business.Families familie2 = new CY.GFive.Core.Business.Families(); familie2.Name = f2name; familie2.Relations = context.Request.Form["F2relation"]; familie2.Job = context.Request.Form["F2job"]; int age = 0; int.TryParse(context.Request.Form["F2age"], out age); familie2.Age = age; familie2.StdCode = Stdcode; familie2.Save(); } if (f3name != null && f3name != "") { CY.GFive.Core.Business.Families familie3 = new CY.GFive.Core.Business.Families(); familie3.Name = f3name; familie3.Relations = context.Request.Form["F3relation"]; familie3.Job = context.Request.Form["F3job"]; int age = 0; int.TryParse(context.Request.Form["F3age"], out age); familie3.Age = age; familie3.StdCode = Stdcode; familie3.Save(); } if (f4name != null && f4name != "") { CY.GFive.Core.Business.Families familie4 = new CY.GFive.Core.Business.Families(); familie4.Name = f4name; familie4.Relations = context.Request.Form["F4relation"]; familie4.Job = context.Request.Form["F4job"]; int age = 0; int.TryParse(context.Request.Form["F4age"], out age); familie4.Age = age; familie4.StdCode = Stdcode; familie4.Save(); } json = "{success:true}"; context.Response.Write(json); } }