Exemplo n.º 1
0
        public static IEnumerable <Seat> GetScreenSeats(int screenId)
        {
            try
            {
                if (Helper.AllScreenSeats == null || Helper.AllScreenSeats.Count() == 0 || AllScreenSeats.Where(w => w.Screen_Id == screenId).Count() == 0)
                {
                    AllScreenSeats = new SeatLayoutConfig().GetScreeSeats(0, 0, 0).ToList();
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }

            return(AllScreenSeats.Where(w => w.Screen_Id == screenId));
        }
Exemplo n.º 2
0
        public static void LoadDropDownSource(Selector objSelector, IEnumerable source, string displayMember, string selectedValue, bool selectDefaultValue = true)
        {
            try
            {
                int selectedIndex = objSelector.SelectedIndex;
                objSelector.ItemsSource = source;

                objSelector.DisplayMemberPath = !string.IsNullOrEmpty(displayMember) ? displayMember : objSelector.DisplayMemberPath;
                objSelector.SelectedValuePath = !string.IsNullOrEmpty(selectedValue) ? selectedValue : objSelector.SelectedValuePath;

                objSelector.SelectedIndex = selectDefaultValue ? 0 : selectedIndex;

                if (selectedIndex == -1)
                {
                    objSelector.SelectedItem = new object();
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }