private void ShowInfo(int ImageId)
 {
     NoName.NetShop.BLL.ProductImageModelBll bll=new NoName.NetShop.BLL.ProductImageModelBll();
     NoName.NetShop.Model.ProductImageModel model=bll.GetModel(ImageId);
     this.lblProductId.Text=model.ProductId.ToString();
     this.lblSmallImage.Text=model.SmallImage;
     this.lblLargeImage.Text=model.LargeImage;
     this.lblOriginImage.Text=model.OriginImage;
     this.lblTitle.Text=model.Title;
 }
Esempio n. 2
0
 private void ShowInfo(int ImageId)
 {
     NoName.NetShop.BLL.ProductImageModelBll bll   = new NoName.NetShop.BLL.ProductImageModelBll();
     NoName.NetShop.Model.ProductImageModel  model = bll.GetModel(ImageId);
     this.lblProductId.Text   = model.ProductId.ToString();
     this.lblSmallImage.Text  = model.SmallImage;
     this.lblLargeImage.Text  = model.LargeImage;
     this.lblOriginImage.Text = model.OriginImage;
     this.lblTitle.Text       = model.Title;
 }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtProductId.Text))
            {
                strErr += "ProductId不是数字!\\n";
            }
            if (this.txtSmallImage.Text == "")
            {
                strErr += "SmallImage不能为空!\\n";
            }
            if (this.txtLargeImage.Text == "")
            {
                strErr += "LargeImage不能为空!\\n";
            }
            if (this.txtOriginImage.Text == "")
            {
                strErr += "OriginImage不能为空!\\n";
            }
            if (this.txtTitle.Text == "")
            {
                strErr += "Title不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    ProductId   = int.Parse(this.txtProductId.Text);
            string SmallImage  = this.txtSmallImage.Text;
            string LargeImage  = this.txtLargeImage.Text;
            string OriginImage = this.txtOriginImage.Text;
            string Title       = this.txtTitle.Text;


            NoName.NetShop.Model.ProductImageModel model = new NoName.NetShop.Model.ProductImageModel();
            model.ProductId   = ProductId;
            model.SmallImage  = SmallImage;
            model.LargeImage  = LargeImage;
            model.OriginImage = OriginImage;
            model.Title       = Title;

            NoName.NetShop.BLL.ProductImageModelBll bll = new NoName.NetShop.BLL.ProductImageModelBll();
            bll.Update(model);
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtProductId.Text))
            {
            strErr+="ProductId�������֣�\\n";
            }
            if(this.txtSmallImage.Text =="")
            {
            strErr+="SmallImage����Ϊ�գ�\\n";
            }
            if(this.txtLargeImage.Text =="")
            {
            strErr+="LargeImage����Ϊ�գ�\\n";
            }
            if(this.txtOriginImage.Text =="")
            {
            strErr+="OriginImage����Ϊ�գ�\\n";
            }
            if(this.txtTitle.Text =="")
            {
            strErr+="Title����Ϊ�գ�\\n";
            }

            if(strErr!="")
            {
            MessageBox.Show(this,strErr);
            return;
            }
            int ProductId=int.Parse(this.txtProductId.Text);
            string SmallImage=this.txtSmallImage.Text;
            string LargeImage=this.txtLargeImage.Text;
            string OriginImage=this.txtOriginImage.Text;
            string Title=this.txtTitle.Text;

            NoName.NetShop.Model.ProductImageModel model=new NoName.NetShop.Model.ProductImageModel();
            model.ProductId=ProductId;
            model.SmallImage=SmallImage;
            model.LargeImage=LargeImage;
            model.OriginImage=OriginImage;
            model.Title=Title;

            NoName.NetShop.BLL.ProductImageModelBll bll=new NoName.NetShop.BLL.ProductImageModelBll();
            bll.Update(model);
        }