Exemplo n.º 1
0
 /// <summary>
 /// 更新t_SysPara
 /// </summary>
 public virtual bool Update(SysParaOR sysPara)
 {
     string sql = "update t_SysPara set  ValStr = @ValStr where  KeyStr = @KeyStr";
     SqlParameter[] parameters = new SqlParameter[]
     {
         new SqlParameter("@KeyStr", SqlDbType.NVarChar, 1000, ParameterDirection.Input, false, 0, 0, "KeyStr", DataRowVersion.Default, sysPara.Keystr),
         new SqlParameter("@ValStr", SqlDbType.NVarChar, 1000, ParameterDirection.Input, false, 0, 0, "ValStr", DataRowVersion.Default, sysPara.Valstr)
     };
     return db.ExecuteNoQuery(sql, parameters) > -1;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 插入t_SysPara
 /// </summary>
 public virtual bool Insert(SysParaOR sysPara)
 {
     string sql = "insert into t_SysPara (KeyStr, ValStr) values (@KeyStr, @ValStr)";
     SqlParameter[] parameters = new SqlParameter[]
     {
         new SqlParameter("@KeyStr", SqlDbType.NVarChar, 1000, ParameterDirection.Input, false, 0, 0, "KeyStr", DataRowVersion.Default, sysPara.Keystr),
         new SqlParameter("@ValStr", SqlDbType.NVarChar, 1000, ParameterDirection.Input, false, 0, 0, "ValStr", DataRowVersion.Default, sysPara.Valstr)
     };
     return db.ExecuteNoQuery(sql, parameters) > -1;
 }
Exemplo n.º 3
0
 public SysParaOR selectARowDate(string m_id)
 {
     string sql = string.Format("select * from t_SysPara where  Keystr='{0}'", m_id);
     DataTable dt = null;
     try
     {
         dt = db.ExecuteQueryDataSet(sql).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     if (dt == null)
         return null;
     if (dt.Rows.Count == 0)
         return null;
     DataRow dr = dt.Rows[0];
     SysParaOR m_SysP = new SysParaOR(dr);
     return m_SysP;
 }
 protected void btnAlertDefult_Click(object sender, EventArgs e)
 {
     SysParaOR  obj=new SysParaOR();
     obj.Keystr = "defaultSmsMsg";
     obj.Valstr=txt_defaultSmsMsg.Text;
     try
     {
         new SysParaDA().Update(obj);
     }
     catch(Exception ex)
     {
         Alert(ex);
     }
 }