Beispiel #1
0
 public fAdminFilms(AuthorisedUser user)
 {
     InitializeComponent();
     if (user.GetType() == typeof(AdminUser))
     {
         this.user = user;
         //класс, считывающий данные из бд и это в List засунуть;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         filmsList                              = reading.ReadFilms();
         sourceData.DataSource                  = filmsList.Films;
         dataGridViewFilm.DataSource            = sourceData;
         dataGridViewFilm.Columns[0].Visible    = false;
         dataGridViewFilm.Columns[1].HeaderText = "Название";
         dataGridViewFilm.Columns[2].HeaderText = "Длительность";
         dataGridViewFilm.Columns[3].HeaderText = "Ограничение";
         dataGridViewFilm.Columns[4].HeaderText = "Цена";
     }
     else
     {
         this.user = user;
         //класс, считывающий данные из бд и это в List засунуть;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         filmsList                           = reading.ReadFilms();
         sourceData.DataSource               = filmsList.Films;
         dataGridViewFilm.DataSource         = sourceData;
         dataGridViewFilm.Columns[0].Visible = false;
         AddButton.Visible                   = false;
         UpdateButton.Visible                = false;
         DeleteButton.Visible                = false;
     }
 }
Beispiel #2
0
 public fCashiers(AuthorisedUser user)
 {
     InitializeComponent();
     if (user.GetType() == typeof(AdminUser))
     {
         this.user = user;
         //класс, считывающий данные из бд и это в List засунуть;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         reading.ReadFromDateBase();
         cashiersList                               = new ListOfCashiers(reading.cashierList);
         sourceData.DataSource                      = cashiersList.Cashiers;
         dataGridViewCashiers.DataSource            = sourceData;
         dataGridViewCashiers.Columns[0].Visible    = false;
         dataGridViewCashiers.Columns[1].HeaderText = "Фамилия";
         dataGridViewCashiers.Columns[2].HeaderText = "Имя";
         dataGridViewCashiers.Columns[3].HeaderText = "Отчество";
         dataGridViewCashiers.Columns[4].Visible    = false;
         dataGridViewCashiers.Columns[5].HeaderText = "Логин";
         dataGridViewCashiers.Columns[6].HeaderText = "Пароль";
     }
     else
     {
         //класс, считывающий данные из бд и это в List засунуть;
         MessageBox.Show("Запрещено");
         this.Close();
     }
 }
Beispiel #3
0
 public fHalls(AuthorisedUser user)
 {
     InitializeComponent();
     if (user.GetType() == typeof(AdminUser))
     {
         this.user = user;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         hallsList                               = reading.ReadHalls();
         placesList                              = reading.ReadAllPlacesOfAllHalls();
         sourceData.DataSource                   = hallsList.Halls;
         dataGridViewHalls.DataSource            = sourceData;
         dataGridViewHalls.Columns[0].Visible    = false;
         dataGridViewHalls.Columns[1].HeaderText = "Название";
         dataGridViewHalls.Columns[2].HeaderText = "Кол-во мест";
         dataGridViewHalls.Columns[3].HeaderText = "Кол-во мест в ряду";
     }
     else
     {
         this.user = user;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         hallsList                               = reading.ReadHalls();
         placesList                              = reading.ReadAllPlacesOfAllHalls();
         sourceData.DataSource                   = hallsList.Halls;
         dataGridViewHalls.DataSource            = sourceData;
         dataGridViewHalls.Columns[0].Visible    = false;
         dataGridViewHalls.Columns[1].HeaderText = "Название";
         dataGridViewHalls.Columns[2].HeaderText = "Кол-во мест";
         dataGridViewHalls.Columns[3].HeaderText = "Кол-во мест в ряду";
         AddButton.Visible                       = false;
         UpdateButton.Visible                    = false;
         DeleteButton.Visible                    = false;
     }
 }
