public ActionResult UploadFile(HttpPostedFileBase imgfile) { try { AdminDetails admObj = (AdminDetails)Session["UserDetails"]; PatientAllDetails patientDETAILS = (PatientAllDetails)Session["patientDetails"]; HistoryFileDetails historyFileDetails = new HistoryFileDetails(); ModelState.Clear(); string impPath = ConfigurationManager.AppSettings["HistoryDoc"]; if (impPath != null) { if (imgfile != null) { string path; string extension = Path.GetExtension(imgfile.FileName); path = Path.Combine(Server.MapPath(impPath), Path.GetFileName(imgfile.FileName)); imgfile.SaveAs(path); } else { return(Json("Please upload file !")); } } else { return(Json("File Upload is not available folder !")); } historyFileDetails.QueueId = patientDETAILS.QueueId; historyFileDetails.FileName = imgfile.FileName; historyFileDetails.CasePaperNo = patientDETAILS.CasePapaerNo; historyFileDetails.HospitalId = patientDETAILS.HospitalId; historyFileDetails.PatientId = patientDETAILS.Id; historyFileDetails.CreatedBy = admObj.UserId; int Flag = BM.UploadFile(historyFileDetails); //return Json(Flag, JsonRequestBehavior.AllowGet); List <Common> lstObservation = new List <Common>(); //return Json(lstObservation, JsonRequestBehavior.AllowGet); return(Json("File Uploaded Successfully!")); } catch (Exception ex) { throw ex; } }
public int UploadFile(HistoryFileDetails historyFileDetails) { try { SqlParameter[] sqlparam; sqlparam = new SqlParameter[6]; sqlparam[0] = new SqlParameter("@QueueId", historyFileDetails.QueueId); sqlparam[1] = new SqlParameter("@FileName", historyFileDetails.FileName); sqlparam[2] = new SqlParameter("@CasePaperNo", historyFileDetails.CasePaperNo); sqlparam[3] = new SqlParameter("@HospitalId", historyFileDetails.HospitalId); sqlparam[4] = new SqlParameter("@PatientId", historyFileDetails.PatientId); sqlparam[5] = new SqlParameter("@CreatedBy", historyFileDetails.Id); return(CommonFunction.Save("USP_Set_HistoryFileDetails", sqlparam, "")); } catch (Exception) { throw; } }
public int UploadFile(HistoryFileDetails historyFileDetails) { return DM.UploadFile(historyFileDetails); }