Esempio n. 1
0
    protected void btnUserAdd_Click(object sender, EventArgs e)
    { // SİSTEME YENİ KULLANICI EKLER.
        if (RadioButton1.Checked)
        {
            x = 2;
        }
        if (RadioButton2.Checked)
        {
            x = 3;
        }

        try
        {
            proxy = new ServiceReference1.ServiceClient();
            ServiceReference1.users objcust =
                new ServiceReference1.users()
            {
                name     = TextBox1.Text,
                surname  = TextBox2.Text,
                mail     = TextBox3.Text,
                phone    = TextBox4.Text,
                roleid   = x,
                password = proxy.MD5(TextBox5.Text.ToString())
            };
            proxy.InsertUsers(objcust); // yeni kullanıcı ekliyor.
            ClearTextBoxes(this);       //Sayfa içindeki TextBoxları temizliyor
            GridView1.DataSource = proxy.GetUsers();
            GridView1.DataBind();
            Label1.Text = "Yeni kullanıcı oluşturuldu ";
        }
        catch (Exception)
        {
            Label1.Text = "Servis çalışmamız mevcuttur. Lütfen daha sonra tekrar deneyiniz.";
            throw;
        }
    }