Beispiel #4
0
 public fPercents(AuthorisedUser user)
 {
     InitializeComponent();
     if (user.GetType() == typeof(AdminUser))
     {
         this.user = user;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         percentList                                = reading.ReadPercentages();
         sourceData.DataSource                      = percentList.Percents;
         dataGridViewPercents.DataSource            = sourceData;
         dataGridViewPercents.Columns[0].Visible    = false;
         dataGridViewPercents.Columns[1].HeaderText = "Скидка/Наценка";
         dataGridViewPercents.Columns[2].HeaderText = "Описание";
         dataGridViewPercents.Columns[3].HeaderText = "Процент";
     }
     else
     {
         this.user = user;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         percentList                                = reading.ReadPercentages();
         sourceData.DataSource                      = percentList.Percents;
         dataGridViewPercents.DataSource            = sourceData;
         dataGridViewPercents.Columns[0].Visible    = false;
         dataGridViewPercents.Columns[1].HeaderText = "Скидка/Наценка";
         dataGridViewPercents.Columns[2].HeaderText = "Описание";
         dataGridViewPercents.Columns[3].HeaderText = "Процент";
         AddButton.Visible                          = false;
         UpdateButton.Visible                       = false;
         DeleteButton.Visible                       = false;
         this.Close();
     }
 }
Beispiel #5
0
        public static void UpdateClassTeacherWithInitialAuthUserValues(AuthorisedUser authUser, string teacherUserName)
        {
            string setInstanceId, userType;

            if (authUser.InstanceID == null)
            {
                setInstanceId = "set InstanceId = null";
            }
            else
            {
                setInstanceId = "set InstanceId ='" + authUser.InstanceID + "'";
            }

            if (authUser.UserType == null)
            {
                userType = "UserType = null";
            }
            else
            {
                userType = "UserType ='" + authUser.UserType + "'";
            }


            string sql = String.Format(
                "Update app.AuthorisedUser " +
                setInstanceId + ", " +
                userType +
                " where username = '******'");

            DataAccessHelpers.Execute(sql);
        }
Beispiel #6
0
        public fTickets(AuthorisedUser user)
        {
            InitializeComponent();
            this.user = user;
            ReadingFromDateBase reading = new ReadingFromDateBase();

            ticketsList      = reading.ReadTickets();
            percentsList     = reading.ReadPercentages();
            totalPercentList = reading.ReadTotalPercents();
            statusTicketList = reading.ReadStatusTickets();
            sessionList      = reading.ReadSessions();
            LoadDataGridView();
        }
Beispiel #7
0
 public fSessions(AuthorisedUser user)
 {
     this.user = user;
     InitializeComponent();
     if (user.GetType() == typeof(AdminUser))
     {
         ReadingFromDateBase reading = new ReadingFromDateBase();
         sessionsList = reading.ReadSessions();
         foreach (var i in sessionsList.Sessions)
         {
             filmIds.Add(i.FilmSession.FilmId);
             hallIds.Add(i.HallSession.HallId);
         }
         LoadDataGridView();
         filmList = reading.ReadFilms();
         hallList = reading.ReadHalls();
         FilmComboBox.DataSource    = filmList.Films;
         FilmComboBox.DisplayMember = "FilmName";
         FilmComboBox.ValueMember   = "FilmId";
         HallComboBox.DataSource    = hallList.Halls;
         HallComboBox.DisplayMember = "HallName";
         HallComboBox.ValueMember   = "HallId";
     }
     else
     {
         this.user = user;
         ReadingFromDateBase reading = new ReadingFromDateBase();
         sessionsList = reading.ReadSessions();
         foreach (var i in sessionsList.Sessions)
         {
             filmIds.Add(i.FilmSession.FilmId);
             hallIds.Add(i.HallSession.HallId);
         }
         for (int i = 0; i < sourceData.Count; i++)
         {
             dataGridViewSessions[2, i].Value = filmIds[i];
         }
         LoadDataGridView();
         filmList = reading.ReadFilms();
         hallList = reading.ReadHalls();
         FilmComboBox.DataSource    = filmList.Films;
         FilmComboBox.DisplayMember = "FilmName";
         FilmComboBox.ValueMember   = "FilmId";
         HallComboBox.DataSource    = hallList.Halls;
         HallComboBox.DisplayMember = "HallName";
         HallComboBox.ValueMember   = "HallId";
         AddButton.Visible          = false;
         UpdateButton.Visible       = false;
         DeleteButton.Visible       = false;
     }
 }
