public ActionResult Create(string requestCategory, string Comment, string convertedFile, string convertedFile1, string convertedFile2) { string UploadStatus = ""; string UploadStatus1 = ""; string UploadStatus2 = ""; //convertedFile = ""; //convertedFile1 = ""; //convertedFile2 = ""; string ipaddress = Request.UserHostAddress; string Agent = Request.UserAgent; string BrowserUsed = Request.Browser.Browser; string SessionID = HttpContext.Session.SessionID; string userkey = ConfigurationManager.AppSettings["userkey"]; string uid = ConfigurationManager.AppSettings["uid"]; string LoginUser = (string)Session["LoginSAPID"]; string EmployerId = (string)Session["EMPLOYER_ID"]; string WebUserID = (string)Session["WebUserID"]; string RoleID = (string)Session["ROLE_ID"]; try { Employer.Employer employer = new Employer.Employer(); var requestStatus = employer.CreateRequest(WebUserID, RoleID, requestCategory, "Initiated", Comment, userkey, uid); var requestDetails = requestStatus.Split('~'); if (requestDetails[0] != "01") { var file = Request.Files; if (file[0].ContentLength > 0) { string _FileName = file[0].FileName; string Docext = Path.GetExtension(file[0].FileName); string Doc = convertedFile; UploadStatus = employer.LogRequestDoc(requestDetails[1], "", Doc, Docext, _FileName, "Y", userkey, uid); var uploadDetails = UploadStatus.Split('~'); } if (file[1].ContentLength > 0) { string _FileName1 = file[1].FileName; string Docext1 = Path.GetExtension(file[1].FileName); string Doc1 = convertedFile1; UploadStatus1 = employer.LogRequestDoc(requestDetails[1], "", Doc1, Docext1, _FileName1, "Y", userkey, uid); //var uploadDetails1 = UploadStatus1.Split('~'); } if (file[2].ContentLength > 0) { string _FileName2 = file[2].FileName; string Docext2 = Path.GetExtension(file[2].FileName); string Doc2 = convertedFile2; UploadStatus2 = employer.LogRequestDoc(requestDetails[1], "", Doc2, Docext2, _FileName2, "Y", userkey, uid); //uploadDetails2 = UploadStatus2.Split('~'); } if (UploadStatus == "00~Your documents have been logged successfully" || UploadStatus1 == "00~Your documents have been logged successfully" || UploadStatus2 == "00~Your documents have been logged successfully") { employer.NotifyIncident(requestDetails[1], userkey, uid); string status = "00~Your documents have been logged successfully"; var statusDetails = status.Split('~'); TempData["msg"] = "Your request and " + statusDetails[1]; //employer return(RedirectToAction("Index")); } else { } TempData["msg"] = requestDetails[2]; return(RedirectToAction("Index")); } else { TempData["error"] = requestDetails[2]; return(RedirectToAction("Index")); } } catch (Exception ex) { LogError logerror = new LogError(); logerror.ErrorLog("", LoginUser, "", "Requests/Create", "Requests", "Create", "CreateRequest Error", ex.InnerException.Message.ToString(), 0); TempData["error"] = "An error processing complaints"; return(View()); } }