Esempio n. 1
0
    protected void KayitSil(object sender, EventArgs e)
    {
        if (Class.Fonksiyonlar.Admin.Kullanici.Kontroller.Root(Class.Fonksiyonlar.Admin.Genel.AdminID()))
        {
            if (((Ext.Net.AfterRecordDeletedEventArgs)(e)).Keys["id"].ToString() != null)
            {
                if (((Ext.Net.AfterRecordDeletedEventArgs)(e)).Keys["id"].ToString().Trim() != "")
                {
                    using (BaglantiCumlesi SME = new BaglantiCumlesi())
                    {
                        int          PID = int.Parse(((Ext.Net.AfterRecordDeletedEventArgs)(e)).Keys["id"].ToString().Trim());
                        tbl_adminler ta  = (from p in SME.tbl_adminler where p.id == PID select p).FirstOrDefault();

                        if (!ta.root)
                        {
                            SME.DeleteObject(ta);

                            #region Admin İşlem Log
                            Class.Fonksiyonlar.Admin.Log.Islemler(Class.Fonksiyonlar.Admin.Genel.AdminID(), ((EntityObject)(ta)).EntityKey.EntitySetName.ToString(), ta.id, (int)Class.Sabitler.AdminLog.Islemler.Delete);
                            #endregion

                            SME.SaveChanges();
                        }
                    }
                }
            }

            Store1.DataBind();
        }
        else
        {
            Class.Fonksiyonlar.ExtJS.MesajKutusu(Icon.Error, MessageBox.Icon.ERROR, "İşlem başarısız", "Yönetici silme işlemini yalnızca Root yönetici yapabilir.");
        }
    }
Esempio n. 2
0
    protected void SecilenleriSil(object sender, EventArgs e)
    {
        if (Class.Fonksiyonlar.Admin.Kullanici.Kontroller.Root(Class.Fonksiyonlar.Admin.Genel.AdminID()))
        {
            if (RSM.SelectedRows.Count > 0)
            {
                for (int i = 0; i < RSM.SelectedRows.Count; i++)
                {
                    using (BaglantiCumlesi SME = new BaglantiCumlesi())
                    {
                        int          PID = int.Parse(RSM.SelectedRows[i].RecordID);
                        tbl_adminler ta  = (from p in SME.tbl_adminler where p.id == PID select p).FirstOrDefault();

                        if (!ta.root)
                        {
                            SME.DeleteObject(ta);
                        }

                        #region Admin İşlem Log
                        Class.Fonksiyonlar.Admin.Log.Islemler(Class.Fonksiyonlar.Admin.Genel.AdminID(), ((EntityObject)(ta)).EntityKey.EntitySetName.ToString(), ta.id, (int)Class.Sabitler.AdminLog.Islemler.Delete);
                        #endregion

                        SME.SaveChanges();
                    }
                }
            }

            RSM.ClearSelections();
            Store1.DataBind();
        }
        else
        {
            Class.Fonksiyonlar.ExtJS.MesajKutusu(Icon.Error, MessageBox.Icon.ERROR, "İşlem başarısız", "Yönetici silme işlemini yalnızca Root yönetici yapabilir.");
        }
    }
Esempio n. 3
0
    protected void GuncellemeYap(object sender, DirectEventArgs e)
    {
        bool Guncelle = false;

        #region Onay Boolean Çevirme
        bool   OnayBool = false;
        string CO       = Class.Fonksiyonlar.Genel.SQLTemizle(Duzenle_ComboBoxOnay.Value.ToString().Trim());
        if (CO == "1")
        {
            OnayBool = true;
        }
        #endregion

        if (Duzenle_TextFieldKullaniciAdi.Text.Trim() != Duzenle_EskiKullaniciAdi.Text.Trim())
        {
            if (Class.Fonksiyonlar.Admin.Kullanici.Kontroller.KullaniciAdi(Duzenle_TextFieldKullaniciAdi.Text.Trim()))
            {
                KullaniciAdiVarMesaji();
                return;
            }
            else
            {
                Guncelle = true;
            }
        }
        else
        {
            Guncelle = true;
        }

        if (Guncelle)
        {
            using (BaglantiCumlesi SME = new BaglantiCumlesi())
            {
                int          PID = int.Parse(Duzenle_ID.Text.Trim());
                tbl_adminler ta  = (from p in SME.tbl_adminler where p.id == PID select p).FirstOrDefault();
                ta.ad_soyad = Class.Fonksiyonlar.Genel.SQLTemizle(Duzenle_TextFieldAdiSoyadi.Text.Trim());

                if (Convert.ToBoolean(Duzenle_Checbox.Value.ToString()))
                {
                    ta.sifre = Class.Fonksiyonlar.Genel.Sifrele(Duzenle_TextFieldSifre.Text.Trim());
                }

                ta.onay         = OnayBool;
                ta.admin_id_gun = Class.Fonksiyonlar.Admin.Genel.AdminID();
                SME.SaveChanges();

                #region Admin İşlem Log
                Class.Fonksiyonlar.Admin.Log.Islemler(Class.Fonksiyonlar.Admin.Genel.AdminID(), ((EntityObject)(ta)).EntityKey.EntitySetName.ToString(), ta.id, (int)Class.Sabitler.AdminLog.Islemler.Update);
                #endregion
            }
        }

        RSM.ClearSelections();
        Store1.DataBind();

        WindowDuzenle.Hide();
    }
Esempio n. 4
0
    protected void YeniKayitYap(object sender, DirectEventArgs e)
    {
        if (Class.Fonksiyonlar.Admin.Kullanici.Kontroller.KullaniciAdi(Ekle_TextFieldKullaniciAdi.Text.Trim()))
        {
            KullaniciAdiVarMesaji();
            return;
        }
        else
        {
            using (BaglantiCumlesi SME = new BaglantiCumlesi())
            {
                #region Onay Boolean Çevirme
                bool   OnayBool = false;
                string CO       = Class.Fonksiyonlar.Genel.SQLTemizle(Ekle_ComboBoxOnay.Value.ToString().Trim());
                if (CO == "1")
                {
                    OnayBool = true;
                }
                #endregion

                tbl_adminler ta = new tbl_adminler();
                ta.ad_soyad      = Class.Fonksiyonlar.Genel.SQLTemizle(Ekle_TextFieldAdiSoyadi.Text.Trim());
                ta.kullanici_adi = Class.Fonksiyonlar.Genel.SQLTemizle(Ekle_TextFieldKullaniciAdi.Text.Trim());
                ta.sifre         = Class.Fonksiyonlar.Genel.Sifrele(Ekle_TextFieldSifre.Text.Trim());
                ta.admin_id_ek   = Class.Fonksiyonlar.Admin.Genel.AdminID();
                ta.onay          = OnayBool;
                SME.AddTotbl_adminler(ta);
                SME.SaveChanges();

                #region Admin İşlem Log
                Class.Fonksiyonlar.Admin.Log.Islemler(Class.Fonksiyonlar.Admin.Genel.AdminID(), ((EntityObject)(ta)).EntityKey.EntitySetName.ToString(), ta.id, (int)Class.Sabitler.AdminLog.Islemler.Insert);
                #endregion
            }
        }

        RSM.ClearSelections();
        Store1.DataBind();

        WindowEkle.Hide();
    }
Esempio n. 5
0
    public void OnayVer(int ID)
    {
        if (ID == -1)
        {
            if (RSM.SelectedRows.Count > 0)
            {
                for (int i = 0; i < RSM.SelectedRows.Count; i++)
                {
                    using (BaglantiCumlesi SME = new BaglantiCumlesi())
                    {
                        int          PID = int.Parse(RSM.SelectedRows[i].RecordID);
                        tbl_adminler ta  = (from p in SME.tbl_adminler where p.id == PID select p).FirstOrDefault();

                        if (!ta.onay)
                        {
                            ta.onay = true;
                        }

                        ta.admin_id_gun = Class.Fonksiyonlar.Admin.Genel.AdminID();

                        #region Seçilen Kayıt Root Birine mi Ait?
                        if (ta.root)
                        {
                            #region Seçilen Kaydı Açan Root İse
                            if (Class.Fonksiyonlar.Admin.Kullanici.Kontroller.Root(Class.Fonksiyonlar.Admin.Genel.AdminID()))
                            {
                                SME.SaveChanges();
                            }
                            #endregion
                        }
                        else
                        {
                            SME.SaveChanges();
                        }
                        #endregion

                        #region Admin İşlem Log
                        Class.Fonksiyonlar.Admin.Log.Islemler(Class.Fonksiyonlar.Admin.Genel.AdminID(), ((EntityObject)(ta)).EntityKey.EntitySetName.ToString(), ta.id, (int)Class.Sabitler.AdminLog.Islemler.Update);
                        #endregion
                    }
                }
            }
        }
        else
        {
            using (BaglantiCumlesi SME = new BaglantiCumlesi())
            {
                tbl_adminler ta = (from p in SME.tbl_adminler where p.id == ID select p).FirstOrDefault();

                if (!ta.onay)
                {
                    ta.onay = true;
                }

                ta.admin_id_gun = Class.Fonksiyonlar.Admin.Genel.AdminID();

                #region Seçilen Kayıt Root Birine mi Ait?
                if (ta.root)
                {
                    #region Seçilen Kaydı Açan Root İse
                    if (Class.Fonksiyonlar.Admin.Kullanici.Kontroller.Root(Class.Fonksiyonlar.Admin.Genel.AdminID()))
                    {
                        SME.SaveChanges();
                    }
                    #endregion
                }
                else
                {
                    SME.SaveChanges();
                }
                #endregion

                #region Admin İşlem Log
                Class.Fonksiyonlar.Admin.Log.Islemler(Class.Fonksiyonlar.Admin.Genel.AdminID(), ((EntityObject)(ta)).EntityKey.EntitySetName.ToString(), ta.id, (int)Class.Sabitler.AdminLog.Islemler.Update);
                #endregion
            }
        }

        RSM.ClearSelections();
        Store1.DataBind();
    }