protected void uiDataListPhotos_ItemCommand(object source, DataListCommandEventArgs e) { DBLayer db = new DBLayer(); db.DeleteProduct(Convert.ToInt32(e.CommandArgument)); BindData(); }
protected void uiGridViewProducts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditProduct") { DBLayer db = new DBLayer(); CurrentProduct = Convert.ToInt32(e.CommandArgument); DataSet ds = db.GetProductContent(CurrentProduct); uiTextBoxName.Text = ds.Tables[0].Rows[0]["ProductName"].ToString(); //uiTextBoxDescription.Text = ds.Tables[0].Rows[0]["Description"].ToString(); //uiTextBoxPrice.Text = ds.Tables[0].Rows[0]["Price"].ToString(); uiPanelViewProducts.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteProduct") { DBLayer db = new DBLayer(); db.DeleteProduct(Convert.ToInt32(e.CommandArgument)); CurrentProduct = 0; BindData(); } }
protected void uiGridViewProducts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditProduct") { DBLayer db = new DBLayer(); CurrentProduct = Convert.ToInt32(e.CommandArgument); DataSet ds = db.GetProductContent(CurrentProduct); uiTextBoxName.Text = ds.Tables[0].Rows[0]["ProductName"].ToString(); uiTextBoxName_en.Text = ds.Tables[0].Rows[0]["ProductName_en"].ToString(); uiFCKeditorDesc.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["Description"].ToString()); uiFCKeditorDesc_en.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["Description_en"].ToString()); uiImageThumbs.ImageUrl = ds.Tables[0].Rows[0]["thumbs"].ToString(); uiPanelViewProducts.Visible = false; uiPanelEdit.Visible = true; uiPanelAllPics.Visible = true; LoadProjectPhotos(); } else if (e.CommandName == "DeleteProduct") { DBLayer db = new DBLayer(); db.DeleteProduct(Convert.ToInt32(e.CommandArgument)); CurrentProduct = 0; BindData(); } }