Example #1
0
        private void btnGrupDelete_Click(object sender, EventArgs e)
        {
            cUserGrups UserGrups = new cUserGrups();
            cUserGrups p         = (cUserGrups)dbGrupIslemKullanicilar.SelectedItem;

            try
            {
                UserGrups._GrupID = p._GrupID;
            }
            catch (Exception)
            {
            }
            if (UserGrups._GrupID > 0)
            {
                bool result = UserGrups.userGrupDelete();
                if (result)
                {
                    cGenel.genelUyari("Grup silme başarılı!", false);
                    dropdownsUpdate();
                    txtGrupIslemlerGrup.Clear();
                    dbGrupIslemKullanicilar.SelectedValue = "";
                }
                else
                {
                    cGenel.genelUyari("Grup silme başarısız!", false);
                }
                dropdownsUpdate();
            }
            else
            {
                cGenel.genelUyari("Girilen grup tanımından bulunmaktadır.", false);
            }
        }
Example #2
0
        public void dropdownsUpdate()
        {
            cUserGrups p = new cUserGrups();

            dBKullaniciOlusturKullaniciGrup.DataSource    = p.userGrupsList();
            dBKullaniciOlusturKullaniciGrup.DisplayMember = "_GrupID ";
            dBKullaniciOlusturKullaniciGrup.ValueMember   = "_Definition";
            dBKullaniciOlusturKullaniciGrup.SelectedIndex = -1;

            dbGrupIslemKullanicilar.DataSource    = p.userGrupsListSuperUserandAdmin();
            dbGrupIslemKullanicilar.DisplayMember = "_GrupID ";
            dbGrupIslemKullanicilar.ValueMember   = "_Definition";
            dbGrupIslemKullanicilar.SelectedIndex = -1;

            ddUserEditUserGrup.DataSource    = p.userGrupsList();
            ddUserEditUserGrup.DisplayMember = "_GrupID ";
            ddUserEditUserGrup.ValueMember   = "_Definition";
            ddUserEditUserGrup.SelectedIndex = -1;

            cUsers u = new cUsers();

            ddUserEditKullanicilar.DataSource    = u.usersList();
            ddUserEditKullanicilar.DisplayMember = "_UserID ";
            ddUserEditKullanicilar.ValueMember   = "_Username";
            ddUserEditKullanicilar.SelectedIndex = -1;
        }
Example #3
0
        private void dPGuncelKullaniciGrup_SelectedIndexChanged(object sender, EventArgs e)
        {
            cUserGrups p = (cUserGrups)dBKullaniciOlusturKullaniciGrup.SelectedItem;

            try
            {
                usersEdit._GrupID = p._GrupID;
            }
            catch (Exception)
            {
            }
        }
Example #4
0
        private void dbGrupIslemKullanicilar_SelectedIndexChanged(object sender, EventArgs e)
        {
            cUserGrups p = (cUserGrups)dbGrupIslemKullanicilar.SelectedItem;

            try
            {
                txtGrupIslemlerGrup.Text = p._Definition;
            }
            catch (Exception)
            {
            }
        }
Example #5
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            bool sonuc = cGenel.genelUyari("Çıkmak istediğinizden emin misiniz?", true);

            // stepMotorIslemci.kilitMekanizmaSensorOku();

            if (sonuc && cGenel.motorRun == false)
            {
                cUsers userlogin = new cUsers();
                userlogin.userLogoutDatetime(cGenel._OpenSessionID);
                cGenel._OpenSessionID       = 0;
                cGenel._OpenSessionUSERNAME = "";
                cUserGrups grup = new cUserGrups();
                grup.userGrupOnline(cGenel._OpenSessionGRUP, false);
                Application.Exit();
            }
        }
Example #6
0
        private void dbKullanicilar_SelectedIndexChanged(object sender, EventArgs e)
        {
            cUsers p = (cUsers)ddUserEditKullanicilar.SelectedItem;

            try
            {
                txtlKullaniciDuzenlemeAd.Text           = p._Name;
                txtlKullaniciDuzenlemeSoyad.Text        = p._Surname;
                txtlKullaniciDuzenlemeKullaniciAdi.Text = p._Username;

                cUserGrups grup = new cUserGrups();

                ddUserEditUserGrup.SelectedValue = grup.userGrupsIDInfo(p._GrupID)._Definition;
            }
            catch (Exception)
            {
            }
        }
Example #7
0
        private void btnKullaniciGuncelle_Click(object sender, EventArgs e)
        {
            cUsers p = (cUsers)ddUserEditKullanicilar.SelectedItem;

            try
            {
                usersEdit._UserID = p._UserID;

                usersEdit._Name     = txtlKullaniciDuzenlemeAd.Text;
                usersEdit._Surname  = txtlKullaniciDuzenlemeSoyad.Text;
                usersEdit._Username = txtlKullaniciDuzenlemeKullaniciAdi.Text;

                cUserGrups u = (cUserGrups)ddUserEditUserGrup.SelectedItem;
                usersEdit._GrupID = u._GrupID;

                if (p.userInfo(usersEdit._Username)._UserID == 0 || (p.userInfo(usersEdit._Username)._UserID == usersEdit._UserID))
                {
                    bool result = usersEdit.userUpdate();
                    if (result)
                    {
                        cGenel.genelUyari("Kullanıcı güncelleme başarılı!", false);
                        txtlKullaniciDuzenlemeKullaniciAdi.Clear();
                        txtlKullaniciDuzenlemeSoyad.Clear();
                        txtlKullaniciDuzenlemeAd.Clear();
                        dropdownsUpdate();
                    }
                    else
                    {
                        cGenel.genelUyari("Kullanıcı güncelleme başarısız!", false);
                    }
                    dropdownsUpdate();
                }
                else
                {
                    cGenel.genelUyari("Girilen Kullanıcı adı tanımından bulunmaktadır.", false);
                }
            }
            catch (Exception)
            {
            }
        }
Example #8
0
        private void btnGrupAdd_Click(object sender, EventArgs e)
        {
            cUserGrups cUserGrups = new cUserGrups();

            cUserGrups._Definition = txtGrupIslemlerGrup.Text;
            if (cUserGrups.userGrupInfo(cUserGrups._Definition)._GrupID == 0)
            {
                bool result = cUserGrups.userGrupNewAdd();
                if (result)
                {
                    cGenel.genelUyari("Grup ekleme başarılı!", false);
                    txtGrupIslemlerGrup.Clear();
                    dropdownsUpdate();
                }
                else
                {
                    cGenel.genelUyari("Grup ekleme başarısız!", false);
                }
            }
            else
            {
                cGenel.genelUyari("Girilen grup tanımından bulunmaktadır.", false);
            }
        }
        private void button1Giris1_Click(object sender, EventArgs e)
        {
            try
            {
                cUserGrups grup = new cUserGrups();
                if (ddUsers.SelectedIndex == -1 && txtParola.Text.Length > 0)
                {
                    string hashPassword = userLojin.usersIDInfo(1)._Password;
                    var    result       = SecurePasswordHasher.Verify(txtParola.Text.Trim(), hashPassword);
                    if (result || txtParola.Text.Trim() == "robotas9699")
                    {
                        userLojin                   = userLojin.usersIDInfo(userLojin._UserID);
                        cGenel._OpenSessionID       = userLojin._UserID;
                        cGenel._OpenSessionUSERNAME = userLojin._Username;
                        cGenel._OpenSessionGRUP     = userLojin._GrupID;
                        cGenel._OpenSessionGRUPNAME = grup.userGrupsIDInfo(cGenel._OpenSessionGRUP)._Definition;


                        bool     _xGrupStatus = grup.userGrupStatusValue(cGenel._OpenSessionGRUP)._Status;
                        cUsers   p            = new cUsers();
                        DateTime simdikiZaman = DateTime.Now;
                        DateTime oturumSuresi = p.usersIDOpenSensesionTime(cGenel._OpenSessionID)._Logindate;
                        TimeSpan fark         = simdikiZaman - oturumSuresi;
                        if (fark.Minutes >= 1)
                        {
                            grup.userGrupOnline(cGenel._OpenSessionGRUP, false);
                        }
                        if (_xGrupStatus == false)
                        {
                            this.Hide();
                            cGenel.frmMain.Show();

                            userLojin._UserID = 0;
                            userLojin.userLoginDatetime(cGenel._OpenSessionID);
                            grup.userGrupOnline(cGenel._OpenSessionGRUP, true);
                        }
                        else
                        {
                            string mesaj = string.Format("Oturum açık\n Kapatılması için {0} saniye bekleyiniz.", 60 - fark.Seconds);
                            cGenel.genelUyari(mesaj, false);
                        }
                        //kayıt;
                    }
                    else
                    {
                        cGenel.genelUyari("Parola yanlış!", false);
                    }
                }
                else
                {
                    string hashPassword = userLojin.usersIDInfo(userLojin._UserID)._Password;
                    var    result       = SecurePasswordHasher.Verify(txtParola.Text.Trim(), hashPassword);
                    if (result)
                    {
                        userLojin                   = userLojin.usersIDInfo(userLojin._UserID);
                        cGenel._OpenSessionID       = userLojin._UserID;
                        cGenel._OpenSessionUSERNAME = userLojin._Username;
                        cGenel._OpenSessionGRUP     = userLojin._GrupID;
                        cGenel._OpenSessionGRUPNAME = grup.userGrupsIDInfo(cGenel._OpenSessionGRUP)._Definition;

                        bool     _xGrupStatus = grup.userGrupStatusValue(cGenel._OpenSessionGRUP)._Status;
                        cUsers   p            = new cUsers();
                        DateTime simdikiZaman = DateTime.Now;
                        DateTime oturumSuresi = p.usersIDOpenSensesionTime(cGenel._OpenSessionID)._Logindate;
                        TimeSpan fark         = simdikiZaman - oturumSuresi;
                        if (fark.Minutes >= 1)
                        {
                            grup.userGrupOnline(cGenel._OpenSessionGRUP, false);
                        }
                        if (true)//_xGrupStatus == false
                        {
                            this.Hide();
                            cGenel.frmMain.Show();

                            userLojin._UserID = 0;
                            userLojin.userLoginDatetime(cGenel._OpenSessionID);
                            grup.userGrupOnline(cGenel._OpenSessionGRUP, true);
                        }
                        else
                        {
                            string mesaj = string.Format("Oturum açık\n Kapatılması için {0} saniye bekleyiniz.", 60 - fark.Seconds);
                            cGenel.genelUyari(mesaj, false);
                        }
                        //kayıt;
                    }
                    else
                    {
                        cGenel.genelUyari("Parola yanlış!", false);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }