protected void btnUpdate_Click(object sender, EventArgs e) { int rowsCount = grid.Rows.Count; GridViewRow gridRow; TextBox qtyTextBox; string productID; int qty; bool stat = true; for (int i = 0; i < rowsCount; i++) { gridRow = grid.Rows[i]; productID = grid.DataKeys[i].Value.ToString(); qtyTextBox = (TextBox)gridRow.FindControl("editQty"); if (Int32.TryParse(qtyTextBox.Text, out qty)) { stat = stat && CartAccess.UpdateItem(productID, qty); } else { stat = false; } lblStatus.Text = stat ? "Güncelleme Başarılı" : "Güncelleme Başarısız"; } DenetimleriDoldur(); }
public void DenetimleriDoldur() { ProductRecomment.LoadCartRecomment(); DataTable dt = CartAccess.GetItems(); if (dt.Rows.Count == 0) { btnUpdate.Enabled = false; btnCheckOut.Enabled = false; lblNumberOfProduct.Text = "Sepetinizde Ürün Bulunmamaktadır"; grid.Visible = false; lblTotalAmount.Text = String.Format("{0:c}", 0); } else { grid.Visible = true; grid.DataSource = dt; grid.DataBind(); //string numberOfProduct = "6"; //lblNumberOfProduct.Text = "Toplam " + numberOfProduct + " ürün seçtiniz."; decimal amount = CartAccess.GetTotalAmount(); lblTotalAmount.Text = String.Format("{0:c}", amount); } }
protected void btnAddToCart_Clik(object sender, EventArgs e) { string productID = Request.QueryString["ProductID"]; ProductDetail pd = CatalogAccess.GetOneProduct(productID); string options = ""; foreach (Control cnt in attrPlaceHolder.Controls) { if (cnt is Label) { Label attrLabel = (Label)cnt; options += attrLabel.Text; } if (cnt is DropDownList) { DropDownList attrDropDowm = (DropDownList)cnt; options += attrDropDowm.Items[attrDropDowm.SelectedIndex] + "; "; } } // CartAccess.AddItem2(productID); CartAccess.AddItem(productID, options); }
private void DenetimleriDoldur() { BankAccounts bnk = CatalogAccess.GetBankAccount(); lblBankName.Text = bnk.bankName; lblBankNumber.Text = bnk.iban; lblAccountOwner.Text = bnk.owner; lblDecription.Text = bnk.description; lblPaymentID.Text = Request.QueryString["CartID"]; lblCost.Text = String.Format("{0:c}", CartAccess.GetTotalAmount()); }
protected void btnPay_Click(object sender, EventArgs e) { if (Profile.Address == "" || Profile.IBAN == "" || Profile.UserName == "" || Profile.Phone == "") { lblStatus.Text = "Lütfen Profil Bilgilerinde Boş Bırakmayınız"; } else { string OrderID = CartAccess.CreateCustomerOrder(); lblStatus.Text = OrderID; } }
protected void grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { //Seçili Satır numasını almak int rowIndex = e.RowIndex; // string productID = grid.DataKeys[rowIndex].Value.ToString(); //Ürün Sil bool stat = CartAccess.RemoveItem(productID); lblStatus.Text = stat ? "Silme Başarılı" : "Silme Başarısız"; DenetimleriDoldur(); }
public void LoadCartRecomment() { DataTable dt = new DataTable(); dt = CartAccess.GetCartRecomment(); if (dt.Rows.Count > 0) { list.ShowHeader = true; list.DataSource = dt; list.DataBind(); } }
private void DenetimleriDoldur() { System.Data.DataTable dt = CartAccess.GetItems(); if (dt.Rows.Count == 0) { lbltotalAmount.Text = String.Format("{0:c}", 0); } else { // double amount2 = CartAccess.SepetToplam(); decimal amount = CartAccess.GetTotalAmount(); lbltotalAmount.Text = String.Format("{0:c}", amount); } }
protected void btnDeleteOldCarts_Click(object sender, EventArgs e) { byte days = byte.Parse(dayDropDown.SelectedItem.Value); bool stat = CartAccess.DeleteOldCarts(days); if (stat) { lblStat.Text = "Sepetler Silindi !"; } else { lblStat.Text = "Sepetler Silinemedi!"; } }
protected void btnCountCarts_Click(object sender, EventArgs e) { byte days = byte.Parse(dayDropDown.SelectedItem.Value); int oldItems = CartAccess.CountOldCarts(days); if (oldItems == -1) { lblStat.Text = "Sepet Verileri Sayılamadı!"; } else if (oldItems == 0) { lblStat.Text = "Sepet Verisi Bulunamadı !"; } else { lblStat.Text = "Toplam : " + oldItems + " Sepet Bulundu"; } }