Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6826569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:09:47+00:00 2026-05-26T22:09:47+00:00

in this code we are having a pulldown combobox for the user to select

  • 0

in this code we are having a pulldown combobox for the user to select which status to display the data by. in some cases it is not refreshing – how can i add here a simple refresh ? here where the case starts:

       using System;
       using System.Collections.Generic;
        using System.Linq;
       using System.Text;
       using OPTFDashboard.Common.Modules.Schedules.DataModel;
       using OPTFDashboard.DataAccess;
       using OPTFDashboard.DataModel;

   namespace OPTFDashboard.Common.Modules.Schedules.DataAccess
{
   public class SchedulesRepository
 {
    public static void Summary(IEnumerable<Facility> facilities, DateTime fromDate, DateTime toDate, Action<MonthlySchedules> completionHandler)
    {
        DBHelper.Execute(
        DBHelper.StoredProcedure("OGEN.DBD_GET_MONTHLY_SCHEDULES",
        new DBHelper.Parameter("@FACILITYKEY", String.Join(",", facilities.Select(f =>  String.Format("{0}", f.FacilityKey)))),
        new DBHelper.Parameter("@FromDate", fromDate),
        new DBHelper.Parameter("@ToDate", toDate)
        ),
        (reader) =>
        {
            completionHandler((reader == null || !reader.Read()) ? null :
            new MonthlySchedules((Decimal)reader["COMPLETED"], (Decimal)reader["UNCOMPLETED"], (Decimal)reader["LATE"]));
        });
    }

    public static void Mixed(IEnumerable<Facility> facilities, Action<List<ScheduleMIXED>> completionHandler)
    {
        DBHelper.Execute(
        DBHelper.StoredProcedure("OGEN.DBD_GET_SCHEDULE_MIX",
            new DBHelper.Parameter("@FACILITYKEY", String.Join(",", facilities.Select(f => String.Format("{0}", f.FacilityKey))))
            //,
            //new DBHelper.Parameter("@UNITSTR", unit),
            //new DBHelper.Parameter("@FromDate", fromDate),
            //new DBHelper.Parameter("@ToDate", toDate)
        ),
        (reader) =>
        {
            var schedules = new List<ScheduleMIXED>();
            while (reader != null && reader.Read())
                schedules.Add(new ScheduleMIXED((String)reader["ROW_NAME"], (Decimal)reader["COMP"], (Decimal)reader["EOT_COT"], (Decimal)reader["PPS"], (Decimal)reader["QUART"], (Decimal)reader["TRACK"], (Decimal)reader["OTHER"]));
            completionHandler(schedules);
        });
    }




    public static void Details(IEnumerable<Facility> facilities, String unit, String type, DateTime fromDate, DateTime toDate, Action<List<Schedule>> completionHandler)
    {
        String storeName = String.Empty;
        switch (type)
        //  switch (type.Trim().ToUpper())
        {


            case "NOT STARTED - LATE":
                storeName = "OGEN.DBD_GET_SCHEDULE_LATE_DETAIL";
                break;


            case "COMPLETED":
                storeName = "OGEN.DBD_GET_SCHEDULE_COMPLETED_DETAIL";
                break;
            case "INCOMPLETE":
                storeName = "OGEN.DBD_GET_SCHEDULE_UNCOMPLETED_DETAIL";
                break;


            case "All":
                storeName = "OGEN.DBD_GET_SCHEDULE_ALL_DETAIL";
                break;
            case "SUBMITTED":
                storeName = "OGEN.DBD_GET_SCHEDULE_SUBMITTED_DETAIL";
                break;
            // new ones:

            case "SUBMITTED LATE":
                storeName = "OGEN.DBD_GET_SCHEDULE_SUBMITTED_LATE";
                break;
            case "NOT STARTED":
                storeName = "OGEN.DBD_GET_SCHEDULE_NOT_STARTED";
                break;
            case "COMPLETED LATE":
                storeName = "OGEN.DBD_GET_SCHEDULE_COMPLETED_LATE";
                break;
            case "INCOMPLETE LATE":
                storeName = "OGEN.DBD_GET_SCHEDULE_UNCOMPLETED_LATE";
                break;
        }


        DBHelper.Execute(
        DBHelper.StoredProcedure(storeName,
        new DBHelper.Parameter("@FACILITYKEY", String.Join(",", facilities.Select(f => String.Format("{0}", f.FacilityKey)))),
        new DBHelper.Parameter("@UNITSTR", unit),
        new DBHelper.Parameter("@FromDate", fromDate),
        new DBHelper.Parameter("@ToDate", toDate)
        ),
        (reader) =>
        {
            var schedules = new List<Schedule>();

            if (reader != null && !reader.IsClosed)
                while (reader.Read())
                {

                    Schedule objSchedule = new Schedule() { FACILITY_KEY = (String)reader ["FACILITY_KEY"], UNIT = (String)reader["UNIT_CODE"], PATIENT_ID = Convert.ToString(reader["PATIENT_ID"]).Trim(), PATIENT_NAME = (!DBNull.Value.Equals(reader["PATIENT_ID"]) ? (String)reader["PATIENT_NAME"] : String.Empty) };

                    // reference date taken out.
                    //   if (!DBNull.Value.Equals(reader["REFERENCE_DATE"]))
                    {
                        //      objSchedule.REFERENCE_DATE = (DateTime)reader["REFERENCE_DATE"]; 
                    }
                    if (!DBNull.Value.Equals(reader["A3A_DATE_USER"]))
                    {
                        objSchedule.A3A_DATE_USER = (DateTime)reader["A3A_DATE_USER"];
                    }

                    objSchedule.ASSESSMENTS = (String)reader["ASSESSMENTS"];

                    if (!DBNull.Value.Equals(reader["BASE_REASON"]))
                    {
                        objSchedule.BASE_REASON = (String)reader["BASE_REASON"];
                    }
                    if (!DBNull.Value.Equals(reader["TRACK_DESC"]))
                    {
                        objSchedule.TRACK_DESC = (String)reader["TRACK_DESC"];
                    }


                    schedules.Add(objSchedule);
                }
            completionHandler(schedules);
        });
    }



}

}

