⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pro_auction_add.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.BLL;
using YXShop.Model;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Product
{
    public partial class Pro_Auction_Add : System.Web.UI.Page
    {
        YXShop.BLL.Pro_Auction dataCA = new YXShop.BLL.Pro_Auction();
        BasePage bp = new BasePage();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.SelectProduct1.DsType = "5";
                if (Request["Pro_ID"] != null)
                {
                    if (!PowerTree.PowerPass.isPass("002002004", PowerTree.PowerPanel.PowerType.update))
                    {
                        bp.PageError("对不起,你没有修改拍卖项的权限!", "../index.aspx");
                    }
                    List<YXShop.Model.Pro_Auction> data = dataCA.GetId(Convert.ToInt32(Request["Pro_ID"]));
                    this.txtpmc.Text = data[0].Auc_ActName;
                    this.txtpmms.Text = data[0].AUc_ActDescription;
                    this.txtqpj.Text = data[0].Auc_Price.ToString();
                    this.txtjjfd.Text = data[0].Auc_PriceRange.ToString();
                    this.txtbzj.Text = data[0].Auc_Deposit.ToString();
                    dpStart.Date = Convert.ToDateTime(data[0].Auc_StartTime.ToString());
                    dpEnd.Date = Convert.ToDateTime(data[0].Auc_EndTime.ToString());
                    SelectProduct1.PName = data[0].Auc_ProName;
                    this.SelectProduct1.PID = data[0].Pro_ID;
                    ViewState["ID"] = Request.QueryString["Pro_ID"];
                }
                else
                {
                    if (!PowerTree.PowerPass.isPass("002002002", PowerTree.PowerPanel.PowerType.add))
                    {
                        bp.PageError("对不起,你没有添加拍卖项的权限!", "../index.aspx");
                    }
                }
            }

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.SelectProduct1.PName == string.Empty || this.SelectProduct1.PName == null)
            {
                this.lbselPro.Text = " * 该项必填!";
                return;
            }
            try
            {

                YXShop.Model.Pro_Auction data = new YXShop.Model.Pro_Auction();
                data.Auc_ActName = txtpmc.Text.Trim();
                data.AUc_ActDescription = txtpmms.Text.Trim();
                data.Auc_StartTime = Convert.ToDateTime(dpStart.ChsDate.ToString());
                data.Auc_EndTime = Convert.ToDateTime(dpEnd.ChsDate.ToString());
                data.Auc_Price = Convert.ToDecimal(txtqpj.Text.ToString());
                data.Auc_PriceRange = Convert.ToDecimal(txtjjfd.Text.ToString());
                data.Auc_Deposit = this.txtbzj.Text == string.Empty ? 0 : Convert.ToDecimal(txtbzj.Text.ToString());
                data.Pro_ID = Convert.ToInt32(SelectProduct1.PID.ToString());
                if (ViewState["ID"] != null)
                {
                    data.Auc_ID = Convert.ToInt32(ViewState["ID"]);
                    if(dataCA.Amend(data) > 0)
                    {
                        bp.PageRight("拍卖商品修改成功.", "Pro_Auction_List.aspx");
                    }
                }
                else
                {
                    if (dataCA.Create(data) > 0)
                    {
                        bp.PageRight("拍卖商品添加成功.<li><a href='Pro_Auction_Add.aspx'>继续添加拍卖商品</a></li>", "Pro_Auction_List.aspx");
                    }
                }
            }
            catch (Exception ex)
            {
                bp.PageError("添加或修改拍卖商品操作失败!", "Pro_Auction_List.aspx");
            }
            
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -