/// <summary>
        ///按subjectStr寻找最近一次complete或incomplete的case,并且做这一票的Emp要在职,在线
        /// </summary>
        /// <param name="subjectStr"></param>
        /// <returns></returns>
        private int?FindRecordByRequest(Record record, string subjectStr)
        {
            try
            {
                OleDbConnection con = null;
                if (record.M_requestID.Length > 0)
                {
                    con = recordDao.BeginKeyword();
                }
                else
                {
                    con = recordDao.Begin();
                }

                int?asignId = recordDao.FindRecordByRequestIDDAO(con, subjectStr);
                recordDao.Commit();
                return(asignId);
            }
            catch (Exception)
            {
                recordDao.RollBack();
                throw;
            }
            finally
            {
                recordDao.Close();
            }
        }
        public void TestFindRecordByRequestIDDAO()
        {
            RecordDAO       recordDao = new RecordDAO();
            OleDbConnection con       = recordDao.Begin();
            int?            id        = recordDao.FindRecordByRequestIDDAO(con, "Consol - C1900007772");

            recordDao.Commit();
            recordDao.Close();
        }
        public void TestFindRecordsToAllocateDAO()
        {
            RecordDAO       recordDao = new RecordDAO();
            OleDbConnection con       = recordDao.Begin();
            List <Record>   records   = recordDao.FindRecordsToAllocateDAO(con);

            recordDao.Commit();
            recordDao.Close();
        }
 /// <summary>
 ///按subjectStr寻找最近一次complete或incomplete的case,并且做这一票的Emp要在职,在线
 /// </summary>
 /// <param name="subjectStr"></param>
 /// <returns></returns>
 private int?FindRecordByRequest(string subjectStr)
 {
     try
     {
         OleDbConnection con     = recordDao.Begin();
         int?            asignId = recordDao.FindRecordByRequestIDDAO(con, subjectStr);
         recordDao.Commit();
         return(asignId);
     }
     catch (Exception)
     {
         recordDao.RollBack();
         throw;
     }
     finally
     {
         recordDao.Close();
     }
 }
        /// <summary>
        /// 寻找所有的Completed和Incompleted的case
        /// </summary>
        /// <returns></returns>
        private List <Record> FindSourceCompletedAndIncompletedRecords()
        {
            List <Record> records = null;

            try
            {
                OleDbConnection con = recordDao.Begin();
                records = recordDao.FindRecordsCompletedAndIncompleted(con);
                recordDao.Commit();
                return(records);
            }
            catch (Exception)
            {
                recordDao.RollBack();
                throw;
            }
            finally
            {
                recordDao.Close();
            }
        }
        public void TestAddRecordItemDAO()
        {
            Record record = new Record();

            record.UserName = "******";
            RecordDAO       recordDao = new RecordDAO();
            OleDbConnection con       = recordDao.Begin();

            recordDao.AddRecordItemDAO(con, record);

            recordDao.Commit();
            recordDao.Close();
        }
Esempio n. 7
0
        private static long mailNum = 0;//用于标记邮件个数,存储邮件时作为唯一标识

        public void RemoveDuplicate()
        {
            List <Record> records = null;

            try
            {
                OleDbConnection con = recordDao.Begin();
                records = recordDao.FindAllRecords(con);


                HashSet <string> hs = new HashSet <string>();
                foreach (Record record in records)
                {
                    string myKey = record.M_subject.Trim() + "_" + record.M_mailincometime.ToString();
                    if (hs.Contains(myKey))
                    {
                        recordDao.DeleteRecordsByID(con, record.M_id);
                    }
                    else
                    {
                        hs.Add(myKey);
                    }
                }

                recordDao.Commit();
            }
            catch (Exception)
            {
                recordDao.RollBack();
                throw;
            }
            finally
            {
                recordDao.Close();
            }
        }