Exemplo n.º 1
0
        private void LoadTicketPrices()
        {
            try
            {
                TicketPricesAndTaxes = new ObservableCollection <BoxOffice.Model.TicketPricesAndTaxes>();
                foreach (TicketPricesAndTaxes obj in new MovieTimingsRepository().GetTicketPriceAndTax(Convert.ToInt32(lstScreens.SelectedValue)).ToList())
                {
                    this.TicketPricesAndTaxes.Add(new BoxOffice.Model.TicketPricesAndTaxes()
                    {
                        CGST                = obj.CGST,
                        SGST                = obj.SGST,
                        ClassName           = obj.ClassName,
                        FK_ScreenClasses_ID = obj.FK_ScreenClasses_ID,
                        Id = obj.Id,
                        MC = obj.MC,
                        TaxConstantValue = obj.TaxConstantValue,
                        TaxPercentage    = obj.TaxPercentage,
                        TicketPrice      = obj.TicketPrice
                    });
                }

                dgrdCosts.ItemsSource  = this.TicketPricesAndTaxes;
                pgrProgress.Visibility = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                pgrProgress.Visibility = Visibility.Collapsed;
                LogExceptions.LogException(ex);
            }
        }
 private void GenerateRowNameColumn(Seat objSeat, bool isSelectAllColumn, bool isEnable = true)
 {
     try
     {
         Seats.Add(new SeatProperties()
         {
             CheckboxVisibility = isSelectAllColumn ? Visibility.Visible : (objSeat.FK_SeatStatus_ID != 0 ? Visibility.Visible : Visibility.Collapsed),
             Column             = isSelectAllColumn ? 0 : objSeat.ColumnValue,
             ColumnText         = isSelectAllColumn ? Convert.ToString(0) : (!string.IsNullOrEmpty(objSeat.RowText) ? Convert.ToString(objSeat.ColumnText) : string.Empty),
             DisplayText        = isSelectAllColumn ? Convert.ToString(objSeat.RowText) : (!string.IsNullOrEmpty(objSeat.RowText) ? Convert.ToString(objSeat.ColumnText) : string.Empty),
             Id              = objSeat.ID,
             IsChecked       = objSeat.VendorId != 0 ? true : false,
             IsEnabled       = (objSeat.VendorId != 0 ? (objSeat.VendorId == this.vendor_Id ? true : false) : isEnable),
             Row             = objSeat.RowValue,
             RowNum          = objSeat.RowValue,
             RowText         = Convert.ToString(objSeat.RowText),
             ScreenClassId   = objSeat.ScreenClassId,
             SeatColor       = Helper.ReturnColor((objSeat.VendorId > 0) ? objSeat.Color : (objSeat.FK_SeatStatus_ID == 0 && !isSelectAllColumn) ? "INACTIVE" : "ACTIVE"),
             SeatHeight      = 25,
             SeatOrientation = Orientation.Horizontal,
             SeatWidth       = isSelectAllColumn ? 50 : 20,
             TextVisibility  = Visibility.Visible,
             VendorId        = objSeat.VendorId
         });
     }
     catch (Exception ex)
     {
         LogExceptions.LogException(ex);
     }
 }
        private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
#if TRACE
            LogExceptions.LogTrace(true, "NetworkChange_NetworkAvailabilityChanged>" + e.IsAvailable);
#endif
            AutoUpdatedSharedConnection();
        }
        private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
        {
#if TRACE
            LogExceptions.LogTrace(true, "NetworkChange_NetworkAddressChanged");
#endif
            AutoUpdatedSharedConnection();
        }
        private void AutoUpdatedSharedConnection()
        {
            if (_status != WorkingStatus.Started)
            {
                // only when the app is started this should update the shared connection!
                return;
            }

            if (!ConfigShareInternet)
            {
                return;
            }
            if (!ConfigAutoInternet)
            {
                return;
            }

            var internetConnected = GetIcsToShare();

            if (internetConnected == null)
            {
                return;
            }

            // connection is changed
            if (_sharedConnection == null || internetConnected.Guid != _sharedConnection.Guid)
            {
#if TRACE
                LogExceptions.LogTrace(true, "AutoUpdatedSharedConnection -> " + internetConnected.Name);
#endif

                ShareConnection(internetConnected);
            }
        }
        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);
            }
        }
Exemplo n.º 7
0
        private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                DateTime dtSelectedDate = DateTime.Now;

                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => dtSelectedDate = Convert.ToDateTime(dprStartingDate.SelectedDate)));

                IEnumerable <Movie> movies = new MovieTimingsRepository().GetMovies(dtSelectedDate);

                if (movies == null || movies.Count() == 0)
                {
                    Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => ManageLoadingDataVisibility(false)));

                    return;
                }

                Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => Helper.LoadDropDownSource(cmbMovie, movies, "MovieName", "Id")));
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false);
                LogExceptions.LogException(ex);
            }
        }
        private bool StopInternal(bool verbose)
        {
            try
            {
                Status = WorkingStatus.Stopping;

                DisableSharing(true);

                _wlanManager.StopHostedNetwork();

#if TRACE
                LogExceptions.LogTrace(true, "WLanStop->Done");
#endif
                if (verbose)
                {
                    Status = WorkingStatus.Stopped;
                }

                return(true);
            }
            catch (Exception ex)
            {
                LogExceptions.Log(ex);

                Status = WorkingStatus.StopFailed;
                return(false);
            }
        }
Exemplo n.º 9
0
        private void cmbClass_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                IEnumerable <Seat> objScreenSeats = new ObservableCollection <Seat>(new SeatLayoutConfig().GetScreeSeats(Convert.ToInt32(cmbScreen.SelectedValue), Convert.ToInt32(cmbClass.SelectedValue), 0).ToList());

                Seats = new ObservableCollection <SeatProperties>();

                txtColumns.IsEnabled  =
                    txtRows.IsEnabled =
                        cmbSeatingDirection.IsEnabled =
                            btnGenerate.IsEnabled     =
                                btnSave.IsEnabled     = objScreenSeats.Count() > 0 ? false : true;

                txbLayoutMessage.Visibility = objScreenSeats.Count() > 0 ? Visibility.Visible : Visibility.Collapsed;
                btnDelete.IsEnabled         = objScreenSeats.Count() > 0 ? true : false;

                itmSeats.ItemsSource = Seats;

                ManageLoadingDataVisibility(false, false);
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false, false);
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 10
0
 private void GenerateColumnSelection(int row, int column)
 {
     try
     {
         Seats.Add(new SeatProperties()
         {
             CheckboxVisibility = (row == 0) ? (ShowHeaderCheckBoxes ? Visibility.Visible : Visibility.Collapsed) : Visibility.Visible,
             Column             = column,
             ColumnText         = Convert.ToString(column),
             DisplayText        = Convert.ToString(column),
             IsChecked          = true,
             IsEnabled          = (row == 0 && column == 0) ? false : true,
             Row             = row,
             RowNum          = row,
             RowText         = Helper.IntToAA(row),
             SeatColor       = (row == 0 && column == 1) ? Helper.ReturnColor("INACTIVE") : Helper.ReturnColor("ACTIVE"),
             SeatHeight      = row == 0 ? 80 : 30,
             SeatOrientation = row == 0 ? Orientation.Vertical : Orientation.Horizontal,
             SeatWidth       = 40,
             TextVisibility  = (row == 0 ? Visibility.Visible : Visibility.Collapsed)
         });
     }
     catch (Exception ex)
     {
         LogExceptions.LogException(ex);
     }
 }
