Ejemplo n.º 1
0
        public static R CheckAPI(string loginID, string loginPWD)
        {
            R r = new R();
            var param = new ProveParams();
            param.certId = loginPWD;
            param.orderId = loginID;
            var prove = Teach.TeachProveAction(param);
            if (prove.proveValue == "prove000")
            {
                var member = new Member();
                member.MID = 0;
                member.Name = prove.personName;
                member.Year = Convert.ToInt32(prove.yearValue);
                member.IDCard = loginPWD;
                member.IDSN = loginID;
                member.Level = -1;
                member.Type = -1;
                member.Phone = prove.telValue;
                r = Update.Member(member);
            }
            else
            {
                r.Code = 202;
                r.Message = string.Format("{0}",prove.proveValue);
                r.Value = -1;
                log.Warn("{0},{1},{2}", loginID, loginPWD, prove.proveValue);
            }

            return r;
        }
Ejemplo n.º 2
0
 public static ProveAction TeachProveAction(ProveParams param)
 {
     ProveAction r = new ProveAction();
     try
     {
         if (string.IsNullOrEmpty(param.schoolId))
         {
             param.schoolId = C.SCHOOLID;
             param.schoolPas = C.SCHOOLPAS;
         }
         string url = C.SCHOOLURL + "/servlet/TeachEscapeProveAction";
         string data = "schoolId={0}&schoolPas={1}&certId={2}&orderId={3}";
         data = string.Format(data, param.schoolId, param.schoolPas, param.certId, param.orderId);
         string s = http.Send(data, url);
         JavaScriptSerializer jss = new JavaScriptSerializer();
         r = jss.Deserialize<ProveAction>(s);
     }
     catch (Exception ex)
     {
         log.Warn(ex.Message);
     }
     return r;
 }
Ejemplo n.º 3
0
 public static AdminServelt TeachAdminAnnalServelt(ProveParams param)
 {
     AdminServelt r = new AdminServelt();
     try
     {
         if (string.IsNullOrEmpty(param.schoolId))
         {
             param.schoolId = C.SCHOOLID;
             param.schoolPas = C.SCHOOLPAS;
         }
         string url = C.SCHOOLURL + "/servlet/CompTeachAdminAnnalServelt";
         string data = "schoolId={0}&schoolPas={1}&certId={2}&orderId={3}";
         data = string.Format(data, param.schoolId, param.schoolPas, param.certId, param.orderId);
         string s = http.Send(data, url);
         JavaScriptSerializer jss = new JavaScriptSerializer();
         r = jss.Deserialize<AdminServelt>(s);
     }
     catch (Exception ex)
     {
         log.Warn(ex.Message);
     }
     return r;
 }