Example #1
0
 protected void cksYap_ServerClick(object sender, EventArgs e)
 {
     proxy = new ServiceReference1.ServiceClient();
     proxy.WriteDebugLogInfo(DateTime.Now.ToString() + "  userid = " + Session["UserID"].ToString() + " , oturumunu sonlandırdı.");
     Session.Abandon();
     Response.Redirect("Login.aspx");
 }
Example #2
0
    protected void btn_newIMG_Click(object sender, EventArgs e)
    {
        ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
        var verifier = client.GetVerifierString(5.ToString());

        Image1.ImageUrl = "http://neptune.fulton.ad.asu.edu/WSRepository/Services/ImageVerifier/Service.svc/GetImage/" + verifier;
    }
Example #3
0
    protected void convertButton_Click(object sender, EventArgs e)
    {
        //tabs
        tabs_list = new HtmlGenericControl("ul");
        tabs_list.Attributes["class"] = "nav nav-tabs";
        tabs_list.Attributes.Add("role", "tablist");
        tabs_panel.Controls.Add(tabs_list);

        //tabs-content
        tabsContent = new HtmlGenericControl("div");
        tabsContent.Attributes["class"] = "tab-content";
        tabs_panel.Controls.Add(tabsContent);

        ServiceReference1.ServiceClient translator = new ServiceReference1.ServiceClient();
        String language = Thread.CurrentThread.CurrentUICulture.Name;

        System.Diagnostics.Debug.WriteLine(language);
        ArrayList serviceTabs = translator.getTabs(number.Text, language);
        Boolean   firstSet    = false;

        for (int i = 0; i < serviceTabs.Count; i++)
        {
            if (serviceTabs[i].GetType() == typeof(ArrayList))
            {
                if (arrayListTreatment(serviceTabs[i], firstSet))
                {
                    firstSet = true;
                }
            }
        }
    }
    //protected bool checkLogin(string LoginName,string Password)
    //{
    //    SqlConnection con = new SqlConnection();
    //    con.ConnectionString = @"Data Source=(LocalDb)\MSSqlLocalDb;Initial Catalog=DotNet;Integrated Security=True;Pooling=False";
    //    SqlCommand cmd = new SqlCommand();
    //    cmd.Connection = con;
    //    cmd.CommandType = CommandType.Text;
    //    cmd.CommandText = "select count(*) from UserMaster where LoginName='"+LoginName+"'and Password='******'";
    //    con.Open();
    //     int is_v=(int)cmd.ExecuteScalar();
    //    con.Close();
    //    return is_v == 1;
    //}

    protected void Button1_Click(object sender, EventArgs e)
    {
        ServiceReference1.ServiceClient sClient = new ServiceReference1.ServiceClient();

        if (sClient.checkLogin(txtLoginName.Text, txtPassword.Text))
        {
            if (chkRemember.Checked)
            {
                HttpCookie cookie = new HttpCookie("Login");
                cookie["LoginName"]  = txtLoginName.Text;
                cookie["Password"]   = txtPassword.Text;
                Session["LoginName"] = txtLoginName.Text;
                Session["Password"]  = txtPassword.Text;
                cookie.Expires       = DateTime.Now.AddDays(1);
                Response.Cookies.Add(cookie);
                //Response.SetCookie(cookie);
            }

            Response.Redirect("HomePage.aspx");
        }
        else
        {
            lblCredential1.Text = "Please Enter The Valid Credentials";
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        proxy = new ServiceReference1.ServiceClient();

        if (!IsPostBack) //Sayfa ilk defa mı yüklendi yoksa yenilendi mi diye kontrol ediyor.
        {
            try
            {
                int uID   = Convert.ToInt32(Session["UserID"]);
                var order = proxy.GetOrder(uID); // Geçmiş siparişlere bakıyor.

                if (order.Count() == 0)          // Yoksa bilgilendirme mesajı veriyor.
                {
                    rptOrder.Visible = false;
                    Label2.Visible   = true;
                    Label2.Text      = "Sepetinizde ürün bulunmamaktadır";
                }
                else
                { // Varsa listeliyor.
                    rptOrder.DataSource = order.ToList();
                    rptOrder.DataBind();
                }
            }
            catch (Exception)
            {
            }
        }
    }
Example #6
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        ServiceReference1.ServiceClient sClient = new ServiceReference1.ServiceClient();

        if (!(sClient.checkLogin(txtLoginName.Text, txtPassword.Text)))
        {
            if (txtPassword.Text == txtCfPassword.Text)
            {
                SqlConnection con = new SqlConnection();
                con.ConnectionString = @"Data Source=(LocalDb)\MSSqlLocalDb;Initial Catalog=DotNet;Integrated Security=True;Pooling=False";
                SqlCommand cmd = new SqlCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "InsertUserMaster";
                cmd.Connection  = con;
                cmd.Parameters.AddWithValue("@LoginName", txtLoginName.Text);
                cmd.Parameters.AddWithValue("@Password", txtPassword.Text);
                cmd.Parameters.AddWithValue("@EmailId", txtEmailId.Text);
                cmd.Parameters.AddWithValue("@Address", txtAddress.Text);
                cmd.Parameters.AddWithValue("@CityId", ddlCity.SelectedValue);
                cmd.Parameters.AddWithValue("@PaymentModeId", ddlPaymentMode.SelectedValue);
                con.Open();
                int i = cmd.ExecuteNonQuery();
                con.Close();
                lblAlradyExist.Text = "User Registered SuccessFully..";
            }
        }
        else
        {
            lblAlradyExist.Text = "User Alreday Exist..";
        }
    }
Example #7
0
    protected void rptHampers_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        proxy = new ServiceReference1.ServiceClient();

        if (e.CommandName == "UpdateQuantityHamper")
        {
            int uID = Convert.ToInt32(Session["UserID"]);
            int hID = Convert.ToInt32(e.CommandArgument);                                                       // Tıkladığımız satırdaki ürünün hamperid'sini çekiyor

            line  = (e.Item.ItemIndex);                                                                         //Tıkladığımız satırı çekiyoruz.
            count = Convert.ToInt32(((rptHampers.Items[line].FindControl("txtAdet")) as TextBox).Text);         //Tıkladığımız satırdaki ürünün adet sayısını çekiyor
            int count2 = Convert.ToInt32(((rptHampers.Items[line].FindControl("txtAdetOrj")) as TextBox).Text); //Tıkladığımız satırdaki ürünün adet sayısını çekiyor
            if (count2 != count)
            {
                bool check = proxy.UpdateQuantityHampers(hID, count);
                var  hmp   = proxy.GetHampers(uID);

                rptHampers.DataSource = hmp.ToList();
                rptHampers.DataBind();

                int countNew = Convert.ToInt32(((rptHampers.Items[line].FindControl("txtAdet")) as TextBox).Text);  //  Yeni  adedi çekiyor
                                                                                                                    //Değişimi kıyaslayıp Bootstrap - Modal Yapısını kullanıyoruz.
                if (check == true)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", $"alert('Seçtiğiniz ürünün adet sayısı {countNew} olarak güncellendi.')", true);
                    proxy.WriteDebugLogInfo(DateTime.Now.ToString() + "  userid = " + Session["UserID"].ToString() + " , hID =" + Convert.ToInt32(e.CommandArgument) + "  ürünün adedini  " + countNew + " güncelledi.");
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Ürünümüzden istediğiniz miktarda bulunmamaktadır. Adet sayısını tekrar giriniz.')", true);
                }
                lblTotalPrice.Text = hmp.Sum(x => x.tprice).ToString();
            }
        }
        if (e.CommandName == "DeleteHamper") //Silme işlemi
        {
            int uID = Convert.ToInt32(Session["UserID"]);
            int hID = Convert.ToInt32(e.CommandArgument);                                               // Tıkladığımız satırdaki ürünün hamperid'sini çekiyor

            line  = (e.Item.ItemIndex);                                                                 //Tıkladığımız satırı çekiyoruz.
            count = Convert.ToInt32(((rptHampers.Items[line].FindControl("txtAdet")) as TextBox).Text); //Tıkladığımız satırdaki ürünün adet sayısını çekiyor

            bool check = proxy.DeleteHampers(hID, uID);                                                 //Fonksiyon çalışıyor
            var  hmp   = proxy.GetHampers(uID);                                                         //Fonksiyon çalışıyor
            rptHampers.DataSource = hmp.ToList();
            rptHampers.DataBind();

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Seçtiğiniz ürün sepetinizden çıkarılmıştır.')", true);
            proxy.WriteDebugLogInfo(DateTime.Now.ToString() + "  userid = " + Session["UserID"].ToString() + " , hID =" + Convert.ToInt32(e.CommandArgument) + "  ürünü sepetinden çıkardı.");

            lblTotalPrice.Text = hmp.Sum(x => x.tprice).ToString();
            // Yukarıdaki satırda: Modal Yapısının gerçekleşmesini sağlayan Script fonksiyonuna değişken yolluyoruz.
        }
    }
