示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (currentAdres == null)
            {
                currentAdres = new MailAdres();
            }

            if (string.IsNullOrEmpty(txtAd.Text) || string.IsNullOrEmpty(txtAdres.Text))
            {
                Utility.Hata("Alanlar boş bırakılamaz!");
                return;
            }

            if (!Regex.IsMatch(txtAdres.Text, @"^([\w\.\-]+)@((?!\.|\-)[\w\-]+)((\.(\w){2,3})+)$"))
            {
                Utility.Hata("Mail adresi formatı hatalı!");
                return;
            }

            currentAdres.Adres       = txtAdres.Text;
            currentAdres.Isim        = txtAd.Text;
            currentAdres.Gonderilsin = chkstatu.Checked;
            currentAdres.Save();
            Temizle();
            Adresler();
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (currentAdres == null)
            {
                currentAdres = new MailAdres();
            }

            if (string.IsNullOrEmpty(txtAd.Text) || string.IsNullOrEmpty(txtAdres.Text))
            {
                Utility.Hata("Alanlar boş bırakılamaz!");
                return;
            }

            if (!Regex.IsMatch(txtAdres.Text, @"^([\w\.\-]+)@((?!\.|\-)[\w\-]+)((\.(\w){2,3})+)$"))
            {
                Utility.Hata("Mail adresi formatı hatalı!");
                return;
            }

            TraceLevel trace = TraceLevel.Off;

            Enum.TryParse <TraceLevel>(cmdtracelavel.Text, out trace);
            AppSettingHelper.Default.tracelavel = trace;
            currentAdres.Adres       = txtAdres.Text;
            currentAdres.Isim        = txtAd.Text;
            currentAdres.Gonderilsin = chkstatu.Checked;
            currentAdres.Save();
            Temizle();
            Adresler();
        }
示例#3
0
 private void Temizle()
 {
     currentAdres     = null;
     txtAd.Text       = "";
     txtAdres.Text    = "";
     chkstatu.Checked = false;
     txtAd.Focus();
 }
示例#4
0
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listView1.SelectedIndices.Count > 0)
     {
         currentAdres = listView1.Items[listView1.SelectedIndices[0]].Tag as MailAdres;
         if (currentAdres != null)
         {
             txtAd.Text       = currentAdres.Isim;
             txtAdres.Text    = currentAdres.Adres;
             chkstatu.Checked = currentAdres.Gonderilsin;
         }
     }
 }