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       = "新增失败";
     }
 }
Ejemplo n.º 2
0
 protected void lbtnModify_Click(object sender, EventArgs e)
 {
     Entity.Items item = new Entity.Items();
     item.setItemID(int.Parse(lbItemID.Text));
     item.setDays(txtDays.Text);
     item.setHours(txtHour.Text);
     item.setMinutes(txtMinutes.Text);
     item.setSeconds(txtSeconds.Text);
     item.setIsSecondKill(rblIsSecondKill.SelectedValue.ToLower());
     if (lbItemID.Text == string.Empty || txtDays.Text == string.Empty ||
         txtHour.Text == string.Empty || txtMinutes.Text == string.Empty || txtSeconds.Text == string.Empty)
     {
         panelAttention.Visible = true;
         lbAttention.Text       = "请先选择需要设置的商品!";
     }
     else if (items.UpdateSingleItem(item))
     {
         panelSuccess.Visible   = true;
         lbSuccess.Text         = "更新成功!";
         txtSeconds.Text        = txtMinutes.Text = txtHour.Text = txtDays.Text = lbItemID.Text = "";
         gvItemsList.DataSource = items.GetItemByAllWithNoImg();
         gvItemsList.DataBind();
     }
     else
     {
         panelError.Visible = false;
         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)
 {
     Entity.Items item = new Entity.Items();
     item.setItemID(int.Parse(lbItemID.Text));
     item.setDays(txtDays.Text);
     item.setHours(txtHour.Text);
     item.setMinutes(txtMinutes.Text);
     item.setSeconds( txtSeconds.Text);
     item.setIsSecondKill(rblIsSecondKill.SelectedValue.ToLower());
     if (lbItemID.Text == string.Empty || txtDays.Text == string.Empty
         || txtHour.Text == string.Empty || txtMinutes.Text == string.Empty || txtSeconds.Text == string.Empty)
     {
         panelAttention.Visible = true;
         lbAttention.Text = "请先选择需要设置的商品!";
     }
     else if (items.UpdateSingleItem(item))
     {
         panelSuccess.Visible = true;
         lbSuccess.Text = "更新成功!";
         txtSeconds.Text = txtMinutes.Text = txtHour.Text = txtDays.Text =lbItemID.Text= "";
         gvItemsList.DataSource = items.GetItemByAllWithNoImg();
         gvItemsList.DataBind(); 
     }
     else 
     {
         panelError.Visible = false;
         lbError.Text = "更新失败!";
     }   
 }