Пример #1
0
        public string GetSystemReportsMedHistory(string _ReportName, string StartDate, string EndDate, string MedicationNameId)
        {
            string  ReportUrl = null;
            DataSet ds        = null;

            try
            {
                Streamline.UserBusinessServices.ClientMedication ObjClientMedication = new Streamline.UserBusinessServices.ClientMedication();
                ds = ObjClientMedication.GetSystemReports(_ReportName);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        ReportUrl = ds.Tables[0].Rows[0]["ReportUrl"].ToString();
                    }
                }
                if (ReportUrl != String.Empty && ReportUrl != null) // set the parameters values to report
                {
                    if (_ReportName == "Medications - View Client Consent History")
                    {
                        ReportUrl = ReportUrl.Replace("<ClientId>", (((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId).ToString());
                        ReportUrl = ReportUrl.Replace("<StartDate>", StartDate.ToString());
                        ReportUrl = ReportUrl.Replace("<EndDate>", EndDate.ToString());
                        ReportUrl = ReportUrl.Replace("<Medication>", MedicationNameId.ToString());
                    }
                }
                return(ReportUrl);
            }

            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                ds = null;
            }
        }