private string GetFamilyMember() { context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); IQueryable <FamilyMember> members = null; string id; if (context.Request.Params["aplID"] != null) { id = context.Request.Params["aplID"]; ViewPosApl exs = dc.ViewPosApl.SingleOrDefault(es => es.F_ID.Equals(id)); if (null != exs) { members = dc.FamilyMember.Where(pp => pp.F_userID.Equals(exs.F_UserID)); } } else { id = context.Session[SessionMgm.UserID].ToString(); members = dc.FamilyMember.Where(pp => pp.F_userID.Equals(id)); } List <FamilyMember> pps = new List <FamilyMember>(); foreach (var member in members) { pps.Add(member); } return(UtilHelper.GetJSON(pps)); }
private string Initial() { context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String F_ID = context.Session[SessionMgm.VisitUnitID].ToString(); ApplicantUnit unit = dc.ApplicantUnit.SingleOrDefault(au => au.F_ID.Equals(F_ID)); if (context.Session[SessionMgm.Role].Equals(RoleType.EduAdmin)) { unit.F_status = "未提交"; } else if (context.Session[SessionMgm.Role].ToString().Equals(RoleType.SchoolAdmin) && context.Session[SessionMgm.UnitID].ToString().Equals(context.Session[SessionMgm.VisitUnitID])) { unit.F_status = "未提交"; } else { unit.F_status = "已提交"; } if (unit == null) { unit = new ApplicantUnit(); unit.F_ID = F_ID; unit.F_status = "未提交"; } return(UtilHelper.GetJSON(unit)); }
private string GetData() { context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String F_projectID = context.Session[SessionMgm.ProjectID].ToString(); String guideID = null, result = ""; if ("sci".Equals(paras["type"])) { ScienceProject sp = dc.ScienceProject.SingleOrDefault(_sp => _sp.F_ID.Equals(F_projectID)); if (sp != null) { guideID = sp.F_guideProjectID; } } else if ("social".Equals(paras["type"])) { EducationV2.SocialProject sp = dc.SocialProject.SingleOrDefault(_sp => _sp.F_ID.Equals(F_projectID)); if (sp != null) { guideID = sp.F_guideProjectID; } } if (String.IsNullOrEmpty(guideID) == false) { ProjectDetail pd = dc.ProjectDetail.SingleOrDefault(_pd => _pd.F_ID.Equals(guideID)); result = UtilHelper.GetJSON(pd); } return(result); }
private string GetBaseInfo() { String result; context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String projectID = context.Session[SessionMgm.AcceptProjectID].ToString(); AcceptApplicant exs = dc.AcceptApplicant.SingleOrDefault(es => es.F_projectID.Equals(projectID)); result = UtilHelper.GetJSON(exs); return(result); }
private string GetMembers() { context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); var members = dc.ApplicantMember.Where(m => m.F_applicantID.Equals(F_ID)).OrderBy(m => m.F_seq); List <ApplicantMember> ams = new List <ApplicantMember>(); foreach (ApplicantMember am in members) { ams.Add(am); } return(UtilHelper.GetJSON(ams)); }
private string GetMembers() { context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String F_ID = context.Session["applicationID"].ToString(); var members = dc.ApplicantMember.Where(m => m.F_applicantID.Equals(F_ID)); List <User> users = new List <User>(); foreach (var member in members) { User user = dc.User.Single(u => u.F_ID.Equals(member.F_userID)); users.Add(user); } return(UtilHelper.GetJSON(users)); }
private string InitialPage() { context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String F_ID = context.Session[SessionMgm.AttachmentProjectID].ToString(); int pageNum = int.Parse(paras["pageNum"]); int[] numList = new int[typeNum]; for (int i = 0; i < typeNum; i++) { numList[i] = dc.Attachment.Count(p => p.F_attachmenttype == i && p.F_projectID.Equals(F_ID)); } String result = UtilHelper.GetJSON(numList); return(result); }
private string InitialPage() { context.Response.ContentType = "application/json"; String F_ID = context.Session[SessionMgm.SciProjectID].ToString(); int pageNum = int.Parse(paras["pageNum"]); DataClassesDataContext dc = new DataClassesDataContext(); ScienceProject sciProject = dc.ScienceProject.SingleOrDefault(c => c.F_ID.Equals(F_ID)); if (sciProject == null) { sciProject = new ScienceProject(); User user = dc.User.SingleOrDefault(_user => _user.F_ID.Equals(context.Session[SessionMgm.UserID])); sciProject.F_leader = context.Session[SessionMgm.RealName].ToString(); sciProject.F_leaderID = context.Session[SessionMgm.UserID].ToString(); sciProject.F_dept = user.F_workDept; sciProject.F_email = user.F_email; sciProject.F_phone = user.F_phone; sciProject.F_applicantDate = DateTime.Now; } if (pageNum != 4) { sciProject.F_scientificBasis = ""; } if (pageNum != 5) { sciProject.F_content = ""; sciProject.F_finalOutput = ""; } if (pageNum != 6) { sciProject.F_approach = ""; sciProject.F_assignment = ""; } if (pageNum != 7) { sciProject.F_condition = ""; } if (pageNum == 3) { } return(UtilHelper.GetJSON(sciProject)); }
private String FillPatents() { String result = ""; context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String projectID = context.Session[SessionMgm.AcceptProjectID].ToString(); var _patents = dc.Patent.Where(pt => pt.F_projectID.Equals(projectID)); List <Patent> patents = new List <Patent>(); foreach (var patent in _patents) { patents.Add(patent); } result = UtilHelper.GetJSON(patents); return(result); }
private string FillStands() { String result = ""; context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String projectID = context.Session[SessionMgm.AcceptProjectID].ToString(); var _stands = dc.Standard.Where(_st => _st.F_projectID.Equals(projectID)); List <Standard> stands = new List <Standard>(); foreach (var patent in _stands) { stands.Add(patent); } result = UtilHelper.GetJSON(stands); return(result); }
private string FillPapers() { String result = ""; context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); String projectID = context.Session["projectID"].ToString(); var _stands = dc.PublishedPaper.Where(_st => _st.F_projectID.Equals(projectID)); List <PublishedPaper> stands = new List <PublishedPaper>(); foreach (var patent in _stands) { stands.Add(patent); } result = UtilHelper.GetJSON(stands); return(result); }
private string GetPagingData() { String result = ""; returnPersons persons = new returnPersons(); persons.results = 10; persons.rows = new List <person>(); for (int i = 0; i < 3; i++) { person p = new person(); p.age = i * 10; p.id = "00" + i.ToString(); p.name = "name" + i.ToString(); persons.rows.Add(p); } return(UtilHelper.GetJSON(persons)); }
private String savePage2() { context.Response.ContentType = "text/plain"; DataClassesDataContext dc = new DataClassesDataContext(); PosApplicant apl = null; if (saveApplicantPartInfo(out apl, dc)) { apl.F_pos1 = paras["F_pos1"]; apl.F_pos2 = paras["F_pos2"]; apl.F_pos3 = paras["F_pos3"]; apl.F_posID1 = paras["F_posID1"]; apl.F_posID2 = paras["F_posID2"]; apl.F_posID3 = paras["F_posID3"]; apl.F_reason = paras["F_reason"]; } dc.SubmitChanges(); // return "保存成功"; return(UtilHelper.GetJSON(apl));// 为了把业务id返回给页面已支持用户切换tab页面的刷新 }
private string GetBaseInfo() { String result = ""; context.Response.ContentType = "application/json"; DataClassesDataContext dc = new DataClassesDataContext(); string id; if (context.Request.Params["aplID"] != null) { id = context.Request.Params["aplID"]; ViewPosApl exs = dc.ViewPosApl.SingleOrDefault(es => es.F_ID.Equals(id)); result = UtilHelper.GetJSON(exs); } else { id = context.Session[SessionMgm.UserID].ToString(); // 当前登录用户即该业务的申请者 User usr = dc.User.SingleOrDefault(es => es.F_ID.Equals(id)); result = UtilHelper.GetJSON(usr); result = result.Replace("F_ID", "F_UserID"); } return(result); }