private void tglSeat_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                ToggleButton   objCurrentCheckbox = sender as ToggleButton;
                SeatProperties objSeat            = objCurrentCheckbox.Tag as SeatProperties;
                if (objSeat.Column == 0)
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.IsEnabled).ToList <SeatProperties>().ForEach(x =>
                    {
                        x.IsChecked = objSeat.IsChecked;
                    });
                }
                else if (!objSeat.IsChecked)
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column == 0).FirstOrDefault().IsChecked = false;
                }
                else if (Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column != 0).Count() == Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.IsChecked).Count())
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column == 0).FirstOrDefault().IsChecked = true;
                }

                btnUnBlockSeats.IsEnabled = Seats.Where(w => w.VendorId == 0 && w.IsChecked).Count() > 0 ? false : true;

                btnBlockSeats.IsEnabled = Seats.Where(w => w.VendorId == this.vendor_Id && !w.IsChecked).Count() > 0 ? false : true;
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #2
0
        private void RearrangeRowSeats(SeatProperties objSeat)
        {
            try
            {
                Seats.Where(w => w.Column == 0).ToList <SeatProperties>().ForEach(x =>
                {
                    x.IsChecked = false; x.RowNum = 0; x.DisplayText = x.RowText = string.Empty;
                });

                int currentRow = 0;
                foreach (SeatProperties objSeatGroup in Seats.Where(w => w.Column == 0 && w.Row > currentRow).ToList <SeatProperties>())
                {
                    if (Seats.Where(w => w.Column > 0 && w.Row == objSeatGroup.Row && w.IsChecked).Count() > 0)
                    {
                        currentRow               = currentRow + 1;
                        objSeatGroup.IsChecked   = true;
                        objSeatGroup.RowNum      = currentRow;
                        objSeatGroup.DisplayText = Helper.IntToAA(objSeatGroup.RowNum);
                        objSeatGroup.RowText     = Helper.IntToAA(currentRow);
                    }
                }

                RearrangeColumnSeats(objSeat);
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #3
0
        private void RowSeatsManagement(SeatProperties objSeat)
        {
            try
            {
                if (Seats.Where(w => w.Row == objSeat.Row - 1 && w.IsChecked).Count() == 0 && Seats.Where(w => w.Row == objSeat.Row - 2 && w.IsChecked).Count() == 0 && !objSeat.IsChecked)
                {
                    ModernDialog.ShowMessage("You are already unselected previous two row's, So you can't perform this action", "Alert", MessageBoxButton.OK);
                    objSeat.IsChecked = true;
                    return;
                }
                else if (Seats.Where(w => w.Row == objSeat.Row + 1 && w.IsChecked).Count() == 0 && Seats.Where(w => w.Row == objSeat.Row + 2 && w.IsChecked).Count() == 0 && !objSeat.IsChecked)
                {
                    ModernDialog.ShowMessage("You are already unselected next two row's, So you can't perform this action", "Alert", MessageBoxButton.OK);
                    objSeat.IsChecked = true;
                    return;
                }

                //var result = ModernDialog.ShowMessage(objSeatProperties.IsChecked ? "Are you sure, you want to Select whole row ?" : "Are you sure, you want to UnSelect whole row ?", "Confirmation", MessageBoxButton.YesNo);
                var result = MessageBoxResult.Yes;
                if (result == MessageBoxResult.Yes)
                {
                    int maxrow = Seats.Where(w => w.Column == 0 && w.Row <= objSeat.Row && w.IsChecked).Max(w => w.RowNum);
                    if (!objSeat.IsChecked)
                    {
                        Seats.Where(w => w.Row == objSeat.Row).ToList <SeatProperties>().ForEach(x =>
                        {
                            x.IsChecked = objSeat.IsChecked; x.DisplayText = string.Empty; x.RowNum = 0; x.RowText = string.Empty; //x.SeatToolTip = string.Empty;
                        });
                    }
                    else
                    {
                        Seats.Where(w => w.Row == objSeat.Row && Seats.Where(o => o.Column == w.Column && o.IsChecked).Count() > 0).ToList <SeatProperties>().ForEach(x =>
                        {
                            x.IsChecked = objSeat.IsChecked; x.RowNum = maxrow + 1; x.DisplayText = (x.Column == 0 ? Helper.IntToAA(x.RowNum) : x.ColumnText); x.RowText = Helper.IntToAA(x.RowNum); //x.SeatToolTip = (x.Row == 0 || x.Column == 0 || string.IsNullOrEmpty(x.ColumnText)) ? string.Empty : string.Format("{0} - {1}", Helper.IntToAA(x.RowNum), Convert.ToString(x.ColumnText));
                        });
                    }

                    maxrow = Seats.Where(w => w.Column == 0 && w.Row <= objSeat.Row && w.IsChecked).Max(w => w.RowNum);

                    UpdateNextRpwsandColumns(objSeat, maxrow, 0);
                }
                else if (result == MessageBoxResult.No)
                {
                    objSeat.IsChecked = !objSeat.IsChecked;
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #4
0
        private void UpdateNextRpwsandColumns(SeatProperties objSeat, int maxrow, int maxColumn)
        {
            try
            {
                int currentRow    = 0;
                int currentColumn = 0;

                foreach (SeatProperties obj in Seats.Where(w => w.Row == objSeat.Row && w.IsChecked).OrderBy(w => w.Column))
                {
                    currentColumn   = currentColumn + (obj.Column == 0 ? 0 : 1);
                    obj.ColumnText  = obj.Column == 0 ? obj.ColumnText : Convert.ToString(currentColumn);
                    obj.DisplayText = obj.Column == 0 ? obj.DisplayText : Convert.ToString(currentColumn);
                }

                //if (maxrow > 0)
                //{
                foreach (SeatProperties obj in Seats.Where(w => w.Row > objSeat.Row && w.IsChecked).OrderBy(w => w.Row))
                {
                    maxrow          = obj.Row != currentRow ? maxrow + 1 : maxrow;
                    currentRow      = obj.Row != currentRow ? obj.Row : currentRow;
                    obj.RowNum      = maxrow;
                    obj.DisplayText = (obj.Column == 0 ? Helper.IntToAA(obj.RowNum) : obj.ColumnText);
                    obj.RowText     = Helper.IntToAA(obj.RowNum);
                }
                //}

                //if (maxColumn > 0)
                //{
                currentColumn = maxColumn;
                foreach (SeatProperties obj in Seats.Where(w => w.Column > objSeat.Column && w.IsChecked).OrderBy(w => w.Column))
                {
                    maxColumn       = obj.Column != currentColumn ? maxColumn + 1 : maxColumn;
                    currentColumn   = obj.Column != currentColumn ? obj.Column : currentColumn;
                    obj.ColumnText  = Convert.ToString(maxColumn);
                    obj.DisplayText = obj.ColumnText;
                }
                //}
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #5
0
        private void RearrangeColumnSeats(SeatProperties objSeat)
        {
            try
            {
                Seats.Where(w => w.Row == objSeat.Row && w.Column >= objSeat.Column).ToList <SeatProperties>().ForEach(x =>
                {
                    x.ColumnText = x.DisplayText = string.Empty;
                });

                int currentColumn = 0;
                foreach (SeatProperties obj in Seats.Where(w => w.Row == objSeat.Row && w.IsChecked).OrderBy(w => w.Column))
                {
                    currentColumn   = currentColumn + (obj.Column == 0 ? 0 : 1);
                    obj.ColumnText  = obj.Column == 0 ? obj.ColumnText : Convert.ToString(currentColumn);
                    obj.DisplayText = obj.Column == 0 ? obj.DisplayText : Convert.ToString(currentColumn);
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #6
0
        private void ColumnSeatsManagement(SeatProperties objSeat)
        {
            try
            {
                //var result = ModernDialog.ShowMessage(objSeatProperties.IsChecked ? "Are you sure, you want to Select whole column ?" : "Are you sure, you want to UnSelect whole column ?", "Confirmation", MessageBoxButton.YesNo);
                var result = MessageBoxResult.Yes;
                if (result == MessageBoxResult.Yes)
                {
                    int maxColumn = Seats.Where(w => w.Row == 0 && w.Column <= objSeat.Column && w.IsChecked && !string.IsNullOrEmpty(w.ColumnText)).Max(w => Convert.ToInt32(w.ColumnText));
                    if (!objSeat.IsChecked)
                    {
                        Seats.Where(w => w.Column == objSeat.Column).ToList <SeatProperties>().ForEach(x =>
                        {
                            x.IsChecked = objSeat.IsChecked; x.DisplayText = string.Empty; x.ColumnText = string.Empty;
                        });
                    }
                    else
                    {
                        Seats.Where(w => w.Column == objSeat.Column && Seats.Where(o => o.Row == w.Row && o.IsChecked).Count() > 0).ToList <SeatProperties>().ForEach(x =>
                        {
                            x.IsChecked = objSeat.IsChecked; x.ColumnText = Convert.ToString(maxColumn + 1); x.DisplayText = x.ColumnText; //x.SeatToolTip = (x.Row == 0 || x.Column == 0) ? string.Empty : string.Format("{0} - {1}", Helper.IntToAA(x.RowNum), Convert.ToString(x.ColumnText));
                        });
                    }

                    maxColumn = Seats.Where(w => w.Row == 0 && w.Column <= objSeat.Column && w.IsChecked && !string.IsNullOrEmpty(w.ColumnText)).Max(w => Convert.ToInt32(w.ColumnText));

                    UpdateNextRpwsandColumns(objSeat, 0, maxColumn);
                }
                else if (result == MessageBoxResult.No)
                {
                    objSeat.IsChecked = !objSeat.IsChecked;
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #7
0
        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ManageLoadingDataVisibility(true, true);
                CheckBox       objCurrentCheckbox = sender as CheckBox;
                SeatProperties objSeatProperties  = objCurrentCheckbox.Tag as SeatProperties;

                if (objSeatProperties.Column == 0)
                {
                    RowSeatsManagement(objSeatProperties);
                }
                else if (objSeatProperties.Row == 0)
                {
                    ColumnSeatsManagement(objSeatProperties);
                }
                else if (Seats.Where(w => w.Row == objSeatProperties.Row && w.Column > 0 && w.Column != objSeatProperties.Column && w.IsChecked).Count() == 0)
                {
                    RearrangeRowSeats(objSeatProperties);
                }
                else
                {
                    if (Seats.Where(w => w.Column == objSeatProperties.Column && w.Row != objSeatProperties.Row && w.IsChecked).Count() == 0)
                    {
                        Seats.Where(w => w.Row == 0).ToList <SeatProperties>().ForEach(x =>
                                                                                       { x.CheckboxVisibility = Visibility.Collapsed; x.TextVisibility = Visibility.Collapsed; });
                    }
                    RearrangeColumnSeats(objSeatProperties);
                }
                ManageLoadingDataVisibility(false, false);
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false, false);
                LogExceptions.LogException(ex);
            }
        }
예제 #8
0
        private void GeneratingLayout()
        {
            try
            {
                Seats = new ObservableCollection <SeatProperties>();
                IEnumerable <Seat> objScreenSeats = new SeatLayoutConfig().GetScreeSeats(Convert.ToInt32(cmbScreen.SelectedValue), 0, (cmbMovieTime.SelectedItem as Movie).Id);

                int columns = objScreenSeats.ToList <Seat>().Max(w => w.ColumnValue);

                var groupList = objScreenSeats.ToList <Seat>().GroupBy(l => l.ScreenClassId)
                                .Select(cl => new Seat
                {
                    ScreenClassId = cl.First().ScreenClassId,
                    RowValue      = cl.Max(c => c.RowValue),
                    ColumnValue   = cl.Max(c => c.ColumnValue),
                    DisplayOrder  = cl.First().DisplayOrder,
                    ScreenClass   = cl.First().ScreenClass
                }).ToList();

                int rowsforAllClasses = groupList.Sum(w => w.RowValue);
                foreach (Seat objscreenClass in groupList.OrderBy(w => w.DisplayOrder))
                {
                    int rows = objscreenClass.RowValue;
                    IEnumerable <Seat> objSubClassSeatsList = objScreenSeats.Where(w => w.ScreenClassId == objscreenClass.ScreenClassId);

                    Seats.Add(new SeatProperties()
                    {
                        CheckboxVisibility = Visibility.Visible,
                        Column             = objscreenClass.ScreenClassId,
                        ColumnText         = Convert.ToString(objscreenClass.ScreenClassId),
                        DisplayText        = objscreenClass.ScreenClass,
                        Id              = 0,
                        IsChecked       = false,
                        IsEnabled       = false,
                        Row             = objscreenClass.ScreenClassId,
                        RowNum          = objscreenClass.ScreenClassId,
                        RowText         = Convert.ToString(objscreenClass.ScreenClassId),
                        ScreenClassId   = objSubClassSeatsList.FirstOrDefault().ScreenClassId,
                        SeatColor       = Helper.ReturnColor("INACTIVE"),
                        SeatHeight      = 25,
                        SeatOrientation = Orientation.Horizontal,
                        SeatWidth       = (25 * columns) + 50,
                        TextVisibility  = Visibility.Visible,
                        VendorId        = objscreenClass.VendorId
                    });

                    for (int row = 1; row <= rows; row++)
                    {
                        GenerateRowNameColumn(objSubClassSeatsList.Where(w => w.RowValue == row).FirstOrDefault(), true, false);
                        foreach (Seat objSeat in objSubClassSeatsList.Where(w => w.RowValue == row).OrderBy(w => w.ColumnValue))
                        {
                            GenerateRowNameColumn(objSeat, false, objSeat.IsReserved != 1);
                        }

                        int currentRowColumns = objSubClassSeatsList.ToList <Seat>().Where(w => w.RowValue == row).Count() > 0 ? objSubClassSeatsList.ToList <Seat>().Where(w => w.RowValue == row).Count() : 0;

                        if (groupList.Where(w => w.ColumnValue == columns).Count() != groupList.Count())
                        {
                            currentRowColumns = currentRowColumns - 1;
                        }

                        if (currentRowColumns > 0 && currentRowColumns < columns)
                        {
                            for (int i = currentRowColumns; i <= columns; i++)
                            {
                                GenerateRowNameColumn(new Seat(), false, false);
                            }
                        }
                    }
                }

                foreach (Seat objSeat in groupList)
                {
                    SeatProperties objGroupSeat = Seats.Where(x => x.Id == 0 && x.ScreenClassId == objSeat.ScreenClassId).FirstOrDefault();

                    objGroupSeat.DisplayText = string.Format("{0} - {1}", objSeat.ScreenClass, Seats.Where(x => x.Id != 0 && x.ScreenClassId == objSeat.ScreenClassId).FirstOrDefault().TicketCost);
                }

                itmSeats.Width       = (25 * (columns + (groupList.Count > 1 ? 2 : 1)));
                itmSeats.Height      = (30 * (rowsforAllClasses + groupList.Count()));
                itmSeats.ItemsSource = Seats;

                ManageLoadingDataVisibility(false);
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false);
                LogExceptions.LogException(ex);
            }
        }
예제 #9
0
        private void tglSeat_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                ToggleButton   objCurrentCheckbox = sender as ToggleButton;
                SeatProperties objSeat            = objCurrentCheckbox.Tag as SeatProperties;

                int i = Convert.ToInt32((cmbSeatsCount.SelectedValue as ListBoxItem).Content);

                if (Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Id != 0 && w.IsEnabled).Count() < i)
                {
                    ModernDialog.ShowMessage(string.Format("There are few seats avalible in this Class, Less than {0} so you can't continue booking.", i), "Error", MessageBoxButton.OK);
                    objSeat.IsChecked = false;
                    return;
                }

                if ((objSeat.IsChecked || objSeat.Id == Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Id != 0).Min(w => w.Id)) && (Seats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Id != objSeat.Id && w.IsChecked).Count() == i || Seats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Id != objSeat.Id && w.IsChecked && w.IsEnabled).Count() == 0))
                {
                    Seats.Where(w => w.Id != objSeat.Id && w.IsChecked && w.IsEnabled).ToList <SeatProperties>().ForEach(x =>
                    {
                        x.IsChecked = false;
                    });
                }

                if (Seats.Where(x => x.IsEnabled && x.IsChecked && x.Id != objSeat.Id).Count() == 0 && objSeat.IsChecked)
                {
                    foreach (SeatProperties obj in Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.IsEnabled && !w.IsChecked && !string.IsNullOrEmpty(w.DisplayText) && w.DisplayText != "999" && w.Column >= objSeat.Column).ToList().OrderBy(w => w.Column))
                    {
                        i--;

                        if (i == 0)
                        {
                            break;
                        }

                        obj.IsChecked = objSeat.IsChecked;
                    }
                }
                else if (Seats.Where(x => x.IsEnabled && x.IsChecked && x.Id != objSeat.Id).Count() == i)
                {
                    objSeat.IsChecked = false;
                }

                if (objSeat.Column == 0)
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId).ToList <SeatProperties>().ForEach(x =>
                    {
                        x.IsChecked = objSeat.IsChecked;
                    });
                }
                else if (!objSeat.IsChecked)
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column == 0).FirstOrDefault().IsChecked = false;
                }
                else if (Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column != 0).Count() == Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.IsChecked).Count())
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column == 0).FirstOrDefault().IsChecked = true;
                }

                btnBlockSeats.IsEnabled     =
                    btnClearSeats.IsEnabled = Seats.Where(w => w.IsEnabled && w.IsChecked).Count() > 0 ? true : false;
                lblAmount.Content           = Seats.Where(x => x.IsEnabled && x.IsChecked).Count() > 0 ? string.Format("Amount - {0}", Convert.ToString(Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().Sum(x => x.TicketCost))) : string.Empty;
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
예제 #10
0
        private void LoadBookedTickets()
        {
            try
            {
                if (lstTimes.SelectedItem == null)
                {
                    return;
                }

                IEnumerable <Seat> objScreenSeats = new SeatLayoutConfig().GetShowTickets(Convert.ToInt32(lstScreen.SelectedValue), Convert.ToInt32((lstTimes.SelectedItem as Movie).Id));
                foreach (Seat obj in objScreenSeats)
                {
                    Seats.Where(x => x.Id == obj.ID).ToList <SeatProperties>().ForEach(w =>
                    {
                        w.IsEnabled  = obj.Is_Enabled;
                        w.TicketCost = obj.Price;
                        w.IsChecked  = !obj.Is_Enabled;
                        w.SeatColor  = Helper.ReturnColor(obj.Color);
                    });
                }

                var groupList = Seats.Where(l => l.ScreenClassId != 0).GroupBy(l => l.ScreenClassId)
                                .Select(cl => new Seat
                {
                    ScreenClassId = cl.First().ScreenClassId,
                    ScreenClass   = cl.First().ScreenClass,
                    Price         = cl.First().TicketCost
                }).ToList();

                brdClass2.Visibility     =
                    brdClass3.Visibility = txbClass2.Visibility = txbClass3.Visibility = Visibility.Collapsed;

                int i = 0;

                foreach (Seat objSeat in groupList)
                {
                    if (i == 0)
                    {
                        txbClass1.Text = string.Format("{0}  -  {1} Sold ({2} Rs), {3} Available", objSeat.ScreenClass, objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "RESERVED").Count(), objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "RESERVED").Sum(w => w.Price), objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "ACTIVE").Count());
                    }
                    else if (i == 1)
                    {
                        txbClass2.Visibility     =
                            brdClass2.Visibility = Visibility.Visible;

                        txbClass2.Text = string.Format("{0}  -  {1} Sold ({2} Rs), {3} Available", objSeat.ScreenClass, objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "RESERVED").Count(), objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "RESERVED").Sum(w => w.Price), objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "ACTIVE").Count());
                    }
                    else if (i == 2)
                    {
                        txbClass3.Visibility     =
                            brdClass3.Visibility = Visibility.Visible;
                        txbClass3.Text           = string.Format("{0}  -  {1} Sold ({2} Rs), {3} Available", objSeat.ScreenClass, objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "RESERVED").Count(), objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "RESERVED").Sum(w => w.Price), objScreenSeats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Color == "ACTIVE").Count());
                    }

                    SeatProperties objGroupSeat = Seats.Where(x => x.Id == 0 && x.ScreenClassId == objSeat.ScreenClassId).FirstOrDefault();

                    objGroupSeat.DisplayText = string.Format("{0} - {1}", objSeat.ScreenClass, Seats.Where(x => x.Id != 0 && x.CheckboxVisibility == Visibility.Visible && x.ScreenClassId == objSeat.ScreenClassId).FirstOrDefault().TicketCost);

                    i++;
                }
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false);
                LogExceptions.LogException(ex);
            }
        }
