///<summary>
 ///删除方法,返回Boolean类型,为true表示操作成功,否则操作失败
 ///生成时间:2010-10-10 21:28:26
 ///</summary>
 public Boolean DeleteServerByPK(object id)
 {
     MySqlParameter[] param = new MySqlParameter[] {
         new MySqlParameter("?ID", id)
     };
     return(MySqlHelper1.ExecuteNonQuery(SQL_DELETEBYPK, param) > 0);
 }
Beispiel #2
0
        /// <summary>
        /// 根据存储过程获得单个对象
        /// </summary>
        /// <param name="proc">存储过程名称</param>
        /// <param name="pas">参数数组</param>
        /// <returns>单个对象</returns>
        public static T GetSingleObjectByProc(string proc, params MySqlParameter[] pas)
        {
            DataTable dt = MySqlHelper1.ExecuteDataTableProc(proc, pas);
            IList <T> ts = ModelConvertHelper <T> .ConvertToModel(dt);

            return(ts.Count == 0 ? null : ts[0]);
        }
 ///<summary>
 ///添加方法,返回Boolean类型,为true表示操作成功,否则操作失败
 ///生成时间:2010-10-10 20:16:28
 ///</summary>
 public Boolean AddDomain(Domain domain)
 {
     MySqlParameter[] param = new MySqlParameter[] {
         new MySqlParameter("?DomainName", domain.DomainName),
         new MySqlParameter("?ismain", domain.Ismain),
         new MySqlParameter("?status", domain.Status),
         new MySqlParameter("?UpdateDate", domain.UpdateDate),
         new MySqlParameter("?AddDate", domain.AddDate)
     };
     return(MySqlHelper1.ExecuteNonQuery(SQL_INSERT, param) > 0);
 }
 /// <summary>
 /// 新增服务器
 /// 编写时间: 2010-12-11 22:00
 /// 创建者:Mickey
 /// </summary>
 /// <param name="server"></param>
 /// <returns></returns>
 public Boolean AddServer(Server server)
 {
     MySqlParameter[] param = new MySqlParameter[] {
         new MySqlParameter("?ServerName", server.ServerName),
         new MySqlParameter("?ip1", server.Ip1),
         new MySqlParameter("?ip2", server.Ip2),
         new MySqlParameter("?ip3", server.Ip3),
         new MySqlParameter("?SubDomain", server.SubDomain),
         new MySqlParameter("?OnlineNumber", server.OnlineNumber),
         new MySqlParameter("?Area", server.Area),
         new MySqlParameter("?status", server.Status),
         new MySqlParameter("?UpdateDate", server.UpdateDate),
         new MySqlParameter("?AddDate", server.AddDate),
         new MySqlParameter("?ReMark", server.ReMark)
     };
     return(MySqlHelper1.ExecuteNonQuery(SQL_INSERT, param) > 0);
 }
 ///<summary>
 ///获得所有数据,返回DataTable
 ///生成时间:2010-10-10 21:28:26
 ///</summary>
 public DataTable GetMutilDTServer()
 {
     return(MySqlHelper1.ExecuteDataTable(SQL_SELECTALL, null));
 }
Beispiel #6
0
        /// <summary>
        /// 根据存储过程获得某对象的集合
        /// </summary>
        /// <param name="proc">存储过程名称</param>
        /// <param name="pas">参数数组</param>
        /// <returns>对象集合</returns>
        public static IList <T> GetObjectsByProc(string proc, params MySqlParameter[] pas)
        {
            DataTable dt = MySqlHelper1.ExecuteDataTableProc(proc, pas);

            return(ModelConvertHelper <T> .ConvertToModel(dt));
        }