Esempio n. 1
0
        static void Main(string[] args)
        {
            //Goi ham get CallHistoryInfo tat ca cac cuoc goi chua co link ghi am.
            int count = 1;

            while (true)
            {
                count = 1;
                List <CallHistoryInfo> items = CallHistoryRepository.GetAllCallInfoNotLinkRecords();

                foreach (CallHistoryInfo item in items)
                {
                    try
                    {
                        StoreData.Job_WsUpdateCallHistoryInfo(item.CallHistoryId);
                        var itemInfo = CallHistoryRepository.GetInfo(item.CallHistoryId);
                        Console.WriteLine(count + "/" + items.Count + " TIME: " + itemInfo.CreatedDate + " MESSAGE: " + itemInfo.ErrorDesc + " CALLID: " + itemInfo.CallId + " LINKRECORD: " + itemInfo.LinkRecord);
                        Console.WriteLine();
                        count++;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Log exception: " + ex.Message);
                        var itemInfo = CallHistoryRepository.GetInfo(item.CallHistoryId);
                        Console.WriteLine("EXCEPTION - MESSAGE: " + itemInfo.ErrorDesc + " CALLID: " + itemInfo.CallId + "TIME: " + itemInfo.CreatedDate);
                        Console.WriteLine();
                        count++;
                        TmpLogServiceInfo tmp = new TmpLogServiceInfo();
                        tmp.CallType    = (int)CallType.ExceptionLogGetLinkRecord;
                        tmp.Status      = 1;
                        tmp.Description = "";
                        tmp.Time        = DateTime.Now;
                        TmpLogServiceRepository.Create(tmp);
                    }
                }
            }
            Console.ReadLine();
        }
Esempio n. 2
0
 public CallHistoryInfo Get(int id)
 {
     return(CallHistoryRepository.GetInfo(id));
 }