Example #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtFpudf_Id.Text))
            {
                strErr+="Fpudf_Id格式错误!\\n";
            }
            if(this.txtMatchFields.Text.Trim().Length==0)
            {
                strErr+="MatchFields不能为空!\\n";
            }
            if(this.txtIsSearch.Text.Trim().Length==0)
            {
                strErr+="是否是检索值不能为空!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int Fpudf_Id=int.Parse(this.txtFpudf_Id.Text);
            string MatchFields=this.txtMatchFields.Text;
            string IsSearch=this.txtIsSearch.Text;

            RuRo.Model.Fp_UserFields_Match model=new RuRo.Model.Fp_UserFields_Match();
            model.Fpudf_Id=Fpudf_Id;
            model.MatchFields=MatchFields;
            model.IsSearch=IsSearch;

            RuRo.BLL.Fp_UserFields_Match bll=new RuRo.BLL.Fp_UserFields_Match();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }
Example #2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public RuRo.Model.Fp_UserFields_Match DataRowToModel(DataRow row)
 {
     RuRo.Model.Fp_UserFields_Match model=new RuRo.Model.Fp_UserFields_Match();
     if (row != null)
     {
         if(row["id"]!=null && row["id"].ToString()!="")
         {
             model.id=int.Parse(row["id"].ToString());
         }
         if(row["Fpudf_Id"]!=null && row["Fpudf_Id"].ToString()!="")
         {
             model.Fpudf_Id=int.Parse(row["Fpudf_Id"].ToString());
         }
         if(row["MatchFields"]!=null)
         {
             model.MatchFields=row["MatchFields"].ToString();
         }
         if(row["IsSearch"]!=null)
         {
             model.IsSearch=row["IsSearch"].ToString();
         }
     }
     return model;
 }
Example #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public RuRo.Model.Fp_UserFields_Match GetModel(int id)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 id,Fpudf_Id,MatchFields,IsSearch from Fp_UserFields_Match ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@id", SqlDbType.Int,4)
            };
            parameters[0].Value = id;

            RuRo.Model.Fp_UserFields_Match model=new RuRo.Model.Fp_UserFields_Match();
            DataSet ds=DbHelperSQL_SY.QuerySY(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }