private void btn_Giris_Click(object sender, EventArgs e) { Boolean login = false; if (txtKullaniciAdi.Text.Trim() == "") { return; } if (txtSifre.Text.Trim() == "") { return; } //Eğer güvenli mod girişi var ise if ((txtKullaniciAdi.Text.ToString().Trim() == GlobalData.modUser) && (txtSifre.Text.ToString().Trim() == GlobalData.modPass)) { cmbSunucu.Enabled = true; MessageBox.Show("Günveli mod aktif edildi", "BİLGİ"); txtKullaniciAdi.Text = ""; txtSifre.Text = ""; Utility.selectText(txtKullaniciAdi); return; } Utility.setSunucu(cmbSunucu.Text); GlobalData.sunucuTip = cmbSunucu.Text; Cursor.Current = Cursors.WaitCursor; System.Net.NetworkCredential nc = new System.Net.NetworkCredential(txtKullaniciAdi.Text.Trim(), txtSifre.Text.Trim()); WS_Login.ZKT_WM_WS_LOGIN srv = new KoctasWM_Project.WS_Login.ZKT_WM_WS_LOGIN(); WS_Login.ZKT_WM_LOGIN chk = new KoctasWM_Project.WS_Login.ZKT_WM_LOGIN(); WS_Login.ZKMOBIL_RETURN[] ret = new KoctasWM_Project.WS_Login.ZKMOBIL_RETURN[1]; WS_Login.ZKT_WM_LOGINResponse resp = new KoctasWM_Project.WS_Login.ZKT_WM_LOGINResponse(); ret[0] = new KoctasWM_Project.WS_Login.ZKMOBIL_RETURN(); chk.T_RETURN = ret; resp.T_RETURN = ret; srv.Credentials = nc; srv.Url = Utility.getWsUrlForWM("zkt_wm_ws_login"); try { resp = srv.ZKT_WM_LOGIN(chk); if (resp.T_RETURN.Length > 0 && resp.T_RETURN[0].RC_CODE.ToUpper() == "S") { login = true; } else { login = false; } } catch (Exception ex) { if (ex.Message == "WebException") { MessageBox.Show("Kullanıcı adı / Şifre hatalı.", "Giriş Başarısız!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); } else { MessageBox.Show(ex.Message, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); } login = false; } finally { Cursor.Current = Cursors.Default; } if (login) { //Global değişkenler set ediliyor GlobalData.globalCr = nc; GlobalData.kullaniciAdi = txtKullaniciAdi.Text.Trim(); frm_Menu frm = new frm_Menu(); //TIME_ZONE_INFORMATION tzI = new TIME_ZONE_INFORMATION(); //GetTimeZoneInformation(ref tzI); //tzI.Bias = -120; //SetTimeZoneInformation(ref tzI); DateTime to_set = Convert.ToDateTime(resp.E_TARIH + " " + resp.E_SAAT.Hour.ToString() + ':' + resp.E_SAAT.Minute.ToString()); to_set -= new TimeSpan(2, 0, 0); SetCurrentDate(to_set); frm.ShowDialog(); if (frm.DialogResult == DialogResult.Abort) { this.Close(); this.Dispose(); } } else { Cursor.Current = Cursors.Default; } }