Exemplo n.º 1
0
 private void ShowInfo(int AuctionId)
 {
     NoName.NetShop.BLL.ActionProductModelBll bll   = new NoName.NetShop.BLL.ActionProductModelBll();
     NoName.NetShop.Model.ActionProductModel  model = bll.GetModel(AuctionId);
     this.lblProductName.Text = model.ProductName;
     this.lblSmallIamge.Text  = model.SmallIamge;
     this.lblMediumImage.Text = model.MediumImage;
     this.lblOutLinkUrl.Text  = model.OutLinkUrl;
     this.lblStartPrice.Text  = model.StartPrice.ToString();
     this.lblAddPrices.Text   = model.AddPrices.ToString();
     this.lblCurPrice.Text    = model.CurPrice.ToString();
     this.lblBrief.Text       = model.Brief;
     this.lblStartTime.Text   = model.StartTime.ToString();
     this.lblEndTime.Text     = model.EndTime.ToString();
     this.lblStatus.Text      = model.Status.ToString();
 }
Exemplo n.º 2
0
 private void ShowInfo(int AuctionId)
 {
     NoName.NetShop.BLL.ActionProductModelBll bll=new NoName.NetShop.BLL.ActionProductModelBll();
     NoName.NetShop.Model.ActionProductModel model=bll.GetModel(AuctionId);
     this.lblProductName.Text=model.ProductName;
     this.lblSmallIamge.Text=model.SmallIamge;
     this.lblMediumImage.Text=model.MediumImage;
     this.lblOutLinkUrl.Text=model.OutLinkUrl;
     this.lblStartPrice.Text=model.StartPrice.ToString();
     this.lblAddPrices.Text=model.AddPrices.ToString();
     this.lblCurPrice.Text=model.CurPrice.ToString();
     this.lblBrief.Text=model.Brief;
     this.lblStartTime.Text=model.StartTime.ToString();
     this.lblEndTime.Text=model.EndTime.ToString();
     this.lblStatus.Text=model.Status.ToString();
 }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtProductName.Text == "")
            {
                strErr += "ProductName不能为空!\\n";
            }
            if (this.txtSmallIamge.Text == "")
            {
                strErr += "SmallIamge不能为空!\\n";
            }
            if (this.txtMediumImage.Text == "")
            {
                strErr += "MediumImage不能为空!\\n";
            }
            if (this.txtOutLinkUrl.Text == "")
            {
                strErr += "OutLinkUrl不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtStartPrice.Text))
            {
                strErr += "StartPrice不是数字!\\n";
            }
            if (!PageValidate.IsDecimal(txtAddPrices.Text))
            {
                strErr += "AddPrices不是数字!\\n";
            }
            if (!PageValidate.IsDecimal(txtCurPrice.Text))
            {
                strErr += "CurPrice不是数字!\\n";
            }
            if (this.txtBrief.Text == "")
            {
                strErr += "Brief不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtStartTime.Text))
            {
                strErr += "StartTime不是时间格式!\\n";
            }
            if (!PageValidate.IsDateTime(txtEndTime.Text))
            {
                strErr += "EndTime不是时间格式!\\n";
            }
            if (!PageValidate.IsNumber(txtStatus.Text))
            {
                strErr += "Status不是数字!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   ProductName = this.txtProductName.Text;
            string   SmallIamge  = this.txtSmallIamge.Text;
            string   MediumImage = this.txtMediumImage.Text;
            string   OutLinkUrl  = this.txtOutLinkUrl.Text;
            decimal  StartPrice  = decimal.Parse(this.txtStartPrice.Text);
            decimal  AddPrices   = decimal.Parse(this.txtAddPrices.Text);
            decimal  CurPrice    = decimal.Parse(this.txtCurPrice.Text);
            string   Brief       = this.txtBrief.Text;
            DateTime StartTime   = DateTime.Parse(this.txtStartTime.Text);
            DateTime EndTime     = DateTime.Parse(this.txtEndTime.Text);
            int      Status      = int.Parse(this.txtStatus.Text);


            NoName.NetShop.Model.ActionProductModel model = new NoName.NetShop.Model.ActionProductModel();
            model.ProductName = ProductName;
            model.SmallIamge  = SmallIamge;
            model.MediumImage = MediumImage;
            model.OutLinkUrl  = OutLinkUrl;
            model.StartPrice  = StartPrice;
            model.AddPrices   = AddPrices;
            model.CurPrice    = CurPrice;
            model.Brief       = Brief;
            model.StartTime   = StartTime;
            model.EndTime     = EndTime;
            model.Status      = Status;

            NoName.NetShop.BLL.ActionProductModelBll bll = new NoName.NetShop.BLL.ActionProductModelBll();
            bll.Update(model);
        }
Exemplo n.º 4
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtProductName.Text =="")
            {
            strErr+="ProductName����Ϊ�գ�\\n";
            }
            if(this.txtSmallIamge.Text =="")
            {
            strErr+="SmallIamge����Ϊ�գ�\\n";
            }
            if(this.txtMediumImage.Text =="")
            {
            strErr+="MediumImage����Ϊ�գ�\\n";
            }
            if(this.txtOutLinkUrl.Text =="")
            {
            strErr+="OutLinkUrl����Ϊ�գ�\\n";
            }
            if(!PageValidate.IsDecimal(txtStartPrice.Text))
            {
            strErr+="StartPrice�������֣�\\n";
            }
            if(!PageValidate.IsDecimal(txtAddPrices.Text))
            {
            strErr+="AddPrices�������֣�\\n";
            }
            if(!PageValidate.IsDecimal(txtCurPrice.Text))
            {
            strErr+="CurPrice�������֣�\\n";
            }
            if(this.txtBrief.Text =="")
            {
            strErr+="Brief����Ϊ�գ�\\n";
            }
            if(!PageValidate.IsDateTime(txtStartTime.Text))
            {
            strErr+="StartTime����ʱ���ʽ��\\n";
            }
            if(!PageValidate.IsDateTime(txtEndTime.Text))
            {
            strErr+="EndTime����ʱ���ʽ��\\n";
            }
            if(!PageValidate.IsNumber(txtStatus.Text))
            {
            strErr+="Status�������֣�\\n";
            }

            if(strErr!="")
            {
            MessageBox.Show(this,strErr);
            return;
            }
            string ProductName=this.txtProductName.Text;
            string SmallIamge=this.txtSmallIamge.Text;
            string MediumImage=this.txtMediumImage.Text;
            string OutLinkUrl=this.txtOutLinkUrl.Text;
            decimal StartPrice=decimal.Parse(this.txtStartPrice.Text);
            decimal AddPrices=decimal.Parse(this.txtAddPrices.Text);
            decimal CurPrice=decimal.Parse(this.txtCurPrice.Text);
            string Brief=this.txtBrief.Text;
            DateTime StartTime=DateTime.Parse(this.txtStartTime.Text);
            DateTime EndTime=DateTime.Parse(this.txtEndTime.Text);
            int Status=int.Parse(this.txtStatus.Text);

            NoName.NetShop.Model.ActionProductModel model=new NoName.NetShop.Model.ActionProductModel();
            model.ProductName=ProductName;
            model.SmallIamge=SmallIamge;
            model.MediumImage=MediumImage;
            model.OutLinkUrl=OutLinkUrl;
            model.StartPrice=StartPrice;
            model.AddPrices=AddPrices;
            model.CurPrice=CurPrice;
            model.Brief=Brief;
            model.StartTime=StartTime;
            model.EndTime=EndTime;
            model.Status=Status;

            NoName.NetShop.BLL.ActionProductModelBll bll=new NoName.NetShop.BLL.ActionProductModelBll();
            bll.Add(model);
        }