예제 #1
0
 /// <summary>
 /// 处理已经发送过的wait_mt
 /// </summary>
 /// <param name="model"></param>
 public void CompleteMt(SmsBatchWaitInfo model, float sendPrice, int count)
 {
     mrg.UpdatePrice(model.EnterPriseID, sendPrice * count);
     mrg.UpdateSuccessCount(model.BatchID.Value, count);
     foreach (SendingBatchModel batchmodel in AppContent.SendingBatchs)
     {
         if (batchmodel.ID == model.BatchID)
         {
             try
             {
                 //sendingmodel = batchmodel;
                 batchmodel.SendCount++;
                 if (batchmodel.SendCount == batchmodel.MtCount)
                 {
                     Print("发送完成:" + batchmodel.ID + "");
                     //更新状态为完成
                     mrg.UpdateBatchState(BatchState.Complete, batchmodel.ID);
                     AppContent.SendingBatchs.Remove(batchmodel);
                 }
             }
             catch (Exception ex)
             {
                 Print(ex.Message);
             }
             break;
         }
     }
     mrg.RemoveToMt(model);
 }