protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["UploadReport_VisitType"] = Request.QueryString["Type"].ToString(); Session["UploadReport_DoctorId"] = Request.QueryString["Doc"].ToString(); string Pid = ""; if (Request.QueryString["PGID"].ToString() == null || Request.QueryString["PGID"].ToString() == "") { Pid = " "; } else { Pid = Request.QueryString["PGID"].ToString(); } Bill_Sys_Upload_VisitReport GetSpecialty = new Bill_Sys_Upload_VisitReport(); string ProcedureGroupId = ""; if ((Pid.Substring(0, 1) == "&") || (Pid.Substring(0, 1) == "n")) { ProcedureGroupId = GetSpecialty.GetDoctorSpecialty(Session["UploadReport_DoctorId"].ToString(), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); } else { ProcedureGroupId = Pid; } Session["UploadReport_ProcedureGroupId"] = ProcedureGroupId; Session["UploadReport_EventId"] = Request.QueryString["Eve"].ToString(); } }
protected string SaveNotesDocManager(string strFileName, string strBasePath, string iEventId) { string sourceFile = strBasePath + strFileName; string destFile = ""; Bill_Sys_Upload_VisitReport objUpload = new Bill_Sys_Upload_VisitReport(); ArrayList UploadObj = new ArrayList(); UploadObj.Add(((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID.ToString()); UploadObj.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); UploadObj.Add(Session["UploadReport_DoctorId"].ToString()); UploadObj.Add(Session["UploadReport_VisitType"].ToString()); UploadObj.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME.ToString()); UploadObj.Add(strFileName); UploadObj.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString()); UploadObj.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME.ToString()); UploadObj.Add(Session["UploadReport_EventId"].ToString()); UploadObj.Add(Session["UploadReport_ProcedureGroupId"].ToString()); string Result = objUpload.Upload_Report_For_Visit(UploadObj); //lblMsg.Text = UploadObj[0].ToString() + "," + UploadObj[1].ToString() + "," + UploadObj[2].ToString() + "," + UploadObj[3].ToString() + "," + // UploadObj[4].ToString() + "," + UploadObj[5].ToString() + "," + UploadObj[6].ToString() + "," + UploadObj[7].ToString() + "," + UploadObj[8].ToString() + "," + UploadObj[9].ToString(); if (Result != "Failed") { if (!(Directory.Exists(Result))) { Directory.CreateDirectory(Result); } destFile = Result; System.IO.File.Copy(sourceFile, destFile + strFileName, true); Result = "Success"; } return(Result); }
protected void btnDelete_Click(object sender, EventArgs e) { Bill_Sys_Upload_VisitReport objDelete = new Bill_Sys_Upload_VisitReport(); string szOutPut = ""; for (int i = 0; i < grdViewDoc.Rows.Count; i++) { CheckBox grdChk = (CheckBox)grdViewDoc.Rows[i].FindControl("ChkDelete"); if (grdChk.Checked) { string szImageId = grdViewDoc.DataKeys[i]["I_IMAGE_ID"].ToString(); string msg = "Delete-Visit-Document File " + grdViewDoc.DataKeys[i]["File_Name"].ToString() + " is deleted by user " + ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_NAME + "on " + DateTime.Now.ToString("MM/dd/yyyy") + " with Image ID " + szImageId; string szResult = objDelete.DeleteFile(txtCompnyID.Text, szImageId, "F", ((Bill_Sys_CaseObject)this.Session["CASE_OBJECT"]).SZ_CASE_ID, msg, ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID); if (szResult == "YES") { if (szOutPut == "") { szOutPut = grdViewDoc.DataKeys[i]["File_Name"].ToString() + "is delete"; } else { szOutPut = "\\n" + grdViewDoc.DataKeys[i]["File_Name"].ToString() + "is delete"; } #region Activity_Log this._DAO_NOTES_EO = new DAO_NOTES_EO(); this._DAO_NOTES_EO.SZ_MESSAGE_TITLE = "DOC_DELETED"; this._DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Document Id : " + grdViewDoc.DataKeys[i]["I_IMAGE_ID"].ToString() + " Deleted . "; this._DAO_NOTES_BO = new DAO_NOTES_BO(); this._DAO_NOTES_EO.SZ_USER_ID = (((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID); this._DAO_NOTES_EO.SZ_CASE_ID = this._DAO_NOTES_EO.SZ_CASE_ID = (((Bill_Sys_CaseObject)this.Session["CASE_OBJECT"]).SZ_CASE_ID); this._DAO_NOTES_EO.SZ_COMPANY_ID = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID; this._DAO_NOTES_BO.SaveActivityNotes(this._DAO_NOTES_EO); #endregion } else if (szResult == "NO") { if (szOutPut == "") { szOutPut = grdViewDoc.DataKeys[i]["File_Name"].ToString() + "is not delete"; } else { szOutPut = "\\n" + grdViewDoc.DataKeys[i]["File_Name"].ToString() + "is not delete"; } } } } if (szOutPut != "") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ss", "<script language='javascript'>alert('" + szOutPut + "');</script>"); grdViewDoc.XGridBindSearch(); } }
protected void UploadButton_Click(object sender, EventArgs e) {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { if ((Session["UploadReport_DoctorId"] != null) && (Session["UploadReport_VisitType"] != null) && (Session["UploadReport_EventId"] != null) && (Session["UploadReport_ProcedureGroupId"] != null)) { if ((Session["UploadReport_DoctorId"].ToString() != "") && (Session["UploadReport_VisitType"].ToString() != "") && (Session["UploadReport_ProcedureGroupId"].ToString() != "") && (Session["UploadReport_EventId"].ToString() != "")) { Bill_Sys_Upload_VisitReport _bill_Sys_Report_Upload = new Bill_Sys_Upload_VisitReport(); if (ReportUpload.HasFile) { //check specialty node ArrayList UploadObj = new ArrayList(); UploadObj.Add(((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID.ToString()); UploadObj.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); UploadObj.Add(Session["UploadReport_DoctorId"].ToString()); UploadObj.Add(Session["UploadReport_VisitType"].ToString()); UploadObj.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME.ToString()); UploadObj.Add(ReportUpload.FileName); UploadObj.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString()); UploadObj.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME.ToString()); UploadObj.Add(Session["UploadReport_EventId"].ToString()); UploadObj.Add(Session["UploadReport_ProcedureGroupId"].ToString()); string Result = _bill_Sys_Report_Upload.Upload_Report_For_Visit(UploadObj); if (Result != "Failed") { if (!(Directory.Exists(Result))) { Directory.CreateDirectory(Result); } ReportUpload.SaveAs(Result + ReportUpload.FileName); Msglbl.Text = "Document Saved Successfully"; } else { Msglbl.Text = "Unable to save the Document"; } } else { Msglbl.Text = "No File Selected"; } } } else { Msglbl.Text = "Doctor or VisitType unknown "; } } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblMsg.Text = ""; try { //string caseId = ""; string ProcedureGroupId = ""; string url = ConfigurationManager.AppSettings["UrlOfpdf"].ToString(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "POST"; webapi.doctor.models.AppointmentRequest model = new webapi.doctor.models.AppointmentRequest(); model.User = new webapi.doctor.da.gb.model.user.User(); model.User.ID = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID; model.User.UserName = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_NAME; model.User.Domain = "GogreenBills.com"; model.User.Token = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ROLE_NAME; model.User.Account = new webapi.doctor.da.gb.model.account.Account(); model.User.Account.ID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString(); Bill_Sys_Upload_VisitReport GetSpecialty = new Bill_Sys_Upload_VisitReport(); ProcedureGroupId = GetSpecialty.GetDoctorSpecialty(Request.QueryString["Doc"].ToString(), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); model.User.Specialty = new webapi.doctor.da.gb.model.specialty.Specialty(); model.User.Specialty.ID = ProcedureGroupId; model.User.Specialty.Code = GetSpecialty.GetDoctorSpecialtyCode(Request.QueryString["Doc"].ToString(), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); model.User.Physician = new webapi.doctor.da.gb.model.physician.Physician(); model.User.Physician.ID = Request.QueryString["Doc"].ToString(); model.Appointment = new webapi.doctor.da.gb.model.appointment.Appointment(); model.Appointment.ID = Convert.ToInt32(Request.QueryString["eid"].ToString()); request.ContentType = "application/json"; JavaScriptSerializer serializer = new JavaScriptSerializer(); using (var sw = new StreamWriter(request.GetRequestStream())) { string json = serializer.Serialize(model); sw.Write(json); sw.Flush(); } HttpWebResponse response = (HttpWebResponse)request.GetResponse(); var sr = new StreamReader(response.GetResponseStream()); // read the response stream as Text. var xml = sr.ReadToEnd(); JavaScriptSerializer json_serializer = new JavaScriptSerializer(); //Object obj =json_serializer.DeserializeObject(xml); ILResponse r = JsonConvert.DeserializeObject <ILResponse>(xml); string[] Path = r.Data[0].ToString().Split(','); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ViewCHNotes", "<script type='text/javascript'>showpopup(" + Path [1].ToString().Replace("]", "") + "); </script>"); // this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "sandeep", string.Concat("<script type='text/javascript'>window.location.href='", Path[1].ToString(), "'</script>")); } catch (Exception ex) { lblMsg.Text = ex.ToString(); lblMsg.Visible = true; } } //if (Request.QueryString["cid"] != null) //{ // caseId = Request.QueryString["cid"].ToString(); //} //string Pid = ""; //if (Request.QueryString["eid"] != null) //{ // eventId = Request.QueryString["eid"].ToString(); // if (!IsPostBack) // { // Session["UploadReport_VisitType"] = Request.QueryString["Type"].ToString(); // Session["UploadReport_DoctorId"] = Request.QueryString["Doc"].ToString(); // if (Request.QueryString["pgid"].ToString() == null || Request.QueryString["pgid"].ToString() == "") // { // Pid = " "; // } // Pid = Request.QueryString["pgid"].ToString(); // Bill_Sys_Upload_VisitReport GetSpecialty = new Bill_Sys_Upload_VisitReport(); // ProcedureGroupId = GetSpecialty.GetDoctorSpecialty(Session["UploadReport_DoctorId"].ToString(), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); // //if ((Pid.Substring(0, 1) == "&") || (Pid.Substring(0, 1) == "n")) // // ProcedureGroupId = GetSpecialty.GetDoctorSpecialty(Session["UploadReport_DoctorId"].ToString(), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString()); // //else // // ProcedureGroupId = Pid; // Session["UploadReport_ProcedureGroupId"] = ProcedureGroupId; // Session["UploadReport_EventId"] = Request.QueryString["eid"].ToString(); // } // procedureGroupCode = ProcedureGroupId; // string OutputFilePath = ""; // string strResult = ""; // if (Pid == "AC") // { // OutputFilePath = getApplicationSetting("PatientInfoSaveFilePath"); // string OpenFilepath = getApplicationSetting("PatientInfoOpenFilePath"); // string newPdfFilename = ""; // newPdfFilename = "AC_Notes_" + getFileName(); // if (!Directory.Exists(OutputFilePath)) // { // Directory.CreateDirectory(OutputFilePath); // } // //OutputFilePath = OutputFilePath + newPdfFilename; // OpenFilepath = OpenFilepath + newPdfFilename; // OpenFilepath = OpenFilepath.Replace("\"", "/"); // GenerateHp1 objAcNotes = new GenerateHp1(); // objAcNotes.GenerateHp1PDF(OutputFilePath + newPdfFilename, eventId); // strResult = SaveNotesDocManager(newPdfFilename, OutputFilePath, eventId); // lblMsg.Text += strResult; // if (strResult == "Success") // { // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ViewACNotes", "<script type='text/javascript'>window.location.href='" + OpenFilepath + "'</script>"); // } // } // else if (Pid == "PM") // { // OutputFilePath = getApplicationSetting("PatientInfoSaveFilePath"); // string OpenFilepath = getApplicationSetting("PatientInfoOpenFilePath"); // string newPdfFilename = ""; // newPdfFilename = "PM_Notes_" + getFileName(); // if (!Directory.Exists(OutputFilePath)) // { // Directory.CreateDirectory(OutputFilePath); // } // //OutputFilePath = OutputFilePath + newPdfFilename; // OpenFilepath = OpenFilepath + newPdfFilename; // OpenFilepath = OpenFilepath.Replace("\"", "/"); // PMNotes_PDF objPMNotes_PDF = new PMNotes_PDF(); // objPMNotes_PDF.GeneratePMReport(OutputFilePath + newPdfFilename, eventId); // strResult = SaveNotesDocManager(newPdfFilename, OutputFilePath, eventId); // lblMsg.Text += strResult; // if (strResult == "Success") // { // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ViewPMNotes", "<script type='text/javascript'>window.location.href='" + OpenFilepath + "'</script>"); // } // } // else if (Pid == "PT") // { // OutputFilePath = getApplicationSetting("PatientInfoSaveFilePath"); // string OpenFilepath = getApplicationSetting("PatientInfoOpenFilePath"); // string newPdfFilename = ""; // newPdfFilename = "PT_Notes_" + getFileName(); // if (!Directory.Exists(OutputFilePath)) // { // Directory.CreateDirectory(OutputFilePath); // } // //OutputFilePath = OutputFilePath + newPdfFilename; // OpenFilepath = OpenFilepath + newPdfFilename; // OpenFilepath = OpenFilepath.Replace("\"", "/"); // PTNotes_PDF objPtNotes_Pdf = new PTNotes_PDF(); // objPtNotes_Pdf.GeneratePTReport(OutputFilePath + newPdfFilename, eventId); // strResult = SaveNotesDocManager(newPdfFilename, OutputFilePath, eventId); // lblMsg.Text += strResult; // if (strResult == "Success") // { // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ViewPTNotes", "<script type='text/javascript'>window.location.href='" + OpenFilepath + "'</script>"); // } // } // else if (Pid == "CH") // { // OutputFilePath = getApplicationSetting("PatientInfoSaveFilePath"); // string OpenFilepath = getApplicationSetting("PatientInfoOpenFilePath"); // string newPdfFilename = ""; // newPdfFilename = "CH_Notes_" + getFileName(); // if (!Directory.Exists(OutputFilePath)) // { // Directory.CreateDirectory(OutputFilePath); // } // //OutputFilePath = OutputFilePath + newPdfFilename; // OpenFilepath = OpenFilepath + newPdfFilename; // OpenFilepath = OpenFilepath.Replace("\"", "/"); // CHNotes_PDF objCHNotes_Pdf = new CHNotes_PDF(); // objCHNotes_Pdf.GenerateCHReport(OutputFilePath + newPdfFilename, eventId); // strResult = SaveNotesDocManager(newPdfFilename, OutputFilePath, eventId); // lblMsg.Text += strResult; // if (strResult == "Success") // { // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ViewCHNotes", "<script type='text/javascript'>window.location.href='" + OpenFilepath + "'</script>"); // } // } //} }