Beispiel #1
0
 private void InitHandlers()
 {
     Observable.FromEventPattern <ScrolledEventArgs>(
         h => MainLst.Scrolled += h,
         h => MainLst.Scrolled -= h)
     .Select(x => x.EventArgs)
     .Subscribe(async _ =>
                await Task.Run(() =>
     {
         if (_previousY < _.ScrollY)
         {
             Device.BeginInvokeOnMainThread(() => CreateBtn.Hide());
         }
         else if (_previousY > _.ScrollY)
         {
             Device.BeginInvokeOnMainThread(() => CreateBtn.Show());
         }
         _previousY = _.ScrollY;
     })
                );
     this.WhenAnyValue(x => x.DayPicker.SelectedDate)
     .Where(x => !_action.IsNullOrEmptyOrWhiteSpace() &&
            _action != TranslationCodeExtension.GetTranslation("CancelAction") &&
            x.HasValue)
     .Select(x => x.Value)
     .Subscribe(_ =>
     {
         DayPicker.Date = DateTime.Today;
         ViewModel.AddDayExecute(_, _action);
     });
     CreateBtn.Clicked = async(s, e) => await CreateDayExecute();
 }
Beispiel #2
0
        private void EmployeesBtn_Click(object sender, EventArgs e)
        {
            Key = 1;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            JobTitlesbtn.Enabled   = true;
            DepartmentsBtn.Enabled = true;
            OfficesBtn.Enabled     = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Show();
            UpdateBtn.Enabled = false;
            DeleteBtn.Show();
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select p.id_pracownika as ID, p.imie as Imie, p.nazwisko as Nazwisko,  s.nazwa as Stanowisko, d.nazwa_dzialu as 'Nazwa działu', si.nazwa_siedziby as Siedziba, si.adres as Adres" +
                         " from PRACOWNICY p join DZIALY d on p.id_dzialu=d.id_dzialu join STANOWISKA s on p.id_stanowiska=s.id_stanowiska join SIEDZIBY si on d.id_siedziby=si.id_siedziby;";

            LoadDataToSqldataGridView("Pracownicy", sql);
            EmployeesBtn.Enabled = false;
        }
Beispiel #3
0
        private void DepartmentsBtn_Click(object sender, EventArgs e)
        {
            Key = 4;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled = true;
            JobTitlesbtn.Enabled = true;
            OfficesBtn.Enabled   = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select d.nazwa_dzialu, s.nazwa_siedziby, s.adres from DZIALY d join SIEDZIBY s on  d.id_siedziby=s.id_siedziby ";

            LoadDataToSqldataGridView("Dzialy", sql);
            DepartmentsBtn.Enabled = false;
        }
Beispiel #4
0
        private void OfficesBtn_Click(object sender, EventArgs e)
        {
            Key = 3;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled   = true;
            JobTitlesbtn.Enabled   = true;
            DepartmentsBtn.Enabled = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select id_siedziby as ID ,nazwa_siedziby as Oddział, adres as Adres from SIEDZIBY ";

            LoadDataToSqldataGridView("Siedziby", sql);
            OfficesBtn.Enabled = false;
        }
Beispiel #5
0
        private void JobTitlesbtn_Click(object sender, EventArgs e)
        {
            Key = 2;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled   = true;
            OfficesBtn.Enabled     = true;
            DepartmentsBtn.Enabled = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select id_stanowiska, nazwa as Stanowisko from STANOWISKA ";

            LoadDataToSqldataGridView("Stanowiska", sql);
            JobTitlesbtn.Enabled = false;
        }