here is the code for loading the combobox

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using OPTFDashboard.ViewModel;
using System.Collections.ObjectModel;
using OPTFDashboard.Common.Ribbon;
using OPTFDashboard.Common.Utility;
using OPTFDashboard.DataModel;
using System.Windows.Data;
using OPTFDashboard.Common.Modules.Schedules.DataAccess;

namespace OPTFDashboard.Common.Modules.Schedules.ViewModels
{
    [Export]
    class ScheduleViewModel : TabViewModel, ISelectedContentTab
    {
        //
        private readonly String[] _assessmentType = new String[] { "All", "INCOMPLETE", "COMPLETED", "COMPLETED LATE", "INCOMPLETE LATE", "NOT STARTED - LATE", "NOT STARTED", "SUBMITTED", "SUBMITTED LATE" };
        //pk display ALL as default in detail tab.
        //

        public ScheduleViewModel()
            : base()
        {
            DisplayName = "Schedules";
            StartDate = DateTime.Now.AddMonths(-6);
            EndDate = DateTime.Now;

            GroupDataCollection = new ObservableCollection<GroupData>()
{

    // here is the combo box

       RibbonControlHelper.CreateFacilitySelection()
        , new GroupData("Criterria"
        , RibbonControlHelper.CreateDateSelection(StartDate,EndDate,(s, e) => { StartDate = s;    EndDate = e; RefreshData(); })
        , RibbonControlHelper.CreateUnitSelection(UnitChanged)
        , RibbonControlHelper.CreateComboBox("Assessment", "Assessment", "Select Assessment to     show.", _assessmentType, (type) => { AssessmentType = type; })
)
};


        }

        protected override void RefreshData()
        {
            if (FacilitiesAreChanging) { return; }
            Loading = true;
            SchedulesRepository.Details(FacilitySelectionService.SelectedFacilities, UnitCode, AssessmentType, StartDate, EndDate,
            (schedules) =>
            {
                var data = new ListCollectionView(schedules);
                data.GroupDescriptions.Add(new PropertyGroupDescription("FACILITY_KEY"));
                data.GroupDescriptions.Add(new PropertyGroupDescription("UNIT"));
                Data = data;
                Loading = false;
            });
        }



        private ListCollectionView _Data;
        public ListCollectionView Data
        {
            get { return _Data; }
            set { this.SetReferenceProperty("Data", ref _Data, value); }
        }

        private DateTime startDate;

        public DateTime StartDate
        {
            get { return startDate; }
            set { startDate = value; }
        }

        private DateTime endDate;

        public DateTime EndDate
        {
            get { return endDate; }
            set { endDate = value; }
        }


        public ObservableCollection<GroupData> GroupDataCollection { get; private set; }


        private String UnitCode { get; set; }
        private void UnitChanged(Unit unit)
        {
            UnitCode = unit == null ? "" : unit.Description;
            RefreshData();
        }

        private String _Type;
        private String AssessmentType
        {
            get { return _Type; }
            set { if (this.SetReferenceProperty("AssessmentType", ref _Type, value)) { RefreshData(); } }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:09:48+00:00Added an answer on May 26, 2026 at 10:09 pm

    Set the DataContext of UserControl to something (a ViewModel) that implements INotifyPropertyChanged and has a ComboBoxSource property. Then bind the ComboBox ItemsSource to the property name. When you want to refresh, just set the property on the ViewModel. PropertyChanged will fire and the ItemsSource will be updated automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some trouble with this code . The problem is when i
Having this code: $val_sql = ; $stm = $dbh->prepare(SELECT * FROM table WHERE column
I m having following Code in which this code executes when i click a
I have written this code having not used PHP for 2 years now to
Please, I'm having this code: $('#menu ul > li:not(#menu ul.first li, #menu ul.second li)').mouseenter(function()
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
Having this code... var b = new ReadOnlyCollection<int>(new[] { 2, 4, 2, 2 });
I'm having trouble with this code: NSRect itemFrame; id item; // code to assign
I've been having problems with this code I had spent the last 3 hours
I'm having a hard time using std::string::iterators in C++. This code compiles fine (still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.