protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime start      = Convert.ToDateTime(TxtFromDate.Text);
                DateTime end        = Convert.ToDateTime(TxtToDate.Text);
                int      patientId  = Convert.ToInt32(Session["PatientId"]);
                int      locationId = Convert.ToInt32(Session["LocationId"]);
                int      userId     = Convert.ToInt32(Session["AppUserID"]);

                IPatientHome PatientManager;
                PatientManager =
                    (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");
                int billId = PatientManager.CreateDebitNote(patientId, locationId, userId, start, end);
                PrintDebitNote(billId);
                string theScript;
                theScript  = "<script language='javascript' id='PDFPopup'>\n";
                theScript += "fnOpenWin('../ExcelFiles/DebitNote.pdf');\n";
                theScript += "window.location.href='../ClinicalForms/frmPatient_Home.aspx';\n";
                theScript += "</script>\n";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "PDFPopup", theScript);
            }

            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
        }
示例#2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
        DateTime start = Convert.ToDateTime(TxtFromDate.Value);
        DateTime end = Convert.ToDateTime(TxtToDate.Value);
        int patientId = Convert.ToInt32(Session["PatientId"]);
        int locationId = Convert.ToInt32(Session["LocationId"]);
        int userId = Convert.ToInt32(Session["AppUserID"]);

        IPatientHome PatientManager;
        PatientManager =
            (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");
        int billId = PatientManager.CreateDebitNote(patientId, locationId, userId, start, end);
        PrintDebitNote(billId);
        string theScript;
        theScript = "<script language='javascript' id='PDFPopup'>\n";
        theScript += "fnOpenWin('../ExcelFiles/DebitNote.pdf');\n";
        theScript += "window.location.href='../ClinicalForms/frmPatient_Home.aspx';\n";
        theScript += "</script>\n";
        Page.RegisterStartupScript("PDFPopup", theScript);


        

            //// this is some copy/paste code that needs to be updated to generate the report.
            //string theReportName = string.Empty;
            //IQCareUtils theUtils = new IQCareUtils();
            //string theStartDate;
            //string theEndDate;
            //IReports ReportDetails = (IReports)ObjectFactory.CreateInstance("BusinessProcess.Reports.BReports,BusinessProcess.Reports");

            //IQCareUtils theUtil = new IQCareUtils();
            //string theUrl = "";

            //ReportDetails = null;
            //if(theUrl!="")
            //    Response.Redirect(theUrl);
            ////-----------------------
        }

        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
    }