Example #8
0
    protected void btnLogin_Click(object sender, EventArgs e)
    { // KULLANICI KAYDINI SORGULUYOR
        try
        {
            proxy = new ServiceReference1.ServiceClient();
            users currentuser = proxy.Login(TextBox1.Text, TextBox2.Text);

            if (currentuser == null) // KULLANICI YOKSA UYARI VERİYOR.
            {
                lblResult.Text = "Kullanıcı adı veya şifre hatalı.Lütfen tekrar deneyiniz.";
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyopenModal", "openModal();", true);


                proxy.WriteDebugLogError(DateTime.Now.ToString() + "     " + TextBox1.Text + "    mail adresi ile hatalı giriş yapılmıştır");
            }
            else if (currentuser.roleid == 1 || currentuser.roleid == 2 || currentuser.roleid == 3) //  KAYIT OLURKEN roleid GİRİLMİŞ Mİ DİYE KONTROL EDİYOR.
            {
                Session["UserID"] = currentuser.userid;
                Session["User"]   = currentuser.name.ToString() + "  " + currentuser.surname.ToString();

                if (currentuser.roleid == 1)
                {
                    Session["Role"]   = "Admin";
                    Session["RoleID"] = 1;
                }
                else if (currentuser.roleid == 2)
                {
                    Session["Role"]   = "Müşteri";
                    Session["RoleID"] = 2;
                }
                else
                {
                    Session["Role"]   = "Satıcı";
                    Session["RoleID"] = 3;
                }
                proxy.WriteDebugLogInfo(DateTime.Now.ToString() + "  userid = " + Session["UserID"].ToString() + " , oturum açtı.");
                if (Session["referer"] != null)
                {
                    Response.Redirect(Session["referer"].ToString());
                }
                Response.Redirect("HomePage.aspx");
            }
            else
            {
                Session["UserID"] = currentuser.userid;
                proxy.WriteDebugLogError(DateTime.Now.ToString() + "  userid = " + Session["UserID"].ToString() + " , rol atanmamıştır.");
            }
        }
        catch (Exception)
        {
            // throw ex;
        }
    }
Example #9
0
    protected void rptView_ItemCommand(object source, RepeaterCommandEventArgs e)
    {   // ÜRÜNÜ DEPODAN KALDIRIR
        if (e.CommandName == "Delete")
        {
            int pID = Convert.ToInt32(e.CommandArgument); // Tıklanılan satırdaki ürünün productid'sini çeker.

            proxy = new ServiceReference1.ServiceClient();

            bool check = proxy.DeleteProduct(pID);
            rptView.DataSource = proxy.GetProduct();
            rptView.DataBind();
        }
    }
Example #10
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {                                                //VAR OLAN KULLANICININ SİSTEMDEN KAYDINI SİLER
        int uID = Convert.ToInt32(GridView1.DataKeys // Tıklanılan satırdaki userid'yi çeker.
                                  [e.RowIndex].Values["userid"].ToString());

        proxy = new ServiceReference1.ServiceClient();

        bool check = proxy.DeleteUsers(uID);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Kullanıcı kaydı başarılı bir şekilde silinmiştir.')", true);
        GridView1.DataSource = proxy.GetUsers();
        GridView1.DataBind();
    }
Example #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Diagnostics.Debug.Print("nahi horaha");
        ServiceReference1.ServiceClient fromService = new ServiceReference1.ServiceClient();
        String userLen = "5";

        imageString = fromService.GetVerifierString(userLen);
        var img  = System.Drawing.Image.FromStream(fromService.GetImage(imageString));
        var path = Server.MapPath("/images/verifier.jpg");

        img.Save(path);
        Image1.ImageUrl = "/images/verifier.jpg";
        //pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
    }
