Пример #1
0
 protected void btnGuncelle_Click(object sender, EventArgs e)
 {
     if (txtTCNo.Text.Length == 11)
     {
         if (!string.IsNullOrEmpty(txtTCNo.Text) & !string.IsNullOrEmpty(txtAdi.Text) & !string.IsNullOrEmpty(txtSoyadi.Text) & !string.IsNullOrEmpty(txtCepNo.Text) & !string.IsNullOrEmpty(txtAdres.Text))
         {
             EMembers guncellenecek = new EMembers();
             guncellenecek.ID        = int.Parse(Request.QueryString["memberID"]);
             guncellenecek.TCNo      = txtTCNo.Text;
             guncellenecek.FirstName = txtAdi.Text;
             guncellenecek.LastName  = txtSoyadi.Text;
             guncellenecek.Phone     = txtCepNo.Text;
             guncellenecek.Address   = txtAdres.Text;
             bool sonuc = BLLMembers.Update(guncellenecek);
             if (sonuc)
             {
                 Response.Write("<script>alert('Harika! Güncellendi!');</script>");
                 Response.Redirect("Uyeler.aspx?scs=1");
             }
             else
             {
                 Response.Write("<script>alert('Hay Aksi! Hata Oluştu!')</script>");
             }
         }
         else
         {
             Response.Write("<script>alert('Eksik bilgi girdiniz. Lütfen kontrol ediniz!')</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('TC kimlik numarası 11 hane olmalıdır!')</script>");
     }
 }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["ID"] != null)
            {
                EMembers member = new EMembers();
                member.ID = int.Parse(Request.QueryString["ID"]);
                bool sonuc = BLLMembers.Delete(member);
                if (sonuc)
                {
                    Response.Write("<script>alert('Harika! Silindi!')</script>");
                }
                else
                {
                    Response.Write("<script>alert('Hay Aksi! Silinemedi!')</script>");
                }
            }

            rptUyeler.DataSource = BLLMembers.GetAll();
            rptUyeler.DataBind();

            if (Request.QueryString["scs"] != null)
            {
                int scsID = Convert.ToInt32(Request.QueryString["scs"].ToString());
                if (scsID == 1)
                {
                    Response.Write("<script>alert('Harika! Güncellendi!');</script>");
                }
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List <EBooks> bookList = BLLBooks.GetBookNames();
                if (bookList != null && bookList.Count > 0)
                {
                    bookList = (from l in bookList
                                where l.IsReturned == false
                                select l).ToList <EBooks>();
                }

                cmbVerilenKitap.DataSource     = bookList;
                cmbVerilenKitap.DataTextField  = "Name";
                cmbVerilenKitap.DataValueField = "ID";
                cmbVerilenKitap.ClearSelection();
                cmbVerilenKitap.DataBind();

                cmbMembers.DataSource     = BLLMembers.GetMemberNames();
                cmbMembers.DataTextField  = "FullName";
                cmbMembers.DataValueField = "ID";
                cmbMembers.ClearSelection();
                cmbMembers.DataBind();

                cmbEmployees.DataSource     = BLLEmployees.GetEmployeeNames();
                cmbEmployees.DataTextField  = "FullName";
                cmbEmployees.DataValueField = "ID";
                cmbEmployees.ClearSelection();
                cmbEmployees.DataBind();
            }
        }
Пример #4
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            EMembers silinecekMember = (EMembers)dataGridView1.SelectedRows[0].DataBoundItem;

            if (silinecekMember != null)
            {
                DialogResult result = MessageBox.Show("Silmek istediğinize emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    EMembers member = new EMembers();
                    member.ID = silinecekMember.ID;

                    bool sonuc = BLLMembers.Delete(member);
                    if (sonuc)
                    {
                        MessageBox.Show("Silme işleminiz başarıyla tamamlanmıştır.");
                        dataGridView1.DataSource = BLLMembers.GetAll();
                    }
                    else
                    {
                        MessageBox.Show("Bir hata oluştu!");
                    }
                }
            }
            else
            {
                MessageBox.Show("Lütfen silmek istediğiniz üyeyi seçiniz!");
            }
        }
Пример #5
0
        protected void btnKaydet_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtTCNo.Text) & !string.IsNullOrEmpty(txtAdi.Text) & !string.IsNullOrEmpty(txtSoyadi.Text) & !string.IsNullOrEmpty(txtCepNo.Text) & !string.IsNullOrEmpty(txtAdres.Text))
            {
                if (txtTCNo.Text.Length == 11)
                {
                    List <EMembers> memberList = BLLMembers.GetAll();

                    memberList = (from l in memberList
                                  where l.TCNo.Trim().ToLower().Equals(txtTCNo.Text.Trim().ToLower())
                                  select l).ToList();
                    if (memberList.Count == 0)
                    {
                        EMembers member = new EMembers();
                        member.TCNo      = txtTCNo.Text;
                        member.FirstName = txtAdi.Text;
                        member.LastName  = txtSoyadi.Text;
                        member.Phone     = txtCepNo.Text;
                        member.Address   = txtAdres.Text;

                        if (BLLMembers.InsertNewMember(member))
                        {
                            Response.Write("<script>alert('Üye kayıt işleminiz başarıyla gerçekleşmiştir.')</script>");
                        }
                        else
                        {
                            Response.Write("<script>alert('Hata Oluştu!')</script>");
                        }
                    }
                    else
                    {
                        Response.Write("<script>alert('Kaydetmek istediğiniz üye zaten kayıtlı!')</script>");
                    }

                    txtTCNo.Text   = String.Empty;
                    txtAdi.Text    = String.Empty;
                    txtSoyadi.Text = String.Empty;
                    txtCepNo.Text  = String.Empty;
                    txtAdres.Text  = String.Empty;
                    txtTCNo.Focus();
                }
                else
                {
                    Response.Write("<script>alert('TC Kimlik Numarası 11 hane olmalıdır!')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('Eksik bilgi girdiniz. Lütfen kontrol ediniz!')</script>");
            }
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int memberID = Convert.ToInt32(Request.QueryString["memberID"].ToString());

                EMembers member = new EMembers();
                member         = BLLMembers.GetIdOnly(memberID);
                txtAdi.Text    = member.FirstName;
                txtSoyadi.Text = member.LastName;
                txtTCNo.Text   = member.TCNo;
                txtCepNo.Text  = member.Phone;
                txtAdres.Text  = member.Address;
            }
        }
