public PartialViewResult List(VehicleTypeCertificationAuditRequest query)
        {
            using (var client = new Tuhu.Service.Vehicle.VehicleClient())
            {
                var result = client.SelectVehicleAsync(query);
                result.ThrowIfException(true);
                ViewBag.Query = query;

                var logs = new VehicleTypeCertificationAuditLogManager().SelectLogs(result.Result.Select(_ => _.CarId).ToList());

                var logsDic = logs.ToDictionary(_ => _.CarId, _ => _);

                ViewBag.LogsDic = logsDic;
                return(PartialView(result.Result));
            }
        }
 public JsonResult SetStatus(Guid carId, int newStatus, int oldStatus, string description, string mobile, string carNo)
 {
     using (var client = new Tuhu.Service.Vehicle.VehicleClient())
     {
         var result = client.UpdateVehicleTypeCertificationStatus(new VehicleTypeCertificationRequest()
         {
             CarId  = carId,
             Status = newStatus
         });
         result.ThrowIfException(true);
         new VehicleTypeCertificationAuditLogManager().InsertLog(
             new DataAccess.Entity.VehicleTypeCertificationAuditLogModel()
         {
             Author      = HttpContext.User.Identity.Name,
             CarId       = carId,
             OldValue    = oldStatus.ToString(),
             NewValue    = newStatus.ToString(),
             Description = description
         });
     }
     //审核通过 发短信
     if (newStatus == 1)
     {
         using (var smsClient = new SmsClient())
         {
             smsClient.SendSms(mobile, 131, carNo);
         }
     }
     else if (newStatus == -1) //改为未认证 发短信
     {
         using (var smsClient = new SmsClient())
         {
             smsClient.SendSms(mobile, 130, carNo);
         }
     }
     return(Json(new
     {
         success = true
     }));
 }