Example #1
0
        protected void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_Ad.Text == "" & txt_Soyad.Text == "" & txt_Tel.Text == "" & txt_sifre.Text == "")
            {
                lbl_mesaj.Text = "Boş bırakmayınız.";
            }
            else
            {
                personeller yeni = new personeller();
                yeni.personelad    = txt_Ad.Text;
                yeni.personelsoyad = txt_Soyad.Text.ToUpper();
                yeni.gorevid       = Convert.ToInt32(Drop_gorev.SelectedValue);
                yeni.telefon       = txt_Tel.Text;
                yeni.mail          = txt_Mail.Text;
                yeni.sifre         = txt_sifre.Text;


                // resim ekleme

                if (FileUpload1.HasFile)
                {
                    string uzanti = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();

                    if (uzanti == ".jpg" || uzanti == ".gif")
                    {
                        // resmin yolu
                        yeni.fotograf = "~/fotograflar/" + FileUpload1.FileName;
                        FileUpload1.PostedFile.SaveAs(Server.MapPath("./fotograflar/") + FileUpload1.FileName);
                        lbl_mesaj.Text           = "Kayıt eklendi.";
                        Drop_birim.SelectedValue = null;
                        Drop_gorev.SelectedValue = null;
                    }
                    else
                    {
                        lbl_mesaj.Text = "uygun dosya formatı seçiniz";
                        return;
                    }
                }
                // resim ekleme sonu
                string sorgu = @"
                        insert into personeller ( personelad, personelsoyad,gorevid, telefon, mail, fotograf,sifre )
                        values                  ( '" + yeni.personelad + "', '" + yeni.personelsoyad + "', '" + yeni.gorevid + "', '" + yeni.telefon + "', '" + yeni.mail + "', '" + yeni.fotograf + "', '" + yeni.sifre + "' )";

                dataislemleri db = new dataislemleri();
                db.ExecuteSPQuery(sorgu);
                txt_Ad.Text    = "";
                txt_Soyad.Text = "";
                txt_Mail.Text  = "";
                txt_Tel.Text   = "";
            }
        }
Example #2
0
 internal void PersonelGuncellestir(personeller guncellenecekpersonel)
 {
     throw new NotImplementedException();
 }