protected void btnUpload_Click(object sender, EventArgs e) { Entity.Items item = new Entity.Items(); item.setProductID(int.Parse(ddlProductID.SelectedValue)); item.setProductID(int.Parse(ddlBrandID.SelectedValue)); item.setName(txtName.Text.Trim()); item.setAgoraPrice(txtAgoraPrice.Text.Trim()); item.setVipPrice(txtVipPrice.Text.Trim()); item.setMemberPrice(txtMemberPrice.Text.Trim()); item.setSeckillPrice(txtSeckillPrice.Text.Trim()); item.setArea(txtArea.Text.Trim()); item.setDetails(Textarea1.Value.Trim()); item.setDays(txtDays.Text.Trim()); item.setHours(txtHours.Text.Trim()); item.setMinutes(txtMinutes.Text.Trim()); item.setSeconds(txtSeconds.Text.Trim()); //if (items.AddItemsInfo(int.Parse(ddlProductID.SelectedValue), int.Parse(ddlBrandID.SelectedValue), txtName.Text.Trim(), txtAgoraPrice.Text.Trim(), txtMemberPrice.Text.Trim(), txtVipPrice.Text.Trim(), txtSeckillPrice.Text.Trim(), txtArea.Text.Trim(), Textarea1.Value.Trim(), txtDays.Text.Trim(), txtHours.Text.Trim(), txtMinutes.Text.Trim(), txtSeconds.Text.Trim())) if (items.AddItemsInfo(item)) { panelSuccess.Visible = true; lbSuccess.Text = "新增成功!"; txtAgoraPrice.Text = txtArea.Text = txtDays.Text = txtHours.Text = txtMemberPrice.Text = txtMinutes.Text = txtName.Text = txtSeckillPrice.Text = txtSeconds.Text = txtVipPrice.Text = Textarea1.Value = ""; } else { panelError.Visible = true; lbError.Text = "新增失败"; } }
protected void btnUpload_Click(object sender, EventArgs e) { Entity.Items item = new Entity.Items(); item.setProductID(int.Parse(ddlProductID.SelectedValue)); item.setProductID(int.Parse(ddlBrandID.SelectedValue)); item.setName(txtName.Text.Trim()); item.setAgoraPrice(txtAgoraPrice.Text.Trim()); item.setVipPrice( txtVipPrice.Text.Trim()); item.setMemberPrice(txtMemberPrice.Text.Trim()); item.setSeckillPrice(txtSeckillPrice.Text.Trim()); item.setArea(txtArea.Text.Trim()); item.setDetails(Textarea1.Value.Trim()); item.setDays(txtDays.Text.Trim()); item.setHours(txtHours.Text.Trim()); item.setMinutes(txtMinutes.Text.Trim()); item.setSeconds(txtSeconds.Text.Trim()); //if (items.AddItemsInfo(int.Parse(ddlProductID.SelectedValue), int.Parse(ddlBrandID.SelectedValue), txtName.Text.Trim(), txtAgoraPrice.Text.Trim(), txtMemberPrice.Text.Trim(), txtVipPrice.Text.Trim(), txtSeckillPrice.Text.Trim(), txtArea.Text.Trim(), Textarea1.Value.Trim(), txtDays.Text.Trim(), txtHours.Text.Trim(), txtMinutes.Text.Trim(), txtSeconds.Text.Trim())) if (items.AddItemsInfo(item)) { panelSuccess.Visible = true; lbSuccess.Text = "新增成功!"; txtAgoraPrice.Text = txtArea.Text = txtDays.Text = txtHours.Text = txtMemberPrice.Text = txtMinutes.Text = txtName.Text = txtSeckillPrice.Text = txtSeconds.Text = txtVipPrice.Text = Textarea1.Value = ""; } else { panelError.Visible = true; lbError.Text = "新增失败"; } }
protected void lbtnModify_Click(object sender, EventArgs e) { switch (lbtnModify.Text) { case "更新": if (lbItemID.Text == "" || txtItemName.Text == "" || txtArea.Text == "") { panelAttention.Visible = true; lbAttention.Text = "请先选择更新的商品并填写相关信息!"; } else { Entity.Items item = new Entity.Items(); item.setItemID(int.Parse(lbItemID.Text)); item.setProductID(int.Parse(ddlProductID.SelectedItem.Value)); item.setBrandID(int.Parse(ddlBrandID.SelectedItem.Value)); item.setName(txtItemName.Text.Trim()); item.setArea(txtArea.Text.Trim()); if (items.UpdateSingleItem(item)) { panelSuccess.Visible = true; lbSuccess.Text = "商品信息更新成功!"; gvItemsList.DataSource = items.GetItemByAllWithNoImg(); gvItemsList.DataBind(); txtArea.Text = txtItemName.Text = lbItemID.Text = ""; } else { panelError.Visible = false; lbError.Text = "商品信息更新失败!"; } } break; case "删除": if (lbItemID.Text == "") { panelAttention.Visible = true; lbAttention.Text = "请先选择更新的商品并填写相关信息!"; } else { if (items.DeleteItem(int.Parse(lbItemID.Text))) { panelSuccess.Visible = true; lbSuccess.Text = "商品信息删除成功!"; gvItemsList.DataSource = items.GetItemByAllWithNoImg(); gvItemsList.DataBind(); } else { panelError.Visible = true; lbError.Text = "商品信息删除失败!"; } } break; } }