Example #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null) // Oturum hala açık mı diye kontrol ediyor.
        {
            Response.Redirect("Login.aspx");
        }
        proxy = new ServiceReference1.ServiceClient();

        if (!IsPostBack) //Sayfa ilk defa mı yüklendi yoksa yenilendi mi diye kontrol ediyor.
        {
            var result = proxy.GetProduct();
            rptProduct.DataSource = result.Where(x => x.stoch > 0).ToList();
            rptProduct.DataBind();
        }
    }
Example #13
0
    protected void btnFilter_Click(object sender, EventArgs e)
    {     // Kullanıcın  TextBox ile brand(marka) veya pname(ürün) üzerinde arama yaparak ürünlerin filtrelenmesini sağlar
        if (TextBox5.Text != "")
        { //TextBox'ın içi boş ise filtre yapmadan bütün ürünleri listeler
            proxy = new ServiceReference1.ServiceClient();

            rptView.DataSource = proxy.GetProductFilter(TextBox5.Text.ToString());
            rptView.DataBind();
        }
        else
        {
            rptView.DataSource = proxy.GetProduct();
            rptView.DataBind();
        }
    }
Example #14
0
    protected void btnConfirm_Click(object sender, EventArgs e)

    {//SEPETTEKİ ÜRÜNLERİ SİPARİŞ EDER. SEPETTEKİ ÜRÜNÜN STATUSUNU 3 YAPAR(statu = 3 : Sipariş edildi.) Sipariş edilmiş ürünleri order tablosuna insert eder.
        try
        {
            proxy = new ServiceReference1.ServiceClient();

            dt = DateTime.Now; //HEM order HEM DE orderdetail VERİTABANINA AYNI ANDA İNSERT YAPMAMIZ İÇİN STATIC BİR dt değişkeni oluşturarak ikisine de bu tarihi yolluyoruz.
            int uID = Convert.ToInt32(Session["UserID"]);

            ServiceReference1.order objcust =
                new ServiceReference1.order()
            {
                userid = Convert.ToInt32(Session["UserID"]),
                date   = dt,
                price  = Convert.ToDouble(lblTotalPrice.Text),
            };
            proxy.InsertOrder(objcust);

            proxy = new ServiceReference1.ServiceClient();

            ServiceReference1.orderdetail objcust2 =
                new ServiceReference1.orderdetail()
            {
                userid = Convert.ToInt32(Session["UserID"]),
                date   = dt
            };
            proxy.InsertOrderDetail(objcust2);

            var hmp = proxy.GetHampers(uID);

            rptHampers.DataSource = hmp.ToList();
            rptHampers.DataBind();

            rptHampers.Visible    = false;
            btnConfirm.Visible    = false;
            lblTotalPrice.Visible = false;
            Label3.Visible        = false;

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Siparişiniz kuryemize teslim edilmiştir. Hayırlı olsun dileklerimizle...')", true);

            // Yukarıdaki satırda: Modal Yapısının gerçekleşmesini sağlayan Script fonksiyonuna değişken yolluyoruz.
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Example #15
0
    protected void rptProduct_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "AddHamper")  // Ekleme işlemi
        {
            try
            {
                proxy = new ServiceReference1.ServiceClient();

                int line  = (e.Item.ItemIndex);                                                                 // Tıkladığımız satırı çekiyoruz.
                int count = Convert.ToInt32(((rptProduct.Items[line].FindControl("txtAdet")) as TextBox).Text); // Kullanıcın seçtiği adeti algılıyoruz.
                if (count < 1 || count == 0)
                {
                    count = 1;
                }                                           // Eğer kişi kendi isteğiyle ürün adedini 1'in altında seçmesi durumunda; seçilen ürün adedi otomatik olarak 1 algılanır.

                ServiceReference1.hampers objcust =
                    new ServiceReference1.hampers()
                {
                    userid    = Convert.ToInt32(Session["UserID"]),
                    productid = Convert.ToInt32(e.CommandArgument),
                    quantity  = count,
                    date      = DateTime.Now
                };
                Boolean control = proxy.UpdateHampers(objcust);

                var result = proxy.GetProduct();
                rptProduct.DataSource = result.Where(x => x.stoch > 0).ToList();
                rptProduct.DataBind();
                //Pop-Up
                if (control == true)
                { // olumlu sonuç ürünün stoklarımızda mevcut olduğunu ve seçimin onaylandığını gösteriyor.
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", $"alert('Sepete {count} adet ürün eklendi.')", true);

                    proxy.WriteDebugLogInfo(DateTime.Now.ToString() + "  userid = " + Session["UserID"].ToString() + " , pid =" + Convert.ToInt32(e.CommandArgument) + "  üründen  " + count + "  adet sepete ekledi.");
                }
                else // stoklar yetersiz
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('İsteğinizi şuanda gerçekleştiremiyoruz.Lütfen seçtiğiniz ürünün adedini düşürünüz.')", true);
                }
            }
            catch (Exception)
            {
                Response.Write("Sepete Eklenemedi");
            }
        }
    }