Exemplo n.º 11
0
        private void LoadDropdownsData()
        {
            try
            {
                Helper.LoadDropDownSource(cmbScreen, new SeatLayoutConfig().GetScreens(), "ScreenName", "Id");

                IList <ControlItems> objControlItems = new List <ControlItems>();
                objControlItems.Add(new ControlItems()
                {
                    Id = "1", Value = "L -> R And A -> Z"
                });
                objControlItems.Add(new ControlItems()
                {
                    Id = "2", Value = "R -> L And A -> Z"
                });
                objControlItems.Add(new ControlItems()
                {
                    Id = "3", Value = "L -> R And Z -> A"
                });
                objControlItems.Add(new ControlItems()
                {
                    Id = "4", Value = "R -> L And Z -> A"
                });
                Helper.LoadDropDownSource(cmbSeatingDirection, objControlItems, "Value", "Id");
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false, false);
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 12
0
        public HoldTray()
        {
            try
            {
                InitializeComponent();

                dprStartingDate.DisplayDateStart = DateTime.Now;

                dprStartingDate.DisplayDateEnd = DateTime.Now.AddDays(Convert.ToInt32(ConfigurationSettings.AppSettings["CalenderDuration"]));

                foreach (int index in Enumerable.Range(1, Convert.ToInt32(ConfigurationSettings.AppSettings["MaxBookingSeats"])).ToList())
                {
                    cmbSeatsCount.Items.Add(new ListBoxItem()
                    {
                        Content = index
                    });
                }
                cmbSeatsCount.SelectedIndex = 0;

                dprStartingDate.SelectedDate         = DateTime.Now;
                dprStartingDate.SelectedDateChanged += dprStartingDate_SelectedDateChanged;

                LoadMovies();
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 13
0
        private void DisableSharing(bool force = false)
        {
            if (!force)
            {
                if (_sharedConnection == null)
                {
#if TRACE
                    LogExceptions.LogTrace(true, "WLanDisableSharing,NotShared,forced?=" + force);
#endif
                    return;
                }
#if TRACE
                LogExceptions.LogTrace(true, "WLanDisableSharing,Shared,forced?=" + force);
#endif
            }
            else
            {
#if TRACE
                LogExceptions.LogTrace(true, "WLanDisableSharing,NoState,forced?=" + force);
#endif
            }
            if (_icsManager.SharingInstalled)
            {
                _icsManager.DisableIcsOnAll();
            }
            SharedConnection = null;
        }
Exemplo n.º 14
0
 private void GenerateRowSelection(int row)
 {
     try
     {
         Seats.Add(new SeatProperties()
         {
             CheckboxVisibility = row > 0 ? Visibility.Visible : Visibility.Collapsed,
             Column             = 0,
             ColumnText         = Convert.ToString(0),
             DisplayText        = Helper.IntToAA(row),
             IsChecked          = true,
             IsEnabled          = (row == 1) ? false : true,
             Row             = row,
             RowNum          = row,
             RowText         = Helper.IntToAA(row),
             SeatColor       = (row == 1) ? Helper.ReturnColor("INACTIVE") : Helper.ReturnColor("ACTIVE"),
             SeatHeight      = row == 0 ? 90 : 30,
             SeatOrientation = row == 0 ? Orientation.Vertical : Orientation.Horizontal,
             SeatWidth       = 80,
             TextVisibility  = Visibility.Visible
         });
     }
     catch (Exception ex)
     {
         LogExceptions.LogException(ex);
     }
 }
Exemplo n.º 15
0
        public Booking()
        {
            try
            {
                InitializeComponent();

                dprStartingDate.DisplayDateStart = DateTime.Now;

                dprStartingDate.DisplayDateEnd = DateTime.Now.AddDays(Convert.ToInt32(ConfigurationSettings.AppSettings["CalenderDuration"]));

                foreach (int index in Enumerable.Range(1, Convert.ToInt32(ConfigurationSettings.AppSettings["MaxBookingSeats"])).ToList())
                {
                    lstSeats.Items.Add(new ListBoxItem()
                    {
                        Content = index
                    });
                }
                lstSeats.SelectedIndex = 0;

                dprStartingDate.SelectedDate         = DateTime.Now;
                dprStartingDate.SelectedDateChanged += dprStartingDate_SelectedDateChanged;

                ManageLoadingDataVisibility(true);
                LoadMovies();

                //txbBookedSeats.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom(Helper.ReturnColor("RESERVED")));
                //txbAvalibleSeats.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom(Helper.ReturnColor("ACTIVE")));
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 16
0
 private void GenerateRowNameColumn(Seat objSeat, bool isSelectAllColumn, bool isEnable = true)
 {
     try
     {
         Seats.Add(new SeatProperties()
         {
             CheckboxVisibility = isSelectAllColumn ? Visibility.Visible : (objSeat.FK_SeatStatus_ID != 0 ? Visibility.Visible : Visibility.Collapsed),
             Column             = isSelectAllColumn ? 0 : objSeat.ColumnValue,
             ColumnText         = isSelectAllColumn ? Convert.ToString(0) : (!string.IsNullOrEmpty(objSeat.RowText) ? Convert.ToString(objSeat.ColumnText) : string.Empty),
             DisplayText        = isSelectAllColumn ? Convert.ToString(objSeat.RowText) : (!string.IsNullOrEmpty(objSeat.RowText) ? Convert.ToString(objSeat.ColumnText) : string.Empty),
             Id              = objSeat.ID,
             IsChecked       = !isSelectAllColumn && objSeat.IsReserved == 1,
             IsEnabled       = isEnable,
             Row             = objSeat.RowValue,
             RowNum          = objSeat.RowValue,
             RowText         = Convert.ToString(objSeat.RowText),
             ScreenClassId   = objSeat.ScreenClassId,
             SeatColor       = Helper.ReturnColor(objSeat.Color),
             SeatHeight      = 25,
             SeatOrientation = Orientation.Horizontal,
             SeatWidth       = isSelectAllColumn ? 50 : 20,
             TextVisibility  = Visibility.Visible,
             TicketCost      = objSeat.Price,
             VendorId        = objSeat.VendorId
         });
     }
     catch (Exception ex)
     {
         LogExceptions.LogException(ex);
     }
 }
Exemplo n.º 17
0
        public static void LogException(string errorType, Exception ex,
                                        string message = null)
        {
            var sb = new StringBuilder();

            while (ex != null)
            {
                if (sb.Length > 0)
                {
                    sb.Append(Environment.NewLine);
                    sb.Append(Environment.NewLine);
                }
                sb.Append(ex.Message);
                sb.Append(Environment.NewLine);
                sb.Append(ex.StackTrace);
                ex = ex.InnerException;
            }

            var currentUrl = HttpContext.Current != null
        ? CurrentUrl
        : "CurrentUrl not available";

            LogExceptions.Insert(DateTime.UtcNow, Environment.MachineName, errorType,
                                 currentUrl, message, sb.ToString());
        }
Exemplo n.º 18
0
        private void DayBox_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            try
            {
                //-- call to FindVisualAncestor to make sure they didn't click on existing appointment (in which case,
                //   that appointment window is already opened by handler Appointment_DoubleClick)

                if (object.ReferenceEquals(e.Source.GetType(), typeof(DayBoxControl)) && Utilities.FindVisualAncestor(typeof(DayBoxAppointmentControl), e.OriginalSource) == null)
                {
                    NewAppointmentEventArgs ev = new NewAppointmentEventArgs();
                    if (((DayBoxControl)e.Source).Tag != null)
                    {
                        ev.StartDate = new System.DateTime(displayYear, displayMonth, Convert.ToInt32(((DayBoxControl)e.Source).Tag), 10, 0, 0);
                        ev.EndDate   = Convert.ToDateTime(ev.StartDate).AddHours(2);
                    }
                    if (DayBoxDoubleClicked != null)
                    {
                        DayBoxDoubleClicked(ev);
                    }
                    e.Handled = true;
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 19
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var result = ModernDialog.ShowMessage("Are you sure, you want to delete Layout ?", "Confirmation", MessageBoxButton.YesNo);

                if (result == MessageBoxResult.No)
                {
                    return;
                }

                var deleteResult = new SeatLayoutConfig().DeleteLayout(Convert.ToInt32(cmbScreen.SelectedValue), Convert.ToInt32(cmbClass.SelectedValue));

                ModernDialog.ShowMessage(deleteResult == 1 ? "Screen Layout deleted successfully." : "Sorry!.. We are unable to delete Screen Layout. Screen layout is in using", "Alert", MessageBoxButton.OK);

                if (deleteResult == 1)
                {
                    Helper.LoadDropDownSource(cmbClass, new SeatLayoutConfig().GetScreeClasses(Convert.ToInt32(cmbScreen.SelectedValue)), "ScreenClassName", "ScreenClassId", false);
                }
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false, false);
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 20
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);
            }
        }
        public override void LogException(Exception ex, string message = null, params object[] args)
        {
            if (string.IsNullOrEmpty(message) == false)
            {
                message = string.Format(message, args ?? Enumerable.Empty <object>());
            }

            LogExceptions.Add(Tuple.Create(ex, message));
        }
Exemplo n.º 22
0
        protected void Application_Error(object sender, EventArgs e)
        {
            Exception exc = Server.GetLastError();

            Response.StatusCode  = 500;
            Response.ContentType = "application/json";
            Response.Write("An error happened. Please contact the administrator for more information.");
            LogExceptions.Log(exc, Request.HttpMethod, Request.Url.AbsoluteUri, "");
        }
Exemplo n.º 23
0
 private void LoadWholeSeats()
 {
     try
     {
         Helper.GetScreenSeats(0);
     }
     catch (Exception ex)
     {
         LogExceptions.LogException(ex);
     }
 }
Exemplo n.º 24
0
 public Reports()
 {
     try
     {
         InitializeComponent();
     }
     catch (Exception ex)
     {
         LogExceptions.LogException(ex);
     }
 }
Exemplo n.º 25
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Seats == null || Seats.Count() == 0)
                {
                    txbMessage.Text   = "Please enter Rows and Columns to generate layout";
                    txbMessage.Height = 30;
                    return;
                }
                txbMessage.Height = 0;
                var result = ModernDialog.ShowMessage("Are you sure, you want to Save Layout ?", "Confirmation", MessageBoxButton.YesNo);

                if (result == MessageBoxResult.Yes)
                {
                    ManageLoadingDataVisibility(false, true);
                    Screenclasses objScreenclasses = new Screenclasses();
                    objScreenclasses.ScreenId      = Convert.ToInt32(cmbScreen.SelectedValue);
                    objScreenclasses.ScreenClassId = Convert.ToInt32(cmbClass.SelectedValue);
                    objScreenclasses.RowCount      = Convert.ToInt32(txtRows.Text);
                    objScreenclasses.ColumnCount   = Convert.ToInt32(txtColumns.Text);

                    objScreenclasses.seats = new List <Seat>();

                    foreach (SeatProperties sp in Seats.Where(w => w.Column != 0 && w.Row != 0))
                    {
                        objScreenclasses.seats.Add(new Seat()
                        {
                            ColumnText  = Convert.ToString(sp.ColumnText),
                            ColumnValue = sp.Column,
                            RowText     = sp.RowText,
                            RowValue    = sp.Row
                        });
                    }

                    int insertRresult = new SeatLayoutConfig().BulkInsertSeat(objScreenclasses);

                    if (insertRresult == 1)
                    {
                        Helper.LoadDropDownSource(cmbClass, new SeatLayoutConfig().GetScreeClasses(Convert.ToInt32(cmbScreen.SelectedValue)), "ScreenClassName", "ScreenClassId", false);
                    }

                    ModernDialog.ShowMessage(insertRresult == 1 ? "Screen Layout saved succefully" : "Unable to save Screen Layout at this moment.. Try after sometime", "Alert", MessageBoxButton.OK);

                    ManageLoadingDataVisibility(false, false);
                }
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false, false);
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 26
0
 private void cmbScreen_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         Helper.LoadDropDownSource(cmbClass, new SeatLayoutConfig().GetScreeClasses(Convert.ToInt32(cmbScreen.SelectedValue)), "ScreenClassName", "ScreenClassId");
     }
     catch (Exception ex)
     {
         ManageLoadingDataVisibility(false, false);
         LogExceptions.LogException(ex);
     }
 }
