protected void satinAl_Click(object sender, EventArgs e)
 {
     if (Session["kullaniciID"] != null)
     {
         String  UrunID  = Request.QueryString["urunID"];
         Yonetim satinAl = new Yonetim();
         Double  adet    = Double.Parse(kacAdet.SelectedValue);
         Double  Tutar   = adet * (Double.Parse(urunSatis.Text));
         satinAl.SepettenSatınAl(Session["kullaniciID"].ToString(), UrunID, adet.ToString(), Tutar.ToString());
     }
     else
     {
         Response.Redirect("Login.aspx");
     }
 }
Exemple #2
0
        protected void satinAl_Click(object sender, EventArgs e)
        {
            Yonetim sepetIslemi = new Yonetim();

            foreach (GridViewRow item in GridView1.Rows)
            {
                if (((CheckBox)item.FindControl("secilenCheck")).Checked)
                {
                    String secilenID = GridView1.DataKeys[item.RowIndex].Value.ToString();
                    //Double fiyat = Convert.ToDouble(GridView1.DataKeys[item.RowIndex].Value.ToString());
                    //sepetIslemi.SepetSil(Session["kullaniciID"].ToString(), secilenID);
                    DropDownList drop = (DropDownList)item.FindControl("DropDownList1");
                    sepetIslemi.sepetToplam(Session["kullaniciID"].ToString(), secilenID);
                    String adet  = drop.SelectedValue;
                    Double tutar = Double.Parse(adet) * sepetIslemi.tutar;
                    sepetIslemi.SepettenSatınAl(Session["kullaniciID"].ToString(), secilenID, adet, tutar.ToString());
                }
            }
        }