Ejemplo 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));
        }
Ejemplo n.º 2
0
        public static void LogException(Exception exception)
        {
            try
            {
                if (exception is SqlException)
                {
                    LogExceptions.LogExceptionInFile(exception);
                    return;
                }

                LogExceptionInFile(exception);
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 3
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);
            }
        }