Example #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Convert.ToInt32(Session["RoleID"]) != 1)
     {
         Response.Redirect("HomePage.aspx");
     }
     if (Session["User"] == null) // Oturum hala açık mı diye kontrol ediyor.
     {
         Response.Redirect("Login.aspx");
     }
     if (!IsPostBack) //Sayfa ilk defa mı yüklendi yoksa yenilendi mi diye kontrol ediyor.
     {                // MEVCUT KULLANICILARIN DataGridView İÇİNDE LİSTELENMESİNİ SAĞLIYOR.
         proxy = new ServiceReference1.ServiceClient();
         GridView1.DataSource = proxy.GetUsers();
         GridView1.DataBind();
     }
 }
Example #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Convert.ToInt32(Session["RoleID"]) != 1)
     {
         Response.Redirect("HomePage.aspx");
     }
     if (Session["User"] == null) // Oturum hala açık mı diye kontrol ediyor.
     {
         Response.Redirect("Login.aspx");
     }
     proxy = new ServiceReference1.ServiceClient();
     if (!IsPostBack) // Sayfa ilk defa mı yüklendi yoksa yenilendi mi diye kontrol ediyor.
     {
         rptView.DataSource = proxy.GetProduct();
         rptView.DataBind();
     }
 }
Example #18
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        ServiceReference1.ServiceClient sc =
            new ServiceReference1.ServiceClient();

        int result = sc.Login(EmailTextBox.Text, PasswordTextBox.Text);

        if (result != 0)
        {
            Session["userKey"] = result;
            ResultLabel.Text   = "Welcome" + result.ToString();
        }
        else
        {
            ResultLabel.Text = "Invalid Login";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ServiceReference1.ServiceClient sClient = new ServiceReference1.ServiceClient();

        if (!IsPostBack)
        {
            if (Request.Cookies["Login"] != null)
            {
                var cookie = Request.Cookies["Login"].Values;
                if (sClient.checkLogin(cookie.Get("LoginName"), cookie.Get("Password")))
                {
                    Session["LoginName"] = cookie.Get("LoginName");
                    Session["Password"]  = cookie.Get("Password");
                    Response.Redirect("HomePage.aspx");
                }
            }
        }
    }
Example #20
0
    protected void rptOrder_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        proxy = new ServiceReference1.ServiceClient();

        if (e.CommandName == "Detay")
        {  // DETAY BUTONUNA TIKLANDIĞINDA SİPARİŞ EDİLEN ÜRÜNLERİN DETAYLI HALİNİ GÖSTERİYOR.
            int uID = Convert.ToInt32(Session["UserID"]);

            oID = Convert.ToInt32(e.CommandArgument);

            rptOrderDetail.DataSource = proxy.GetOrderDetail(uID, oID);
            rptOrderDetail.DataBind();

            if (oID1 == 0 && oID2 == 0)
            {
                oID1 = oID;
            }
            else if (oID1 != 0 && oID2 == 0)
            {
                oID2 = oID;
            }
            if (oID1 != 0 && oID2 != 0 && oID1 != oID2)
            {
                oID1 = oID2; oID2 = 0;
            }


            if (rptOrderDetail.Visible == false)               // AÇILIP KAPANMASINI SAĞLIYOR
            {
                rptOrderDetail.Visible = true;
            }
            else if (rptOrderDetail.Visible == true && oID1 == oID2)
            {
                rptOrderDetail.Visible = false;
                oID1 = 0;
                oID2 = 0;
            }
        }
    }