Exemplo n.º 27
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);
            }
        }
Exemplo n.º 28
0
        public MainPage()
        {
            try
            {
                InitializeComponent();

                Helper.LoadDropDownSource(cmbTheatres, new SeatTemplateRepository().GetTheatres(), "THEATRENAME", "Id");
                txtUserName.Focus();
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 29
0
        private void btnBookSeats_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                ManageLoadingDataVisibility(true);

                if (Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().Count() == 0)
                {
                    ModernDialog.ShowMessage("Please Select seats", "Alert", MessageBoxButton.OK);
                }
                else if (Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().Count() > Convert.ToInt32(ConfigurationSettings.AppSettings["MaxBookingSeats"]))
                {
                    ModernDialog.ShowMessage(string.Format("You can select Maximum {0} seats only", Convert.ToInt32(ConfigurationSettings.AppSettings["MaxBookingSeats"])), "Alert", MessageBoxButton.OK);
                }
                else if (Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().GroupBy(l => l.ScreenClassId).Count() > 1)
                {
                    ModernDialog.ShowMessage("Please Book tickets from Only one Class, You Can't book tickets from multiple classes", "Alert", MessageBoxButton.OK);
                }
                else if (Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().Count() != Convert.ToInt32((cmbSeatsCount.SelectedValue as ListBoxItem).Content))
                {
                    ModernDialog.ShowMessage("Required seats and selected seats count is not matched.", "Alert", MessageBoxButton.OK);
                }
                else if (ModernDialog.ShowMessage("Are you sure, you want to Hold selected Seat's ?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    var selectedSeats = Seats.Where(x => x.IsEnabled && x.IsChecked).ToList();
                    var seats         = string.Join(",", selectedSeats.Select(x => x.Id));

                    var result = new MovieTimingsRepository().InsertMovieBooking(Convert.ToInt32(cmbMovie.SelectedValue), selectedSeats.Count(), Convert.ToDouble(Seats.Where(x => x.IsEnabled && x.IsChecked).ToList().Sum(x => x.TicketCost)), selectedSeats.FirstOrDefault().ScreenClassId, Convert.ToInt32(cmbScreen.SelectedValue), Convert.ToInt32((cmbMovieTime.SelectedItem as Movie).Id), seats);

                    if (result == 0)
                    {
                        ModernDialog.ShowMessage("Seats Holding failed..", "Alert", MessageBoxButton.OK);
                    }
                    else
                    {
                        ModernDialog.ShowMessage("Selected Seats Holded successfully.", "Alert", MessageBoxButton.OK);

                        GenerateLayout();
                        ClearSelection();
                    }
                }

                ManageLoadingDataVisibility(false);
            }
            catch (Exception ex)
            {
                ManageLoadingDataVisibility(false);
                LogExceptions.LogException(ex);
            }
        }
Exemplo n.º 30
0
 private void LoadMovies()
 {
     try
     {
         ManageLoadingDataVisibility(true);
         BackgroundWorker bw = new BackgroundWorker();
         bw.DoWork += new DoWorkEventHandler(bw_DoWork);
         bw.RunWorkerAsync(System.Reflection.Assembly.GetExecutingAssembly().Location);
     }
     catch (Exception ex)
     {
         ManageLoadingDataVisibility(false);
         LogExceptions.LogException(ex);
     }
 }