Beispiel #8
0
        public fTickets(AuthorisedUser user, Session session, int row, int placeNumber, double price)
        {
            InitializeComponent();
            this.user = user;
            ReadingFromDateBase reading = new ReadingFromDateBase();

            ticketsList      = reading.ReadTickets();
            percentsList     = reading.ReadPercentages();
            totalPercentList = reading.ReadTotalPercents();
            statusTicketList = reading.ReadStatusTickets();
            sessionList      = reading.ReadSessions();
            LoadDataGridView();
            SessionInput.Text     = session.FilmSession.FilmName;
            RowInput.Text         = row.ToString();
            PlaceNumberInput.Text = placeNumber.ToString();
            PriceInput.Text       = price.ToString();
            TicketInput.Text      = (ticketsList.Tickets.Count() + 1).ToString();
        }
Beispiel #9
0
        public void Can_Add_From_Class_Log_Quick_Form()
        {
            // Arrange
            ClassTeacher   teacher  = ClassLogData.GetClassTeacherWithClassAndLearners();
            AuthorisedUser authUser = ClassLogData.GetAuthorisedUserDetailsForClassTeacherUser(TestDefaults.Default.ClassTeacher);

            ClassLogData.UpdateClassTeacherWithInitialAuthUserValues(authUser, TestDefaults.Default.ClassTeacher);
            ClassLogData.UpdateClassTeacherUserWithStaffDetails(teacher, TestDefaults.Default.ClassTeacher);

            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.ClassTeacher, enabledFeatures: ClassLogFeature);

            Wait.WaitForAjaxReady();

            var classLogNavigate = new ClassLogNavigation();

            Wait.WaitForAjaxReady();

            //Act
            classLogNavigate.NavigateToPupilClassLogFromMenu();
            Wait.WaitForAjaxReady();

            ClassLogPage clogPage = new ClassLogPage();

            clogPage.SelectPupil();

            var achievementDialog = clogPage.OpenAchievementPopup();

            var achievementEvent = Queries.GetFirstQuickAchievementEventLookup();

            achievementDialog.AchievementType = achievementEvent.Description;

            // Increment twice and then decrement once to test slider working
            achievementDialog.ClickPointsSliderUp();
            achievementDialog.ClickPointsSliderUp();

            achievementDialog.ClickPointsSliderDown();

            achievementDialog.Comments = "Selenium test event";

            achievementDialog.Save();

            // Assert?
            SeleniumHelper.WaitUntilElementIsDisplayed("//*/div[@class='alert alert-info animated zoomInAndFade' and @role='alert']");
        }
Beispiel #10
0
 public fHalls(AuthorisedUser user, Session session)
 {
     InitializeComponent();
     this.user    = user;
     this.session = session;
     if (user.GetType() == typeof(CashierUser))
     {
         Hall currentHall = session.HallSession;
         sourceData.DataSource                   = currentHall;
         dataGridViewHalls.DataSource            = sourceData;
         dataGridViewHalls.Columns[0].Visible    = false;
         dataGridViewHalls.Columns[1].HeaderText = "Название";
         dataGridViewHalls.Columns[2].HeaderText = "Кол-во мест";
         dataGridViewHalls.Columns[3].HeaderText = "Кол-во мест в ряду";
         dataGridViewHalls.Visible               = false;
         foreach (Control i in this.Controls)
         {
             i.Visible = false;
         }
         HallPlaces.Visible = true;
         ExitButton.Visible = true;
         LoadSchemeOfHall(session.HallSession.SeatingCapacity, session.HallSession.PlacesInRow);
     }
 }