public async Task<ActionResult> CalcelSelectedTicket(int rewardId, int ticketId)
 {
     using (var serviceEngine = new ServiceHelper())
     {
         await serviceEngine.Client.GetAsync<GetSelectedTicketRespond>(string.Format("/Winner/CancelSelectedTicket?rewardId={0}&ticketId={1}", rewardId, ticketId));
         return RedirectToAction("ManageTicket", new { id = rewardId });
     }
 }
 public async Task<ActionResult> SubmitSelectedWinner(int rewardId)
 {
     using (var serviceEngine = new ServiceHelper())
     {
         await serviceEngine.Client.GetAsync<GetSelectedTicketRespond>("/Winner/SubmitSelectedWinner?rewardId="+ rewardId);
         return RedirectToAction("ManageTicket", new { id = rewardId });
     }
 }
 public async Task<ActionResult> RewardList(int id)
 {
     using (var serviceEngine = new ServiceHelper())
     {
         var response = await serviceEngine.Client.GetAsync<RewardGroupInformation>("/Reward/GetRewardGroupById?id=" + id);
         return View("RewardList", response);
     }
 }
 // GET: Winner
 public async Task<ActionResult> Index(int id)
 {
     using (var serviceEngine = new ServiceHelper())
     {
         var response = await serviceEngine.Client.GetAsync<GetSelectedTicketRespond>("/Winner/GetSelectedTicket?rewardId=" + id);
         return View(response);
     }
 }
 public async Task<ActionResult> Create(RewardGroupInformation model)
 {
     using (var serviceEngine = new ServiceHelper())
     {
         await serviceEngine.Client.PostAsync<RewardGroupInformation>("/Reward/CreateRewardGroup", model);
         return RedirectToAction("Index");
     }
 }
 // GET: RewardManagement
 public async Task<ActionResult> Index()
 {            
     using (var serviceEngine = new ServiceHelper())
     {
         var response = await serviceEngine.Client.GetAsync<IEnumerable<RewardGroupInformation>>("/Reward/GetRewardGroup");
         return View(response);
     }
 }
        public async Task<ActionResult> CreateReward(int id, RewardInformation model, HttpPostedFileBase ThumbnailPath, HttpPostedFileBase ImagePath)
        {
            using (var serviceEngine = new ServiceHelper())
            {
                var uploader = new UploadImageHelper();
                const char TypeSpliter = '/';
                var thumbnailFileName = string.Format("{0}.{1}", Guid.NewGuid(), ThumbnailPath.ContentType.Split(TypeSpliter).Last());
                var imageFileName = string.Format("{0}.{1}", Guid.NewGuid(), ThumbnailPath.ContentType.Split(TypeSpliter).Last());

                model.ThumbnailPath = await uploader.UploadImage(thumbnailFileName, ThumbnailPath.InputStream, "thumbnails");
                model.ImagePath = await uploader.UploadImage(imageFileName, ImagePath.InputStream, "images");
                model.RewardGroupId = id;

                await serviceEngine.Client.PostAsync<RewardInformation>("/Reward/CreateReward", model);
                return RedirectToAction("Details", new { id = id });
            }
        }