Example #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()));
        }
Example #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())));
        }
Example #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);
        }
Example #4
0
 public int update(Model.tab_paras paras)
 {
     return(itu.update(paras));
 }
Example #5
0
 public Model.tab_paras getparas(Model.tab_paras paras1)
 {
     return(itu.getparas(paras1));
 }
Example #6
0
 public int Add(Model.tab_paras paras)
 {
     return(itu.Add(paras));
 }