public static AnnalAction TeachAnnalAction(AnnalParams param) { AnnalAction r = new AnnalAction(); try { if (string.IsNullOrEmpty(param.schoolId)) { param.schoolId = C.SCHOOLID; param.schoolPas = C.SCHOOLPAS; } string url = C.SCHOOLURL + "/servlet/TeachEscapeAnnalAction"; string data = "schoolId={0}&schoolPas={1}&certId={2}&orderId={3}"; data = data + "&credits={4}&classHour={5}&startTeachDate={6}&endTeachDate={7}&isPass={8}"; data = string.Format(data, param.schoolId, param.schoolPas, param.certId, param.orderId ,param.credits ,param.classHour ,param.startTeachDate ,param.endTeachDate ,param.isPass); string s = http.Send(data, url); JavaScriptSerializer jss = new JavaScriptSerializer(); r = jss.Deserialize<AnnalAction>(s); } catch (Exception ex) { log.Warn(ex.Message); } return r; }
public static R CommitReport(Member m, Report re) { var r = new R(); try { if (re.Status == 0) { var para = new AnnalParams(); para.certId = m.IDCard; para.orderId = m.IDSN; para.credits = ""; para.classHour = "24"; para.startTeachDate = m.RegDate.ToString("yyyy-MM-dd"); para.endTeachDate = DateTime.Now.ToString("yyyy-MM-dd"); para.isPass = "******"; if (m.Year >= 2012) { if (re.Score >= 60 && (re.Elective + re.Compulsory) * 45 >= 1080) { para.isPass = "******"; } } else { if ((re.Elective + re.Compulsory) * 45 >= 1080) { para.isPass = "******"; } } //已完成学习 if (para.isPass == "Pass") { var ps = Teach.TeachAnnalAction(para); if (ps.annalValue == "annal000" || ps.annalValue == "annal003") { re.Status = 1; DAL.Update.Report(re); r.Value = 1; r.Message = "success"; r.Code = 0; } else { log.Warn("{0},{1},{2}", ps.annalValue, ps.personName, ps.yearValue); } } } } catch (Exception ex) { log.Fatal("{0},{1}", ex.Message, ex.StackTrace); } return r; }