Beispiel #1
0
        public ActionResult Picks(HttpPostedFileBase file)
        {
            if (file.ContentLength > 0)
            {
                var fileName = Path.GetFileName(file.FileName);
                var path     = Path.Combine(Server.MapPath("~/Content/datafiles"), fileName);
                file.SaveAs(path);

                if (fileName.Contains(".xls"))
                {
                    PickSync.UpdatePicksXls(fileName);
                }
                else if (fileName.Contains(".csv"))
                {
                    PickSync.UpdatePicksCsv(fileName);
                }
                else
                {
                    PickSync.UpdatePicks(fileName);
                }

                ViewBag.Message = "Picks updated.";
            }

            return(View("Index"));
            //return RedirectToAction("Index");
        }
Beispiel #2
0
        public ActionResult Picks(string h = "")
        {
            if (!string.IsNullOrEmpty(h))
            {
                if (h.Contains(".xls"))
                {
                    PickSync.UpdatePicksXls(h);
                }
                else
                {
                    PickSync.UpdatePicks(h);
                }

                ViewBag.Message = "Picks updated.";

                return(View("Index"));
            }

            return(View());
        }