/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Maticsoft.Model.T_MaintainRecord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update T_MaintainRecord set ");
            strSql.Append("PointID=@PointID,");
            strSql.Append("MaintainType=@MaintainType,");
            strSql.Append("StartTime=@StartTime,");
            strSql.Append("EndTime=@EndTime,");
            strSql.Append("SpentTime=@SpentTime,");
            strSql.Append("LastMaintainTime=@LastMaintainTime,");
            strSql.Append("Content=@Content,");
            strSql.Append("WriteTime=@WriteTime,");
            strSql.Append("WritePerson=@WritePerson");
            strSql.Append(" where Id=@Id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PointID",          SqlDbType.Int,         4),
                new SqlParameter("@MaintainType",     SqlDbType.NVarChar,   25),
                new SqlParameter("@StartTime",        SqlDbType.DateTime),
                new SqlParameter("@EndTime",          SqlDbType.DateTime),
                new SqlParameter("@SpentTime",        SqlDbType.Float,       8),
                new SqlParameter("@LastMaintainTime", SqlDbType.DateTime),
                new SqlParameter("@Content",          SqlDbType.NVarChar,   -1),
                new SqlParameter("@WriteTime",        SqlDbType.DateTime),
                new SqlParameter("@WritePerson",      SqlDbType.NVarChar,  100),
                new SqlParameter("@Id",               SqlDbType.Int, 4)
            };
            parameters[0].Value = model.PointID;
            parameters[1].Value = model.MaintainType;
            parameters[2].Value = model.StartTime;
            parameters[3].Value = model.EndTime;
            parameters[4].Value = model.SpentTime;
            parameters[5].Value = model.LastMaintainTime;
            parameters[6].Value = model.Content;
            parameters[7].Value = model.WriteTime;
            parameters[8].Value = model.WritePerson;
            parameters[9].Value = model.Id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.T_MaintainRecord DataRowToModel(DataRow row)
 {
     Maticsoft.Model.T_MaintainRecord model = new Maticsoft.Model.T_MaintainRecord();
     if (row != null)
     {
         if (row["Id"] != null && row["Id"].ToString() != "")
         {
             model.Id = int.Parse(row["Id"].ToString());
         }
         if (row["PointID"] != null && row["PointID"].ToString() != "")
         {
             model.PointID = int.Parse(row["PointID"].ToString());
         }
         if (row["MaintainType"] != null)
         {
             model.MaintainType = row["MaintainType"].ToString();
         }
         if (row["StartTime"] != null && row["StartTime"].ToString() != "")
         {
             model.StartTime = DateTime.Parse(row["StartTime"].ToString());
         }
         if (row["EndTime"] != null && row["EndTime"].ToString() != "")
         {
             model.EndTime = DateTime.Parse(row["EndTime"].ToString());
         }
         if (row["SpentTime"] != null && row["SpentTime"].ToString() != "")
         {
             model.SpentTime = decimal.Parse(row["SpentTime"].ToString());
         }
         if (row["LastMaintainTime"] != null && row["LastMaintainTime"].ToString() != "")
         {
             model.LastMaintainTime = DateTime.Parse(row["LastMaintainTime"].ToString());
         }
         if (row["Content"] != null)
         {
             model.Content = row["Content"].ToString();
         }
         if (row["WriteTime"] != null && row["WriteTime"].ToString() != "")
         {
             model.WriteTime = DateTime.Parse(row["WriteTime"].ToString());
         }
         if (row["WritePerson"] != null)
         {
             model.WritePerson = row["WritePerson"].ToString();
         }
     }
     return(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Maticsoft.Model.T_MaintainRecord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into T_MaintainRecord(");
            strSql.Append("Id,PointID,MaintainType,StartTime,EndTime,SpentTime,LastMaintainTime,Content,WriteTime,WritePerson)");
            strSql.Append(" values (");
            strSql.Append("@Id,@PointID,@MaintainType,@StartTime,@EndTime,@SpentTime,@LastMaintainTime,@Content,@WriteTime,@WritePerson)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id",               SqlDbType.Int,        4),
                new SqlParameter("@PointID",          SqlDbType.Int,        4),
                new SqlParameter("@MaintainType",     SqlDbType.NVarChar,  25),
                new SqlParameter("@StartTime",        SqlDbType.DateTime),
                new SqlParameter("@EndTime",          SqlDbType.DateTime),
                new SqlParameter("@SpentTime",        SqlDbType.Float,      8),
                new SqlParameter("@LastMaintainTime", SqlDbType.DateTime),
                new SqlParameter("@Content",          SqlDbType.NVarChar,  -1),
                new SqlParameter("@WriteTime",        SqlDbType.DateTime),
                new SqlParameter("@WritePerson",      SqlDbType.NVarChar, 100)
            };
            parameters[0].Value = model.Id;
            parameters[1].Value = model.PointID;
            parameters[2].Value = model.MaintainType;
            parameters[3].Value = model.StartTime;
            parameters[4].Value = model.EndTime;
            parameters[5].Value = model.SpentTime;
            parameters[6].Value = model.LastMaintainTime;
            parameters[7].Value = model.Content;
            parameters[8].Value = model.WriteTime;
            parameters[9].Value = model.WritePerson;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.T_MaintainRecord GetModel(int Id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 Id,PointID,MaintainType,StartTime,EndTime,SpentTime,LastMaintainTime,Content,WriteTime,WritePerson from T_MaintainRecord ");
            strSql.Append(" where Id=@Id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id", SqlDbType.Int, 4)
            };
            parameters[0].Value = Id;

            Maticsoft.Model.T_MaintainRecord model = new Maticsoft.Model.T_MaintainRecord();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }