示例#1
0
        private void frmGirisEkrani_Load(object sender, EventArgs e)
        {
            try
            {
                string sonuc = Baglanti.Baglanti_Dene(Baglanti.ServerAdres, Baglanti.VeritabaniAdi, Baglanti.KullaniciAdi, Baglanti.KullaniciSifre);
                if (sonuc != "Olumlu")
                {
                    XtraMessageBox.Show("Veritaban Bağlantı Hatası.\nAyarlar Sayfasına Yönlendirileceksiniz.\n\nHata:\n" + sonuc, "Veritabanı Hatası",
                                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Ac_Ayarlar();
                    return;
                }

                Genel.Al_Verileri(true);

                lookUpSirketler.Properties.DisplayMember = "KisaAd";
                lookUpSirketler.Properties.ValueMember   = "SirketID";
                lookUpSirketler.Properties.DataSource    = Araclar.Veri.Ekle_Lutfen(Isler.Sirket.Ver_Sirketler(true), "KisaAd", "SirketID");

                Temizle();
            }
            catch (Exception hata)
            {
                XtraMessageBox.Show(hata.Message);
            }

            //txtKullaniciAdi.Text = "ismail";
            //txtKullaniciSifre.Text = "353419";
            //btnTamam.PerformClick();
        }
示例#2
0
        static void Main()
        {
            try
            {
                #region < Devexpress Ayarları >
                //MessageBox.Show("1");
                Araclar.Sifreleme.Key     = new byte[] { 221, 129, 5, 240, 31, 67, 179, 18, 54, 123, 38, 33, 78, 145, 99, 168, 137, 4, 252, 92, 74, 25, 89, 62, 57, 73, 194, 205, 216, 164, 23, 234 };
                Araclar.Sifreleme.Vector  = new byte[] { 28, 91, 66, 111, 32, 35, 124, 119, 231, 29, 221, 112, 79, 32, 111, 210 };
                Araclar.ZipDosya.SifreStr = "i1k341578Q";
                //MessageBox.Show("2");

                try
                {
                    if (!File.Exists(Application.StartupPath + @"\ayarlar.xml"))
                    {
                        MessageBox.Show("Program Dizininde Olması Gereken 'ayarlar.xml' Dosyası Bulunamadı.", "Dosya Yok",
                                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        Application.Exit();
                    }
                    //MessageBox.Show("3");
                    Sistem.Ayarlar.Oku();
                    // MessageBox.Show("4");
                }
                catch (Exception hata)
                {
                    MessageBox.Show("Program Dizinindeki 'ayarlar.xml' Dosyası Okunurken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Application.Exit();
                }
                // MessageBox.Show("5");
                DevExpress.Skins.SkinManager.Default.RegisterAssembly(typeof(DevExpress.UserSkins.SiyahYesil).Assembly);
                DevExpress.UserSkins.BonusSkins.Register(); //Bonus temalar açılıyor.
                //DevExpress.UserSkins.OfficeSkins.Register();
                // MessageBox.Show("7");
                DevExpress.Skins.SkinManager.EnableFormSkins(); //Formları da temalı gösterir.
                // MessageBox.Show("8");
                DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(Sistem.Ayarlar.TemaAdi);
                DevExpress.LookAndFeel.UserLookAndFeel.Default.StyleChanged += new EventHandler(Default_StyleChanged);
                Genel.AyarCek();
                #endregion

                #region < Standart >
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frmGirisEkrani());
                #endregion
            }
            catch (Exception hata)
            {
                MessageBox.Show(hata.Message);
            }
        }
示例#3
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                string dbVersiyon = Isler.Genelparam.Ver_ParamKarsilik(4).ToString();
                Araclar.Sistem.VersiyonKiyasla KiyasSonuc = Araclar.Sistem.Versiyon_Kiyasla(dbVersiyon, Araclar.Sistem.VersiyonBilgisi);
                if (KiyasSonuc == Araclar.Sistem.VersiyonKiyasla.SagBuyuk)
                {
                    XtraMessageBox.Show("Kullanmış Olduğunuz Veritabanı Versiyonu Eski.\n\nLütfen Veritabanınızı Güncelleyiniz."
                                        + "\n\nKullandığınız Versiyon: " + Araclar.Sistem.VersiyonBilgisi
                                        + "\nVeritabanı Versiyonu : " + dbVersiyon, "Versiyon Hatası",
                                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    GirisOlumlu = false;
                    return;
                }
                else if (KiyasSonuc == Araclar.Sistem.VersiyonKiyasla.SolBuyuk)
                {
                    if (XtraMessageBox.Show("Sistem Güncellemesi Algılandı.\n\nŞimdi Güncelleme Yapmak İster Misiniz?"
                                            + "\n\nKullandığınız Versiyon: " + Araclar.Sistem.VersiyonBilgisi
                                            + "\nGüncel Versiyon : " + dbVersiyon, "Versiyon Güncelle",
                                            MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start(Application.StartupPath + @"\ClientVersiyonGuncelle.exe");
                        Application.Exit();
                    }
                    GirisOlumlu = false;
                    return;
                }

                if (Genel.AktifKullanici != null && Genel.AktifKullanici.EntityState != EntityState.Detached)
                {
                    Genel.dbModel.Detach(Genel.AktifKullanici);
                }
                Genel.AktifKullanici = null;
                Genel.AktifKullanici = Isler.Kullanici.Ver_Kullanici(ref Genel.dbModel, Araclar.Sifreleme.EncryptToString(txtKullaniciAdi.Text));

                //Sisteme Giriş Yetkisi Var Mı?:
                if (!Isler.Yetki.Varmi_Yetki(1))
                {
                    GirisOlumlu = false;
                    return;
                }

                if (Genel.AktifSirket != null && Genel.AktifSirket.EntityState != EntityState.Detached)
                {
                    Genel.dbModel.Detach(Genel.AktifSirket);
                }
                Genel.AktifSirket = null;
                Genel.AktifSirket = Isler.Sirket.Ver_Sirket(ref Genel.dbModel, Convert.ToInt32(lookUpSirketler.EditValue));

                Genel.AktifDepo = Isler.Stok.Ver_Depo(ref Genel.dbModel, 1);

                Genel.Al_Verileri(false);

                //frmAna ana = new frmAna();

                //Genel.AnaEkran = ana;
                //Genel.GirisEkran = this;
                //Genel.SistemeGirisSaat = DateTime.Now;

                GirisOlumlu = true;
            }
            catch (Exception hata)
            {
                XtraMessageBox.Show("Veriler Alınırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }