private ActionResult PublishCar(TransferViewCar car, List <HttpPostedFileBase> facefile, List <HttpPostedFileBase> otherfile, List <HttpPostedFileBase> badfile) { if (BuildCar(car, facefile, otherfile, badfile)) { CarTransferInfo transfercar = MapperCar(car); transferService.SaveTransferCar(transfercar); RunJob(); FxCacheService.FxSite.GlobalCache cache = System.Web.Mvc.DependencyResolver.Current.GetService <FxCacheService.FxSite.GlobalCache>(); cache.InfoPublishAllCountAdd(); return(View("Success")); } return(View("FaildTransfer")); }
private CarTransferInfo MapperCar(TransferViewCar car) { var info = new CarTransferInfo(); info.CarMileage = car.CarMileage; info.CarYear = car.CarYear; info.CatagroyId = car.CatagroyId; info.AreaId = car.AreaId; info.Controller = this.ControllerName; info.Action = this.ActionName; info.CityId = car.CityId; info.Mark = car.Mark; car.FaceFiles.ForEach(r => info.Pictures.Add(r)); car.OtherFiles.ForEach(r => info.Pictures.Add(r)); car.BadFiles.ForEach(r => info.Pictures.Add(r)); info.Price = (int)car.Price; info.PublishTitle = car.Title; info.PublishUserEmail = car.Email; info.UserAccount = User.Identity.Name; return(info); }