예제 #11
0
        private void tglSeat_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                ToggleButton   objCurrentCheckbox = sender as ToggleButton;
                SeatProperties objSeat            = objCurrentCheckbox.Tag as SeatProperties;

                int i = Convert.ToInt32((lstSeats.SelectedValue as ListBoxItem).Content);

                if (Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Id != 0 && w.IsEnabled).Count() < i)
                {
                    ModernDialog.ShowMessage(string.Format("There are few seats avalible in this Class, Less than {0} so you can't continue booking.", i), "Error", MessageBoxButton.OK);
                    objSeat.IsChecked = false;
                    return;
                }

                if ((objSeat.IsChecked || objSeat.Id == Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Id != 0).Min(w => w.Id)) && (Seats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Id != objSeat.Id && w.IsChecked).Count() == i || Seats.Where(w => w.ScreenClassId == objSeat.ScreenClassId && w.Id != objSeat.Id && w.IsChecked && w.IsEnabled).Count() == 0))
                {
                    Seats.Where(w => w.Id != objSeat.Id && w.IsChecked && w.IsEnabled).ToList <SeatProperties>().ForEach(x =>
                    {
                        x.IsChecked = false;
                    });
                }


                if (Seats.Where(x => x.IsEnabled && x.IsChecked && x.Id != objSeat.Id).Count() == 0 && objSeat.IsChecked)
                {
                    foreach (SeatProperties obj in Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.IsEnabled && !w.IsChecked && !string.IsNullOrEmpty(w.DisplayText) && w.DisplayText != "999" && w.Column >= objSeat.Column).ToList().OrderBy(w => w.Column))
                    {
                        i--;

                        if (i == 0)
                        {
                            break;
                        }

                        obj.IsChecked = objSeat.IsChecked;
                    }
                }
                else if (Seats.Where(x => x.IsEnabled && x.IsChecked && x.Id != objSeat.Id).Count() == i)
                {
                    objSeat.IsChecked = false;
                }

                if (objSeat.Column == 0)
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId).ToList <SeatProperties>().ForEach(x =>
                    {
                        x.IsChecked = objSeat.IsChecked;
                    });
                }
                else if (!objSeat.IsChecked)
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column == 0).FirstOrDefault().IsChecked = false;
                }
                else if (Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column != 0).Count() == Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.IsChecked).Count())
                {
                    Seats.Where(w => w.Row == objSeat.Row && w.ScreenClassId == objSeat.ScreenClassId && w.Column == 0).FirstOrDefault().IsChecked = true;
                }

                txbAmount.Text = Convert.ToString(Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().Sum(x => x.TicketCost));

                string tickets = string.Empty; string screenClass = string.Empty;
                foreach (SeatProperties objSeatProperties in Seats.Where(x => x.IsEnabled && x.IsChecked).OrderBy(x => x.Row).ThenBy(x => x.Column))
                {
                    screenClass = objSeatProperties.ScreenClass;
                    tickets     = tickets + string.Format("{0} {1}, ", objSeatProperties.RowText, objSeatProperties.ColumnText);
                }
                txbTotalAmount.Text = screenClass + " - " + tickets.Trim().TrimEnd(',') + " Total - ";

                stkBooking.Visibility = (Seats.Where(x => x.IsEnabled && x.IsChecked).Count() > 0) ? Visibility.Visible : Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }