Esempio n. 1
0
 public ActionResult UploadPriority(List <UploadSummaryReport> uploadSummaryReport, HttpPostedFileBase file)
 {
     Session.Remove("uploadReport");
     uploadSummaryReport = null;
     ViewBag.Message     = null;
     ViewBag.Summary     = null;
     if (file != null && file.ContentLength > 0)
     {
         if (file.FileName.EndsWith(".csv"))
         {
             string message = "";
             string summary = "";
             bool   bUpload = EmployeeDetails.UploadPriorityFile(file, Session["empid"].ToString(), ref message, ref summary, ref uploadSummaryReport);
             ViewBag.Summary = summary;
             if (bUpload)
             {
                 ViewBag.Message         = "Uploaded Successfully!";
                 Session["uploadReport"] = uploadSummaryReport;
             }
             else
             {
                 ViewBag.Message = message;
             }
             return(View(uploadSummaryReport));
         }
         else
         {
             ViewBag.Message = "This file format is not supported.";
             return(View(uploadSummaryReport));
         }
     }
     else
     {
         ViewBag.Message = "Please select the file to upload.";
     }
     return(View(uploadSummaryReport));
 }