Esempio n. 1
0
    protected void btnGonder_Click(object sender, EventArgs e)
    {
        string ad, soyad, kullaniciAdi, sifre, eMail, adres, telefon, dukkanAd, resimYolu;

        ad           = txtAd.Text;
        soyad        = txtSoyad.Text;
        kullaniciAdi = txtKullaniciAdi.Text;
        sifre        = txtPswd.Text;
        eMail        = txtMail.Text;
        adres        = txtAdres.Text;
        telefon      = txtTelefon.Text;
        dukkanAd     = txtDukkanAd.Text;
        resimYolu    = null;
        if (rbManav.Checked == true)
        {
            try
            {
                if (fuFoto.HasFile)
                {
                    HttpPostedFile upload = fuFoto.PostedFile;
                    if (upload.ContentType.Contains("image") && upload.ContentLength < 1000000000)
                    {
                        Guid id = Guid.NewGuid();
                        resimYolu = Server.MapPath(string.Format("manavlar/{0}.jpg", id));
                    }
                    else
                    {
                        //Çok büyük bla bla
                    }
                }
                else
                {
                    // Geçerli bir dosya yükleyin bla bla
                }
            }
            catch (Exception ex)
            {
                Response.Write("Hata oldu resim yüklenirken./n" + ex.InnerException);
            }
            Response.Write(resimYolu);
            int UserID     = GgDbProvider.AddUser(ad, soyad, kullaniciAdi, sifre, eMail, 0);
            int DistrictID = Convert.ToInt32(ddlIlce.SelectedValue); //Bir şey seçmeyince patlar dikkat et
            GgDbProvider.AddSupplier(UserID, DistrictID, dukkanAd, adres, telefon, resimYolu);
            //Response.Write(resimYolu);
        }

        else if (rbMusteri.Checked == true)
        {
            GgDbProvider.AddUser(ad, soyad, kullaniciAdi, sifre, eMail, 1);
        }
        Temizle();
    }
    protected void btnIleri_Click(object sender, EventArgs e)
    {
        string ad, soyad, kullaniciAdi, sifre, eMail;

        ad           = txtAd.Text;
        soyad        = txtSoyad.Text;
        kullaniciAdi = txtUsr.Text;
        sifre        = txtPswd.Text;
        eMail        = txtMail.Text;
        if (cbAdmin.Checked == true)
        {
            GgDbProvider.AddUser(ad, soyad, kullaniciAdi, sifre, eMail, 0);
        }

        else if (cbUser.Checked == true)
        {
            GgDbProvider.AddUser(ad, soyad, kullaniciAdi, sifre, eMail, 1);
        }
        Temizle();
    }