Пример #1
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 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 = "更新失败!";
     }   
 }