Exemple #1
0
 // 插入MtLog
 public void Insert(StudentLog log)
 {
     if (log.skr_id != 0)
     {
         if (log.keyword_history.Trim() != SearchCondition.KeyWordDefault)
         {
             IDatabase db = DataManager.CampusDB();
             if (Exist(log.skr_id) == true)
             {
                 Update(log);
             }
             else
             {
                 string strSQL = "INSERT INTO campuschannel_student_log (skr_id, viewed_job, keyword_history)"
                                 + " VALUES({0}, '{1}', '{2}')";
                 strSQL = string.Format(strSQL, log.skr_id, log.viewed_job, log.keyword_history);
                 db.Execute(strSQL);
             }
         }
     }
 }
Exemple #2
0
        // ����MtLog
        public void Insert(StudentLog log)
        {
            if (log.skr_id!=0)
            {
                if (log.keyword_history.Trim()!=SearchCondition.KeyWordDefault)
                {

                IDatabase db = DataManager.CampusDB();
                if (Exist(log.skr_id) == true)
                {
                    Update(log);
                }
                else
                {
                    string strSQL = "INSERT INTO campuschannel_student_log (skr_id, viewed_job, keyword_history)"
                        + " VALUES({0}, '{1}', '{2}')";
                    strSQL = string.Format(strSQL, log.skr_id, log.viewed_job, log.keyword_history);
                    db.Execute(strSQL);
                }
               }
            }
        }
Exemple #3
0
        public void Update(StudentLog log)
        {
            IDatabase db = DataManager.CampusDB();

            string strSQL   = "UPDATE campuschannel_student_log SET";
            string strField = "";

            if (log.viewed_job != "" && log.viewed_job != null)
            {
                strField += " viewed_job=substring( '{1},'+view_job,1,1024)";
            }
            if (log.keyword_history != "" && log.keyword_history != null)
            {
                strField += " keyword_history=substring('{2},'+keyword_history,1,1024)";
            }
            if (strField.Trim() != "")
            {
                strSQL += strField;
                strSQL += " WHERE skr_id={0}";
                strSQL  = string.Format(strSQL, log.skr_id, log.viewed_job, log.keyword_history);
                db.Execute(strSQL);
            }
        }
Exemple #4
0
        public void Update(StudentLog log)
        {
            IDatabase db = DataManager.CampusDB();

            string strSQL = "UPDATE campuschannel_student_log SET";
            string strField = "";
            if (log.viewed_job != "" && log.viewed_job != null)
            {
                strField += " viewed_job=substring( '{1},'+view_job,1,1024)";
            }
            if (log.keyword_history != "" && log.keyword_history != null)
            {
                strField += " keyword_history=substring('{2},'+keyword_history,1,1024)";
            }
            if (strField.Trim()!="")
            {

                strSQL += strField;
            strSQL += " WHERE skr_id={0}";
            strSQL = string.Format(strSQL, log.skr_id, log.viewed_job, log.keyword_history);
            db.Execute(strSQL);
               }
        }