示例#1
0
        public int update(Model.tab_paras paras)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("update tab_paras set ");
            strsql.AppendFormat(" pname =N'{0}',", paras.pname);
            strsql.AppendFormat(" pvalue =N'{0}',", paras.pvalue);
            strsql.AppendFormat(" ptype =N'{0}'", paras.ptype);
            strsql.AppendFormat(" where id={0}", paras.id);
            return(sql.ExecuteNonQuery(strsql.ToString()));
        }
示例#2
0
        public int Add(Model.tab_paras paras)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("insert into tab_paras values (");
            strsql.AppendFormat("N'{0}',", paras.pname);
            strsql.AppendFormat("N'{0}',", paras.pvalue);
            strsql.AppendFormat("N'{0}'", paras.ptype);
            strsql.Append(") select SCOPE_IDENTITY()");
            return(Convert.ToInt32(sql.ExecuteSc(strsql.ToString())));
        }
示例#3
0
        public Model.tab_paras getparas(Model.tab_paras paras1)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("select * from tab_paras where ");
            strsql.AppendFormat("id='{0}'", paras1.id);
            DataTable dt = sql.ExecuteDataSet(strsql.ToString()).Tables[0];

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            Model.tab_paras paras = new Model.tab_paras();
            paras.id     = paras1.id;
            paras.pname  = dt.Rows[0]["pname"].ToString();
            paras.pvalue = dt.Rows[0]["pvalue"].ToString();
            paras.ptype  = dt.Rows[0]["ptype"].ToString();
            return(paras);
        }
示例#4
0
 public int update(Model.tab_paras paras)
 {
     return(itu.update(paras));
 }
示例#5
0
 public Model.tab_paras getparas(Model.tab_paras paras1)
 {
     return(itu.getparas(paras1));
 }
示例#6
0
 public int Add(Model.tab_paras paras)
 {
     return(itu.Add(paras));
 }