コード例 #1
0
 private void ShowInfo(int ProductId)
 {
     NoName.NetShop.BLL.ProductModelBll bll   = new NoName.NetShop.BLL.ProductModelBll();
     NoName.NetShop.Model.ProductModel  model = bll.GetModel(ProductId);
     this.lblProductId.Text     = model.ProductId.ToString();
     this.txtProductName.Text   = model.ProductName;
     this.txtProductCode.Text   = model.ProductCode;
     this.txtCatePath.Text      = model.CatePath;
     this.txtCateId.Text        = model.CateId.ToString();
     this.txtTradePrice.Text    = model.TradePrice.ToString();
     this.txtMerchantPrice.Text = model.MerchantPrice.ToString();
     this.txtReducePrice.Text   = model.ReducePrice.ToString();
     this.txtStock.Text         = model.Stock.ToString();
     this.txtSmallImage.Text    = model.SmallImage;
     this.txtMediumImage.Text   = model.MediumImage;
     this.txtLargeImage.Text    = model.LargeImage;
     this.txtKeywords.Text      = model.Keywords;
     this.txtBrief.Text         = model.Brief;
     this.txtPageView.Text      = model.PageView.ToString();
     this.txtInsertTime.Text    = model.InsertTime.ToString();
     this.txtChangeTime.Text    = model.ChangeTime.ToString();
     this.txtStatus.Text        = model.Status.ToString();
     this.txtSortValue.Text     = model.SortValue.ToString();
     this.txtScore.Text         = model.Score.ToString();
 }
コード例 #2
0
 private void ShowInfo(int ProductId)
 {
     NoName.NetShop.BLL.ProductModelBll bll=new NoName.NetShop.BLL.ProductModelBll();
     NoName.NetShop.Model.ProductModel model=bll.GetModel(ProductId);
     this.lblProductName.Text=model.ProductName;
     this.lblProductCode.Text=model.ProductCode;
     this.lblCatePath.Text=model.CatePath;
     this.lblCateId.Text=model.CateId.ToString();
     this.lblTradePrice.Text=model.TradePrice.ToString();
     this.lblMerchantPrice.Text=model.MerchantPrice.ToString();
     this.lblReducePrice.Text=model.ReducePrice.ToString();
     this.lblStock.Text=model.Stock.ToString();
     this.lblSmallImage.Text=model.SmallImage;
     this.lblMediumImage.Text=model.MediumImage;
     this.lblLargeImage.Text=model.LargeImage;
     this.lblKeywords.Text=model.Keywords;
     this.lblBrief.Text=model.Brief;
     this.lblPageView.Text=model.PageView.ToString();
     this.lblInsertTime.Text=model.InsertTime.ToString();
     this.lblChangeTime.Text=model.ChangeTime.ToString();
     this.lblStatus.Text=model.Status.ToString();
     this.lblSortValue.Text=model.SortValue.ToString();
     this.lblScore.Text=model.Score.ToString();
 }