Пример #7
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtAd.Text) & !string.IsNullOrEmpty(txtSoyad.Text) & !string.IsNullOrEmpty(txtTCNo.Text) & !string.IsNullOrEmpty(txtCepNo.Text) & !string.IsNullOrEmpty(txtAdres.Text))
            {
                if (txtTCNo.Text.Length == 11)
                {
                    List <EMembers> memberList = BLLMembers.GetAll();
                    memberList = (from l in memberList
                                  where l.TCNo.Trim().ToLower().Equals(txtTCNo.Text.Trim().ToLower())
                                  select l).ToList();

                    if (memberList.Count == 0)
                    {
                        EMembers member = new EMembers();
                        member.TCNo      = txtTCNo.Text;
                        member.FirstName = txtAd.Text;
                        member.LastName  = txtSoyad.Text;
                        member.Phone     = txtCepNo.Text;
                        member.Address   = txtAdres.Text;

                        bool sonuc = BLLMembers.InsertNewMember(member);
                        if (sonuc)
                        {
                            MessageBox.Show("Yeni üye kaydı başarıyla tamamlanmıştır!");
                            dataGridView1.DataSource = BLLMembers.GetAll();
                            Clear();
                        }
                        else
                        {
                            MessageBox.Show("Bir hata oluştu!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Aynı TC kimlik numarasına sahip personel zaten kayıtlıdır!");
                    }
                }
                else
                {
                    MessageBox.Show("TC kimlik numarası 11 haneli olmalıdır!");
                }
            }
            else
            {
                MessageBox.Show("Eksik bilgi girdiniz. Lütfen kontrol ediniz!");
            }
        }
Пример #8
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (seciliuye != null)
            {
                if (!string.IsNullOrEmpty(txtAd.Text) & !string.IsNullOrEmpty(txtSoyad.Text) & !string.IsNullOrEmpty(txtTCNo.Text) & !string.IsNullOrEmpty(txtCepNo.Text) & !string.IsNullOrEmpty(txtAdres.Text))
                {
                    if (txtTCNo.Text.Length == 11)
                    {
                        EMembers member = new EMembers();
                        member.ID        = seciliuye.ID;
                        member.TCNo      = txtTCNo.Text;
                        member.FirstName = txtAd.Text;
                        member.LastName  = txtSoyad.Text;
                        member.Phone     = txtCepNo.Text;
                        member.Address   = txtAdres.Text;

                        bool sonuc = BLLMembers.Update(member);
                        if (sonuc)
                        {
                            MessageBox.Show("Güncelleme başarılı!");
                            dataGridView1.DataSource = BLLMembers.GetAll();
                            Clear();
                        }
                        else
                        {
                            MessageBox.Show("Güncelleme başarısız oldu!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("TC kimlik numarası 11 haneli olmalıdır!");
                    }
                }
                else
                {
                    MessageBox.Show("Eksik bilgi girdiniz. Lütfen kontrol ediniz!");
                }
            }
            else
            {
                MessageBox.Show("Güncelleme işlemini yapmak istidiğiniz yazarı seçiniz.");
            }
        }
Пример #9
0
        private void Form2_Load(object sender, EventArgs e)
        {
            List <EBooks> bookList = BLLBooks.GetBookNames();

            if (bookList != null && bookList.Count > 0)
            {
                bookList = (from l in bookList
                            where l.IsReturned == false
                            select l).ToList <EBooks>();
            }
            cmbVerilenKitap.DataSource    = bookList;
            cmbVerilenKitap.DisplayMember = "Name";
            cmbVerilenKitap.ValueMember   = "ID";

            cmbMembers.DataSource    = BLLMembers.GetMemberNames();
            cmbMembers.DisplayMember = "FullName";
            cmbMembers.ValueMember   = "ID";

            cmbEmployees.DataSource    = BLLEmployees.GetEmployeeNames();
            cmbEmployees.DisplayMember = "FullName";
            cmbEmployees.ValueMember   = "ID";
        }
Пример #10
0
 private void Uye_Listesi_Load(object sender, EventArgs e)
 {
     dataGridView1.AutoGenerateColumns = false;
     dataGridView1.DataSource          = BLLMembers.GetAll();
 }