/// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public NoName.NetShop.Model.CategoryParaModel ReaderBind(IDataReader dataReader)
        {
            NoName.NetShop.Model.CategoryParaModel model = new NoName.NetShop.Model.CategoryParaModel();
            object ojb;

            ojb = dataReader["ParaId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ParaId = (int)ojb;
            }
            ojb = dataReader["CateId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CateId = (int)ojb;
            }
            model.ParaName = dataReader["ParaName"].ToString();
            ojb            = dataReader["ParaType"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ParaType = (int)ojb;
            }
            ojb = dataReader["Status"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Status = (int)ojb;
            }
            ojb = dataReader["ParaGroupId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ParaGroupId = (int)ojb;
            }
            model.ParaValues   = dataReader["ParaValues"].ToString();
            model.DefaultValue = dataReader["DefaultValue"].ToString();
            return(model);
        }
		protected void btnAdd_Click(object sender, EventArgs e)
		{
			
	string strErr="";
	if(!PageValidate.IsNumber(txtCateId.Text))
	{
		strErr+="CateId不是数字!\\n";	
	}
	if(this.txtParaName.Text =="")
	{
		strErr+="ParaName不能为空!\\n";	
	}
	if(!PageValidate.IsNumber(txtParaType.Text))
	{
		strErr+="ParaType不是数字!\\n";	
	}
	if(!PageValidate.IsNumber(txtStatus.Text))
	{
		strErr+="Status不是数字!\\n";	
	}
	if(!PageValidate.IsNumber(txtParaGroupId.Text))
	{
		strErr+="ParaGroupId不是数字!\\n";	
	}
	if(this.txtParaValues.Text =="")
	{
		strErr+="ParaValues不能为空!\\n";	
	}
	if(this.txtDefaultValue.Text =="")
	{
		strErr+="DefaultValue不能为空!\\n";	
	}

	if(strErr!="")
	{
		MessageBox.Show(this,strErr);
		return;
	}
	int CateId=int.Parse(this.txtCateId.Text);
	string ParaName=this.txtParaName.Text;
	int ParaType=int.Parse(this.txtParaType.Text);
	int Status=int.Parse(this.txtStatus.Text);
	int ParaGroupId=int.Parse(this.txtParaGroupId.Text);
	string ParaValues=this.txtParaValues.Text;
	string DefaultValue=this.txtDefaultValue.Text;


	NoName.NetShop.Model.CategoryParaModel model=new NoName.NetShop.Model.CategoryParaModel();
	model.CateId=CateId;
	model.ParaName=ParaName;
	model.ParaType=ParaType;
	model.Status=Status;
	model.ParaGroupId=ParaGroupId;
	model.ParaValues=ParaValues;
	model.DefaultValue=DefaultValue;

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

		}
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtCateId.Text))
            {
            strErr+="CateId�������֣�\\n";
            }
            if(this.txtParaName.Text =="")
            {
            strErr+="ParaName����Ϊ�գ�\\n";
            }
            if(!PageValidate.IsNumber(txtParaType.Text))
            {
            strErr+="ParaType�������֣�\\n";
            }
            if(!PageValidate.IsNumber(txtStatus.Text))
            {
            strErr+="Status�������֣�\\n";
            }
            if(!PageValidate.IsNumber(txtParaGroupId.Text))
            {
            strErr+="ParaGroupId�������֣�\\n";
            }
            if(this.txtParaValues.Text =="")
            {
            strErr+="ParaValues����Ϊ�գ�\\n";
            }
            if(this.txtDefaultValue.Text =="")
            {
            strErr+="DefaultValue����Ϊ�գ�\\n";
            }

            if(strErr!="")
            {
            MessageBox.Show(this,strErr);
            return;
            }
            int CateId=int.Parse(this.txtCateId.Text);
            string ParaName=this.txtParaName.Text;
            int ParaType=int.Parse(this.txtParaType.Text);
            int Status=int.Parse(this.txtStatus.Text);
            int ParaGroupId=int.Parse(this.txtParaGroupId.Text);
            string ParaValues=this.txtParaValues.Text;
            string DefaultValue=this.txtDefaultValue.Text;

            NoName.NetShop.Model.CategoryParaModel model=new NoName.NetShop.Model.CategoryParaModel();
            model.CateId=CateId;
            model.ParaName=ParaName;
            model.ParaType=ParaType;
            model.Status=Status;
            model.ParaGroupId=ParaGroupId;
            model.ParaValues=ParaValues;
            model.DefaultValue=DefaultValue;

            NoName.NetShop.BLL.CategoryParaModelBll bll=new NoName.NetShop.BLL.CategoryParaModelBll();
            bll.Add(model);
        }
 private void ShowInfo(int ParaId)
 {
     NoName.NetShop.BLL.CategoryParaModelBll bll   = new NoName.NetShop.BLL.CategoryParaModelBll();
     NoName.NetShop.Model.CategoryParaModel  model = bll.GetModel(ParaId);
     this.lblCateId.Text       = model.CateId.ToString();
     this.lblParaName.Text     = model.ParaName;
     this.lblParaType.Text     = model.ParaType.ToString();
     this.lblStatus.Text       = model.Status.ToString();
     this.lblParaGroupId.Text  = model.ParaGroupId.ToString();
     this.lblParaValues.Text   = model.ParaValues;
     this.lblDefaultValue.Text = model.DefaultValue;
 }
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(NoName.NetShop.Model.CategoryParaModel model)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("UP_pdCategoryPara_Update");

            db.AddInParameter(dbCommand, "ParaId", DbType.Int32, model.ParaId);
            db.AddInParameter(dbCommand, "CateId", DbType.Int32, model.CateId);
            db.AddInParameter(dbCommand, "ParaName", DbType.AnsiString, model.ParaName);
            db.AddInParameter(dbCommand, "ParaType", DbType.Byte, model.ParaType);
            db.AddInParameter(dbCommand, "Status", DbType.Byte, model.Status);
            db.AddInParameter(dbCommand, "ParaGroupId", DbType.Int32, model.ParaGroupId);
            db.AddInParameter(dbCommand, "ParaValues", DbType.AnsiString, model.ParaValues);
            db.AddInParameter(dbCommand, "DefaultValue", DbType.AnsiString, model.DefaultValue);
            db.ExecuteNonQuery(dbCommand);
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public NoName.NetShop.Model.CategoryParaModel GetModel(int ParaId)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("UP_pdCategoryPara_GetModel");

            db.AddInParameter(dbCommand, "ParaId", DbType.Int32, ParaId);

            NoName.NetShop.Model.CategoryParaModel model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
            }
            return(model);
        }
 /// <summary>
 /// ����ʵ�������
 /// </summary>
 public NoName.NetShop.Model.CategoryParaModel ReaderBind(IDataReader dataReader)
 {
     NoName.NetShop.Model.CategoryParaModel model=new NoName.NetShop.Model.CategoryParaModel();
     object ojb;
     ojb = dataReader["ParaId"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.ParaId=(int)ojb;
     }
     ojb = dataReader["CateId"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.CateId=(int)ojb;
     }
     model.ParaName=dataReader["ParaName"].ToString();
     ojb = dataReader["ParaType"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.ParaType=(int)ojb;
     }
     ojb = dataReader["Status"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.Status=(int)ojb;
     }
     ojb = dataReader["ParaGroupId"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.ParaGroupId=(int)ojb;
     }
     model.ParaValues=dataReader["ParaValues"].ToString();
     model.DefaultValue=dataReader["DefaultValue"].ToString();
     return model;
 }