Esempio 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" || prove.proveValue == "prove003")
            {
                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;
                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;
        }
Esempio n. 2
0
        public static void Run()
        {
            var SList = Get.MSubmitList();
            foreach (var S in SList)
            {
                Thread.Sleep(512);
                try
                {
                    var m = new Member();
                    var r = new Report();

                    m.IDCard = S.IDCard;
                    m.IDSN = S.IDSN;
                    m.Year = S.Year;
                    m.RegDate = S.RegDate;
                    m.MID = S.MID;

                    r.MID = S.MID;
                    r.Compulsory = S.Compulsory;
                    r.Elective = S.Elective;
                    r.Status = S.Status;
                    r.Score = S.Score;
                    r.Minutes = S.Minutes;

                    CommitReport(m, r);

                }
                catch (Exception ex)
                {
                    log.Fatal("{0},{1}", ex.Message, ex.StackTrace);
                }

            }
        }
Esempio n. 3
0
 public static R Member(Member member)
 {
     var m = new R();
     try
     {
         SqlParameter[] param =
         {
             new SqlParameter("@MID",member.MID),
             new SqlParameter("@Name",member.Name),
             new SqlParameter("@IDCard",member.IDCard),
             new SqlParameter("@IDSN",member.IDSN),
             new SqlParameter("@Year",member.Year),
             new SqlParameter("@Type",member.Type),
             new SqlParameter("@Level",member.Level)
         };
         param[0].Direction = ParameterDirection.InputOutput;
         var r = SqlHelper.ExecuteNonQuery(SqlHelper.Local, CommandType.StoredProcedure, "S_Update_Member", param);
         m.Code = 0;
         m.Value = Convert.ToInt32(param[0].Value);
         m.Message = "sucess";
     }
     catch (Exception ex)
     {
         m.Code = 300;
         m.Message = ex.Message;
         log.Fatal(ex.Message);
         log.FatalException(ex.Message, ex);
     }
     return m;
 }
Esempio n. 4
0
        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.Minutes >= 1080)
                        {
                            para.isPass = "******";
                        }
                    }
                    else
                    {
                        if (re.Minutes >= 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;
        }