コード例 #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtProductName.Text =="")
            {
            strErr+="ProductName����Ϊ�գ�\\n";
            }
            if(this.txtProductCode.Text =="")
            {
            strErr+="ProductCode����Ϊ�գ�\\n";
            }
            if(this.txtCatePath.Text =="")
            {
            strErr+="CatePath����Ϊ�գ�\\n";
            }
            if(!PageValidate.IsNumber(txtCateId.Text))
            {
            strErr+="CateId�������֣�\\n";
            }
            if(!PageValidate.IsDecimal(txtTradePrice.Text))
            {
            strErr+="TradePrice�������֣�\\n";
            }
            if(!PageValidate.IsDecimal(txtMerchantPrice.Text))
            {
            strErr+="MerchantPrice�������֣�\\n";
            }
            if(!PageValidate.IsDecimal(txtReducePrice.Text))
            {
            strErr+="ReducePrice�������֣�\\n";
            }
            if(!PageValidate.IsNumber(txtStock.Text))
            {
            strErr+="Stock�������֣�\\n";
            }
            if(this.txtSmallImage.Text =="")
            {
            strErr+="SmallImage����Ϊ�գ�\\n";
            }
            if(this.txtMediumImage.Text =="")
            {
            strErr+="MediumImage����Ϊ�գ�\\n";
            }
            if(this.txtLargeImage.Text =="")
            {
            strErr+="LargeImage����Ϊ�գ�\\n";
            }
            if(this.txtKeywords.Text =="")
            {
            strErr+="Keywords����Ϊ�գ�\\n";
            }
            if(this.txtBrief.Text =="")
            {
            strErr+="Brief����Ϊ�գ�\\n";
            }
            if(!PageValidate.IsNumber(txtPageView.Text))
            {
            strErr+="PageView�������֣�\\n";
            }
            if(!PageValidate.IsDateTime(txtInsertTime.Text))
            {
            strErr+="InsertTime����ʱ���ʽ��\\n";
            }
            if(!PageValidate.IsDateTime(txtChangeTime.Text))
            {
            strErr+="ChangeTime����ʱ���ʽ��\\n";
            }
            if(!PageValidate.IsNumber(txtStatus.Text))
            {
            strErr+="Status�������֣�\\n";
            }
            if(!PageValidate.IsNumber(txtSortValue.Text))
            {
            strErr+="SortValue�������֣�\\n";
            }
            if(!PageValidate.IsNumber(txtScore.Text))
            {
            strErr+="Score�������֣�\\n";
            }

            if(strErr!="")
            {
            MessageBox.Show(this,strErr);
            return;
            }
            string ProductName=this.txtProductName.Text;
            string ProductCode=this.txtProductCode.Text;
            string CatePath=this.txtCatePath.Text;
            int CateId=int.Parse(this.txtCateId.Text);
            decimal TradePrice=decimal.Parse(this.txtTradePrice.Text);
            decimal MerchantPrice=decimal.Parse(this.txtMerchantPrice.Text);
            decimal ReducePrice=decimal.Parse(this.txtReducePrice.Text);
            int Stock=int.Parse(this.txtStock.Text);
            string SmallImage=this.txtSmallImage.Text;
            string MediumImage=this.txtMediumImage.Text;
            string LargeImage=this.txtLargeImage.Text;
            string Keywords=this.txtKeywords.Text;
            string Brief=this.txtBrief.Text;
            int PageView=int.Parse(this.txtPageView.Text);
            DateTime InsertTime=DateTime.Parse(this.txtInsertTime.Text);
            DateTime ChangeTime=DateTime.Parse(this.txtChangeTime.Text);
            int Status=int.Parse(this.txtStatus.Text);
            int SortValue=int.Parse(this.txtSortValue.Text);
            int Score=int.Parse(this.txtScore.Text);

            NoName.NetShop.Model.ProductModel model=new NoName.NetShop.Model.ProductModel();
            model.ProductName=ProductName;
            model.ProductCode=ProductCode;
            model.CatePath=CatePath;
            model.CateId=CateId;
            model.TradePrice=TradePrice;
            model.MerchantPrice=MerchantPrice;
            model.ReducePrice=ReducePrice;
            model.Stock=Stock;
            model.SmallImage=SmallImage;
            model.MediumImage=MediumImage;
            model.LargeImage=LargeImage;
            model.Keywords=Keywords;
            model.Brief=Brief;
            model.PageView=PageView;
            model.InsertTime=InsertTime;
            model.ChangeTime=ChangeTime;
            model.Status=Status;
            model.SortValue=SortValue;
            model.Score=Score;

            NoName.NetShop.BLL.ProductModelBll bll=new NoName.NetShop.BLL.ProductModelBll();
            bll.Update(model);
        }
コード例 #4
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtProductName.Text == "")
            {
                strErr += "ProductName不能为空!\\n";
            }
            if (this.txtProductCode.Text == "")
            {
                strErr += "ProductCode不能为空!\\n";
            }
            if (this.txtCatePath.Text == "")
            {
                strErr += "CatePath不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtCateId.Text))
            {
                strErr += "CateId不是数字!\\n";
            }
            if (!PageValidate.IsDecimal(txtTradePrice.Text))
            {
                strErr += "TradePrice不是数字!\\n";
            }
            if (!PageValidate.IsDecimal(txtMerchantPrice.Text))
            {
                strErr += "MerchantPrice不是数字!\\n";
            }
            if (!PageValidate.IsDecimal(txtReducePrice.Text))
            {
                strErr += "ReducePrice不是数字!\\n";
            }
            if (!PageValidate.IsNumber(txtStock.Text))
            {
                strErr += "Stock不是数字!\\n";
            }
            if (this.txtSmallImage.Text == "")
            {
                strErr += "SmallImage不能为空!\\n";
            }
            if (this.txtMediumImage.Text == "")
            {
                strErr += "MediumImage不能为空!\\n";
            }
            if (this.txtLargeImage.Text == "")
            {
                strErr += "LargeImage不能为空!\\n";
            }
            if (this.txtKeywords.Text == "")
            {
                strErr += "Keywords不能为空!\\n";
            }
            if (this.txtBrief.Text == "")
            {
                strErr += "Brief不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtPageView.Text))
            {
                strErr += "PageView不是数字!\\n";
            }
            if (!PageValidate.IsDateTime(txtInsertTime.Text))
            {
                strErr += "InsertTime不是时间格式!\\n";
            }
            if (!PageValidate.IsDateTime(txtChangeTime.Text))
            {
                strErr += "ChangeTime不是时间格式!\\n";
            }
            if (!PageValidate.IsNumber(txtStatus.Text))
            {
                strErr += "Status不是数字!\\n";
            }
            if (!PageValidate.IsNumber(txtSortValue.Text))
            {
                strErr += "SortValue不是数字!\\n";
            }
            if (!PageValidate.IsNumber(txtScore.Text))
            {
                strErr += "Score不是数字!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   ProductName   = this.txtProductName.Text;
            string   ProductCode   = this.txtProductCode.Text;
            string   CatePath      = this.txtCatePath.Text;
            int      CateId        = int.Parse(this.txtCateId.Text);
            decimal  TradePrice    = decimal.Parse(this.txtTradePrice.Text);
            decimal  MerchantPrice = decimal.Parse(this.txtMerchantPrice.Text);
            decimal  ReducePrice   = decimal.Parse(this.txtReducePrice.Text);
            int      Stock         = int.Parse(this.txtStock.Text);
            string   SmallImage    = this.txtSmallImage.Text;
            string   MediumImage   = this.txtMediumImage.Text;
            string   LargeImage    = this.txtLargeImage.Text;
            string   Keywords      = this.txtKeywords.Text;
            string   Brief         = this.txtBrief.Text;
            int      PageView      = int.Parse(this.txtPageView.Text);
            DateTime InsertTime    = DateTime.Parse(this.txtInsertTime.Text);
            DateTime ChangeTime    = DateTime.Parse(this.txtChangeTime.Text);
            int      Status        = int.Parse(this.txtStatus.Text);
            int      SortValue     = int.Parse(this.txtSortValue.Text);
            int      Score         = int.Parse(this.txtScore.Text);


            NoName.NetShop.Model.ProductModel model = new NoName.NetShop.Model.ProductModel();
            model.ProductName   = ProductName;
            model.ProductCode   = ProductCode;
            model.CatePath      = CatePath;
            model.CateId        = CateId;
            model.TradePrice    = TradePrice;
            model.MerchantPrice = MerchantPrice;
            model.ReducePrice   = ReducePrice;
            model.Stock         = Stock;
            model.SmallImage    = SmallImage;
            model.MediumImage   = MediumImage;
            model.LargeImage    = LargeImage;
            model.Keywords      = Keywords;
            model.Brief         = Brief;
            model.PageView      = PageView;
            model.InsertTime    = InsertTime;
            model.ChangeTime    = ChangeTime;
            model.Status        = Status;
            model.SortValue     = SortValue;
            model.Score         = Score;

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