Example #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null) // Oturum hala açık mı diye kontrol ediyor.
        {
            Response.Redirect("Login.aspx");
        }


        proxy = new ServiceReference1.ServiceClient();

        if (!IsPostBack) //Sayfa ilk defa mı yüklendi yoksa yenilendi mi diye kontrol ediyor.
        {
            try
            {
                int uID = Convert.ToInt32(Session["UserID"]);
                var hmp = proxy.GetHampers(uID);
                //sepette ürün var mı/yok mu kontrolü
                if (hmp.Count() == 0) // ürün yok ise
                {
                    rptHampers.Visible    = false;
                    Label2.Visible        = true;
                    Label2.Text           = "Sepetinizde ürün bulunmamaktadır";
                    btnConfirm.Visible    = false;
                    lblTotalPrice.Visible = false;
                    Label3.Visible        = false;
                }
                else
                {
                    rptHampers.DataSource = hmp.ToList();
                    rptHampers.DataBind();
                    lblTotalPrice.Text = hmp.Sum(x => x.tprice).ToString();
                }
            }
            catch (Exception)
            {
            }
        }
    }
Example #22
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        if (Session["userKey"] == null)
        {
            Response.Redirect("default.aspx");
        }
        //float amount = AmountTextBox.Text;

        decimal amount = Convert.ToDecimal(AmountTextBox.Text);
        //string explantion = GrantExplanationBox.Text;
        //int type = Convert.ToInt16(TypeKeyTextBox.Text);
        int userKey = (int)Session["userKey"];

        ServiceReference1.ServiceClient sc =
            new ServiceReference1.ServiceClient();

        ServiceReference1.Donation donation = new ServiceReference1.Donation();

        donation.DonationAmount = amount;
        //grant.GrantRequestExplanation = explantion;
        donation.DonationDate = DateTime.Now;
        //donation.DonationKey = type;
        donation.PersonKey = userKey;


        bool result = sc.Donate(donation);

        if (result)
        {
            Response.Redirect("GetDonation.aspx");
        }
        else
        {
            ErrorLabel.Text = "Invalid Login";
        }
    }
Example #23
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;
        }
    }
Example #24
0
    protected void btnUrunEkle_Click(object sender, EventArgs e)
    {                                    // YENİ ÜRÜN KAYDI YAPILIYOR
        if (UploadTest.HasFile == false) //  GÖRSEL SEÇİLMEDİ İSE HATA VERİYOR.
        {
            // No file uploaded!
            Label1.Text = "Ürün için uygun bir görsel giriniz.";
        }
        else
        {
            try
            {
                proxy = new ServiceReference1.ServiceClient();
                ServiceReference1.product objcust =                                 //EKLENECEK ÜRÜNÜ TANIMLIYOR
                                                    new ServiceReference1.product() //EKLENECEK ÜRÜNÜ TANIMLIYOR
                {                                                                   //EKLENECEK ÜRÜNÜ TANIMLIYOR
                    pname   = TextBox1.Text,                                        //EKLENECEK ÜRÜNÜ TANIMLIYOR
                    brand   = TextBox2.Text,                                        //EKLENECEK ÜRÜNÜ TANIMLIYOR
                    comment = TextBox3.Text,                                        //EKLENECEK ÜRÜNÜ TANIMLIYOR
                    price   = Convert.ToDouble(TextBox4.Text),                      //EKLENECEK ÜRÜNÜ TANIMLIYOR
                    pimage  = UploadTest.FileName,                                  //EKLENECEK ÜRÜNÜ TANIMLIYOR
                    stoch   = Convert.ToInt32(TextBox6.Text)                        //EKLENECEK ÜRÜNÜ TANIMLIYOR
                };
                proxy.InsertProduct(objcust);                                       // ÜRÜNÜ EKLİYOR

                ClearTextBoxes(this);                                               // Sayfa içindeki TextBoxları temizliyor.
                rptView.DataSource = proxy.GetProduct();
                rptView.DataBind();
                Label1.Text = "Ürün depoya eklenmiştir.";
            }
            catch (Exception)
            {
                Label1.Text = "Ürün kaydı oluşturulamamıştır. Lütfen girmiş olduğunuz bilgileri kontrol ediniz.";
                //throw;
            }
        }
    }
Example #25
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(ServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService));
 }
Example #26
0
 public ServiceClient() :
     base(ServiceClient.GetDefaultBinding(), ServiceClient.GetDefaultEndpointAddress())
 {
     this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Example #27
0
 public ServiceClient(EndpointConfiguration endpointConfiguration) :
     base(ServiceClient.GetBindingForEndpoint(endpointConfiguration), ServiceClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Example #28
0
 public ServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) :
     base(ServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Example #29
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(ServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService));
 }