public UserDisplayViewModel()
 {
     _key             = "";
     _isFocused       = true;
     _paging          = new PagingWPF();
     userAddDialog    = new UserAddDialog();
     userUpdateDialog = new UserUpdateDialog();
     currentWindow    = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();
 }
Esempio n. 2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            bool?nullable = new UserAddDialog().ShowDialog();
            bool flag     = true;

            if ((nullable.GetValueOrDefault() == flag ? (nullable.HasValue ? 1 : 0) : 0) == 0)
            {
                return;
            }
            this.RefreshData();
        }
Esempio n. 3
0
        private void EditUser(UserModel user)
        {
            bool?nullable = new UserAddDialog()
            {
                UserId = user.UserId
            }.ShowDialog();
            bool flag = true;

            if ((nullable.GetValueOrDefault() == flag ? (nullable.HasValue ? 1 : 0) : 0) == 0)
            {
                return;
            }
            this.RefreshData();
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            var db  = new saglikDBEntities_1();
            int uye = db.kullanicilar.Count();

            if (uye == 0)
            {
                MessageBox.Show("Veritabanında kayıtlı üye yok\n" +
                                "Yönetici Seviyesinde kullanıcı hesabı oluşturulmak üzere yeni bir forma yönlendirileceksiniz\n"
                                , "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                UserAddDialog frm = new UserAddDialog();
                Hide();
                DialogResult res = frm.ShowDialog();
                Show();
                if (res == DialogResult.OK)
                {
                    form = new MainForm(frm.aktifKullanıcı);
                    göster();
                }

                return;
            }

            var kullanıcı = db.kullanicilar.FirstOrDefault(a =>
                                                           a.username == materialSingleLineTextField1.Text.Trim() &&
                                                           a.sifre == materialSingleLineTextField2.Text.Trim());

            if (kullanıcı == null)
            {
                MessageBox.Show("Kullanıcı Adı veya Şifre hatalı!", "Uyarı", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            db.Entry(kullanıcı).State = EntityState.Detached;
            form = new MainForm(kullanıcı);
            göster();
        }
Esempio n. 5
0
 private async void AddNew_Click(object sender, RoutedEventArgs e)
 {
     UserAddDialog uad = new UserAddDialog(Accounts);
     await uad.ShowAsync();
 }