コード例 #1
0
    protected List <Tuple <string, Organisation> > GetClinicList()
    {
        try
        {
            List <Tuple <string, Organisation> > list = new List <Tuple <string, Organisation> >();

            bool allowPatientsToCreateOwnRecords = ((SystemVariables)Session["SystemVariables"])["AllowPatientsToCreateOwnRecords"].Value == "1";
            if (allowPatientsToCreateOwnRecords)
            {
                Organisation[] orgs = OrganisationDB.GetAll(false, true, false, false, true, true);
                if (orgs.Length > 0)
                {
                    for (int j = 0; j < orgs.Length; j++)
                    {
                        if (orgs[j].IsClinic)
                        {
                            list.Add(new Tuple <string, Organisation>(((SystemVariables)Session["SystemVariables"])["Site"].Value, orgs[j]));
                        }
                    }
                }
            }

            return(list);
        }
        catch (CustomMessageException cmEx)
        {
            this.lblErrorMessage.Text = cmEx.Message;
            return(null);
        }
    }
コード例 #2
0
    protected void DisplayInfo()
    {
        string curDbName = Session["DB"].ToString();

        ddlDBs.Items.Clear();
        ddlDBs.Items.Add(new ListItem("All Clients", "0"));

        ddlDBs2.Items.Clear();
        ddlDBs2.Items.Add(new ListItem("All Clients", "0"));

        ArrayList dbNames = new ArrayList();
        Hashtable dbHash  = new Hashtable();

        try
        {
            bool isSupportStaff3 = Session != null && Session["StaffID"] != null && Convert.ToInt32(Session["StaffID"]) == -4;

            List <Tuple <string, string> > list = new List <Tuple <string, string> >();


            System.Data.DataTable tbl = DBBase.ExecuteQuery("EXEC sp_databases;", "master").Tables[0];
            for (int i = 0; i < tbl.Rows.Count; i++)
            {
                string databaseName = tbl.Rows[i][0].ToString();

                if (!Regex.IsMatch(databaseName, @"Mediclinic_\d{4}"))
                {
                    continue;
                }
                //if (databaseName == "Mediclinic_0001")
                //    continue;


                SystemVariables sysVariables = SystemVariableDB.GetAll(databaseName);

                dbNames.Add(sysVariables["Site"].Value);
                dbHash[sysVariables["Site"].Value] = databaseName;


                System.Text.StringBuilder output = new System.Text.StringBuilder();

                Session["DB"] = databaseName;
                Session["SystemVariables"] = SystemVariableDB.GetAll();

                string callCenterPrefix = ((SystemVariables)Session["SystemVariables"])["CallCenterPrefix"].Value;

                int loginsPastWeek_Total = UserLoginDB.GetCount(7);
                int loginsPastWeek_Staff = UserLoginDB.GetStaffCount(7);


                if (((SystemVariables)Session["SystemVariables"])["UseMediclinicCallCenter"].Value == "1")
                {
                    Organisation[] orgs = OrganisationDB.GetAll(false, true, false, false, true, true);


                    Site[] sites          = SiteDB.GetAll();
                    int    clinicSiteID   = -1;
                    int    agedCareSiteID = -1;
                    for (int j = 0; j < sites.Length; j++)
                    {
                        if (sites[j].SiteType.ID == 1)
                        {
                            clinicSiteID = sites[j].SiteID;
                        }
                        if (sites[j].SiteType.ID == 2)
                        {
                            agedCareSiteID = sites[j].SiteID;
                        }
                    }


                    string showHideID1   = "heading_" + databaseName;
                    string showHideLink1 = @"<a href=""javascript:void(0)"" onclick=""hide_show_all('" + showHideID1 + @"');return false;"">Show/Hide Clinics/Facs</a>";

                    string siteTitleLink = @"<span style=""display:inline-block;vertical-align:middle;max-width:300px;min-width:300px;overflow:hidden;text-overflow:ellipsis;""><a style=""white-space:nowrap;"" class=""call_centre_header"" title=""" + ((SystemVariables)Session["SystemVariables"])["Site"].Value + @""" href=""" + HttpContext.Current.Request.Url.AbsolutePath + "?db=" + databaseName + @""" onclick=""http_post('" + databaseName + @"','0','0',-1);return false;"">" + ((SystemVariables)Session["SystemVariables"])["Site"].Value + @"</a></span>";
                    //string siteTitleLink      = @"<span style=""display:inline-block;min-width:250px;""><a class=""call_centre_header"" title=""" + ((SystemVariables)Session["SystemVariables"])["Site"].Value + @""" href=""" + HttpContext.Current.Request.Url.AbsolutePath + "?db=" + databaseName + @""" onclick=""http_post('" + databaseName + @"','0','0',-1);return false;"">" + ((SystemVariables)Session["SystemVariables"])["Site"].Value + @"</a></span>";
                    string callCentrePrefixText = @"<span style=""display:inline-block;min-width:160px;"">[Call Center Prefix: " + callCenterPrefix + "]</span>";

                    output.AppendLine("<tr>");
                    //output.AppendLine("    <td><u>" + ((SystemVariables)Session["SystemVariables"])["Site"].Value + "</u> &nbsp;&nbsp; [Call Center Prefix: " + callCenterPrefix + "] &nbsp;&nbsp; [" + Session["DB"] + "]</td>");
                    output.AppendLine("    <td>" + showHideLink1 + " &nbsp;&nbsp; " + (isSupportStaff3 ? @"<span style=""display:inline-block;min-width:55px;"">" + (loginsPastWeek_Staff == 0 && loginsPastWeek_Total == 0 ? "" : "[" + loginsPastWeek_Staff + "," + loginsPastWeek_Total + "]") + "</span>" + " &nbsp;&nbsp; " : "") + siteTitleLink + " &nbsp;&nbsp; " + callCentrePrefixText + " &nbsp;&nbsp; [" + Session["DB"] + "]</td>");
                    output.AppendLine("</tr>");

                    if (orgs.Length > 0)
                    {
                        for (int j = 0; j < orgs.Length; j++)
                        {
                            string showHideID  = databaseName + "_" + orgs[j].OrganisationID;
                            string contactInfo = GetContactInfo(orgs[j].EntityID, 60, showHideID);

                            string titleLink    = @"<a href=""" + HttpContext.Current.Request.Url.AbsolutePath + "?db=" + databaseName + @"&org=" + orgs[j].OrganisationID + @""" onclick=""http_post('" + databaseName + "','" + orgs[j].OrganisationID + @"','" + (orgs[j].IsClinic ? clinicSiteID : agedCareSiteID) + @"',-1);return false;"">" + orgs[j].Name + " " + (orgs[j].IsClinic ? @"(Clinic)" : "(Aged Care)") + @"</a>";
                            string showHideLink = @"<a href=""javascript:void(0)"" onclick=""hide_show('" + showHideID + @"');return false;"">Show/Hide Details</a>";


                            output.AppendLine(@"<tr id=""" + showHideID1 + j.ToString() + @""" style=""margin:0 0;display:none;"">");
                            output.AppendLine(@"    <td style=""margin:0 0;"">");
                            output.AppendLine(@"            <table><tr style=""vertical-align:top;""><td style=""width:500px;""><ul style=""margin:0 0;""><li>" + titleLink + @"</li></ul></td><td style=""min-width:10px;""></td><td>" + (contactInfo.Length > 0 ? showHideLink : "") + "</td></tr></table>");

                            if (contactInfo.Length > 0)
                            {
                                output.AppendLine(contactInfo);
                            }

                            output.AppendLine(@"    </td>");
                            output.AppendLine(@"</tr>");
                        }
                    }
                }

                list.Add(new Tuple <string, string>(((SystemVariables)Session["SystemVariables"])["Site"].Value, output.ToString()));

                Session.Remove("DB");
                Session.Remove("SystemVariables");
            }


            dbNames.Sort();
            foreach (string siteName in dbNames)
            {
                ddlDBs.Items.Add(new ListItem("[" + dbHash[siteName] + "] " + siteName, dbHash[siteName].ToString()));
                ddlDBs2.Items.Add(new ListItem("[" + dbHash[siteName] + "] " + siteName, dbHash[siteName].ToString()));
            }


            list.Sort((a, b) => a.Item1.CompareTo(b.Item1));
            System.Text.StringBuilder finalOutput = new System.Text.StringBuilder();
            foreach (Tuple <string, string> item in list)
            {
                finalOutput.Append(item.Item2);
            }

            lblInfo1.Text = "<table>" + finalOutput.ToString() + "</table>";
        }
        finally
        {
            Session["DB"] = curDbName;
            Session["SystemVariables"] = SystemVariableDB.GetAll();
        }
    }
コード例 #3
0
    protected void SetupGUI()
    {
        chkIncMedicare.Checked   = IsValidFormIncMedicare()   ? GetFormIncMedicare(false)   : false;
        chkIncDVA.Checked        = IsValidFormIncDVA()        ? GetFormIncDVA(false)        : false;
        chkIncPrivate.Checked    = IsValidFormIncPrivate()    ? GetFormIncPrivate(false)    : true;
        chkIncReconciled.Checked = IsValidFormIncReconciled() ? GetFormIncReconciled(false) : true;


        UserView userView = UserView.GetInstance();

        ddlOrgs.Style["width"] = "300px";
        ddlOrgs.Items.Clear();
        ddlOrgs.Items.Add(new ListItem("All " + (userView.IsAgedCareView ? "Facilities" : "Clinics"), (-1).ToString()));
        foreach (Organisation curOrg in OrganisationDB.GetAll(false, true, !userView.IsClinicView && !userView.IsGPView, !userView.IsAgedCareView, true, true))
        {
            ddlOrgs.Items.Add(new ListItem(curOrg.Name, curOrg.OrganisationID.ToString()));
        }

        ddlProviders.Style["width"] = "300px";
        ddlProviders.Items.Clear();
        ddlProviders.Items.Add(new ListItem("All Staff", (-1).ToString()));
        foreach (Staff curProv in StaffDB.GetAll())
        {
            ddlProviders.Items.Add(new ListItem(curProv.Person.FullnameWithoutMiddlename, curProv.StaffID.ToString()));
        }

        if (IsValidFormOrgID())
        {
            Organisation org = OrganisationDB.GetByID(GetFormOrgID());
            if (org != null)
            {
                ddlOrgs.SelectedValue = org.OrganisationID.ToString();
            }
        }

        if (!UserView.GetInstance().IsAdminView)
        {
            providerRow.Visible = false;

            Staff provider = StaffDB.GetByID(Convert.ToInt32(Session["StaffID"]));
            if (provider != null)
            {
                ddlProviders.SelectedValue = provider.StaffID.ToString();
            }
        }
        else
        {
            if (IsValidFormProviderID())
            {
                Staff provider = StaffDB.GetByID(GetFormProviderID());
                if (provider != null)
                {
                    ddlProviders.SelectedValue = provider.StaffID.ToString();
                }
            }
        }

        ddlReceiptPaymentType.Style["width"] = "300px";
        DataTable paymentTypes = DBBase.GetGenericDataTable_WithWhereOrderClause(null, "ReceiptPaymentType", "", "descr", "receipt_payment_type_id,descr");

        ddlReceiptPaymentType.Items.Add(new ListItem("All Payment Types", "-1"));
        for (int i = 0; i < paymentTypes.Rows.Count; i++)
        {
            ddlReceiptPaymentType.Items.Add(new ListItem(paymentTypes.Rows[i]["descr"].ToString(), paymentTypes.Rows[i]["receipt_payment_type_id"].ToString()));
        }

        if (IsValidFormPaymentType())
        {
            ddlReceiptPaymentType.SelectedValue = GetFormPaymentType(false).ToString();
        }


        txtStartDate.Text = IsValidFormStartDate() ? (GetFormStartDate(false) == DateTime.MinValue ? "" : GetFormStartDate(false).ToString("dd-MM-yyyy")) : DateTime.Today.ToString("dd-MM-yyyy");
        txtEndDate.Text   = IsValidFormEndDate()   ? (GetFormEndDate(false) == DateTime.MinValue ? "" : GetFormEndDate(false).ToString("dd-MM-yyyy"))   : DateTime.Today.ToString("dd-MM-yyyy");

        txtStartDate_Picker.OnClientClick = "displayDatePicker('txtStartDate', this, 'dmy', '-'); return false;";
        txtEndDate_Picker.OnClientClick   = "displayDatePicker('txtEndDate',   this, 'dmy', '-'); return false;";
    }
コード例 #4
0
    protected void SetupGUI()
    {
        UserView userView = UserView.GetInstance();

        chkIncAllSites.Text      = userView.IsAgedCareView ? "&nbsp;Inc Clinics" : "&nbsp;Inc Aged Care Facilities";
        chkIncAllSites.Checked   = IsValidFormIncAllSites()   ? GetFormIncAllSites(false)   : true;
        chkIncBookings.Checked   = IsValidFormIncBookings()   ? GetFormIncBookings(false)   : true;
        chkDateAcrossTop.Checked = IsValidFormDateAcrossTop() ? GetFormDateAcrossTop(false) : true;


        ddlOrgs.Style["width"] = "300px";
        ddlOrgs.Items.Clear();
        ddlOrgs.Items.Add(new ListItem("All " + (userView.IsAgedCareView ? "Facilities" : "Clinics"), (-1).ToString()));
        foreach (Organisation curOrg in OrganisationDB.GetAll(false, true, !userView.IsClinicView && !userView.IsGPView, !userView.IsAgedCareView, true, true))
        {
            ddlOrgs.Items.Add(new ListItem(curOrg.Name, curOrg.OrganisationID.ToString()));
        }

        ddlProviders.Style["width"] = "300px";
        ddlProviders.Items.Clear();
        ddlProviders.Items.Add(new ListItem("All Providers", (-1).ToString()));
        foreach (Staff curProv in StaffDB.GetAll())
        {
            if (curProv.IsProvider)
            {
                ddlProviders.Items.Add(new ListItem(curProv.Person.FullnameWithoutMiddlename, curProv.StaffID.ToString()));
            }
        }


        if (IsValidFormOrgID())
        {
            Organisation org = OrganisationDB.GetByID(GetFormOrgID());
            if (org != null)
            {
                ddlOrgs.SelectedValue = org.OrganisationID.ToString();
            }
        }

        if (!UserView.GetInstance().IsAdminView)
        {
            providerRow.Visible = false;

            Staff provider = StaffDB.GetByID(Convert.ToInt32(Session["StaffID"]));
            if (provider != null)
            {
                ddlProviders.SelectedValue = provider.StaffID.ToString();
            }
        }
        else
        {
            if (IsValidFormProviderID())
            {
                Staff provider = StaffDB.GetByID(GetFormProviderID());
                if (provider != null)
                {
                    ddlProviders.SelectedValue = provider.StaffID.ToString();
                }
            }
        }

        txtStartDate.Text = IsValidFormStartDate() ? (GetFormStartDate(false) == DateTime.MinValue ? "" : GetFormStartDate(false).ToString("dd-MM-yyyy")) : DateTime.Today.ToString("dd-MM-yyyy");
        txtEndDate.Text   = IsValidFormEndDate()   ? (GetFormEndDate(false) == DateTime.MinValue ? "" : GetFormEndDate(false).ToString("dd-MM-yyyy"))   : DateTime.Today.AddMonths(1).ToString("dd-MM-yyyy");

        txtStartDate_Picker.OnClientClick = "displayDatePicker('txtStartDate', this, 'dmy', '-'); return false;";
        txtEndDate_Picker.OnClientClick   = "displayDatePicker('txtEndDate', this, 'dmy', '-'); return false;";
    }
コード例 #5
0
    protected void SetupGUI()
    {
        if (Request.QueryString["date_type"] != null)
        {
            rblDateType.SelectedValue = Request.QueryString["date_type"];
        }


        UserView userView = UserView.GetInstance();

        ddlOrgs.Style["width"] = "300px";
        ddlOrgs.Items.Clear();
        ddlOrgs.Items.Add(new ListItem("All " + (userView.IsAgedCareView ? "Facilities" : "Clinics"), (-1).ToString()));
        foreach (Organisation curOrg in OrganisationDB.GetAll(false, true, !userView.IsClinicView && !userView.IsGPView, !userView.IsAgedCareView, true, true))
        {
            ListItem li = new ListItem(curOrg.Name, curOrg.OrganisationID.ToString());
            li.Attributes.Add("title", curOrg.Name);
            ddlOrgs.Items.Add(li);
        }

        ddlProviders.Style["width"] = "300px";
        ddlProviders.Items.Clear();
        ddlProviders.Items.Add(new ListItem("All Providers", (-1).ToString()));
        foreach (Staff curProv in StaffDB.GetAll())
        {
            if (curProv.IsProvider)
            {
                ddlProviders.Items.Add(new ListItem(curProv.Person.FullnameWithoutMiddlename, curProv.StaffID.ToString()));
            }
        }

        ddlOfferings.Style["width"] = "300px";
        ddlOfferings.Items.Clear();
        ddlOfferings.Items.Add(new ListItem("All Products & Services", (-1).ToString()));
        foreach (Offering offering in OfferingDB.GetAll(false, userView.IsAgedCareView ? "3,4" : "1,3", "63,89", false))
        {
            ddlOfferings.Items.Add(new ListItem(offering.Name, offering.OfferingID.ToString()));
        }

        if (IsValidFormOrgID())
        {
            Organisation org = OrganisationDB.GetByID(GetFormOrgID());
            if (org != null)
            {
                ddlOrgs.SelectedValue = org.OrganisationID.ToString();
            }
        }

        if (!UserView.GetInstance().IsAdminView)
        {
            providerRow.Visible = false;

            Staff provider = StaffDB.GetByID(Convert.ToInt32(Session["StaffID"]));
            if (provider != null)
            {
                ddlProviders.SelectedValue = provider.StaffID.ToString();
            }
        }
        else
        {
            if (IsValidFormProviderID())
            {
                Staff provider = StaffDB.GetByID(GetFormProviderID());
                if (provider != null)
                {
                    ddlProviders.SelectedValue = provider.StaffID.ToString();
                }
            }
        }

        if (IsValidFormOfferingID())
        {
            Offering offering = OfferingDB.GetByID(GetFormOfferingID());
            if (offering != null)
            {
                ddlOfferings.SelectedValue = offering.OfferingID.ToString();
            }
        }



        txtStartDate.Text = IsValidFormStartDate() ? (GetFormStartDate(false) == DateTime.MinValue ? "" : GetFormStartDate(false).ToString("dd-MM-yyyy")) : DateTime.Today.ToString("dd-MM-yyyy");
        txtEndDate.Text   = IsValidFormEndDate()   ? (GetFormEndDate(false) == DateTime.MinValue ? "" : GetFormEndDate(false).ToString("dd-MM-yyyy"))   : DateTime.Today.ToString("dd-MM-yyyy");

        txtStartDate_Picker.OnClientClick = "displayDatePicker('txtStartDate', this, 'dmy', '-'); return false;";
        txtEndDate_Picker.OnClientClick   = "displayDatePicker('txtEndDate', this, 'dmy', '-'); return false;";
    }
コード例 #6
0
    private void FillEmptyAddForm()
    {
        UrlParamCreditType urlParamCreditType = GetUrlParamCreditType();

        if (urlParamCreditType != UrlParamCreditType.Add)
        {
            throw new CustomMessageException("Can no add a '" + GetUrlParamCreditType().ToString() + "'");
        }


        ddlClinic.Items.Clear();
        ddlClinic.Items.Add(new ListItem("--Select--", "0"));
        foreach (Organisation org in OrganisationDB.GetAll(false, true, false, true, true, true))
        {
            ddlClinic.Items.Add(new ListItem(org.Name, org.OrganisationID.ToString()));
        }

        string heading = "";

        if (urlParamCreditType == UrlParamCreditType.Add)
        {
            heading = "Voucher";
        }
        if (urlParamCreditType == UrlParamCreditType.Use)
        {
            heading = "Use Of Voucher";
        }
        if (urlParamCreditType == UrlParamCreditType.CashoutTyroToMC)
        {
            heading = "Cashout - Tyro To Mediclinic";
        }
        if (urlParamCreditType == UrlParamCreditType.CashoutMCtoPT)
        {
            heading = "Cashout - Mediclinic To Patient";
        }
        lblHeading.Text = "Add " + heading;

        lblAmount.Visible = false;
        lblDescr.Visible  = false;
        lblExpiry.Visible = false;

        idRow.Visible               = false;
        typeRow.Visible             = false;
        amountUsedRow.Visible       = false;
        amountRemainingRow.Visible  = false;
        addedbyRow.Visible          = false;
        dateAddedRow.Visible        = false;
        modifiedbyRow.Visible       = false;
        dateModifiedRow.Visible     = false;
        deletedSpaceRow.Visible     = false;
        deletedbyRow.Visible        = false;
        dateDeletedRow.Visible      = false;
        preDeletedAmountRow.Visible = false;

        invoiceListSpaceRow.Visible = false;
        invoiceListRow.Visible      = false;


        if (urlParamCreditType != UrlParamCreditType.Add)
        {
            clinicRow.Visible = false;
            descrRow.Visible  = false;
            expiryRow.Visible = false;
        }
        if (urlParamCreditType != UrlParamCreditType.Use)
        {
            voucherUsedRow.Visible = false;
            invoiceRow.Visible     = false;
        }

        btnSubmit.Text    = "Add " + heading;
        btnCancel.Visible = true;
    }