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

            strSql.Append("update Holiday set ");
            strSql.Append("HolidayName=@HolidayName,");
            strSql.Append("UserGroupID=@UserGroupID,");
            strSql.Append("HolidayType=@HolidayType,");
            strSql.Append("HolidayStartDate=@HolidayStartDate,");
            strSql.Append("HolidayEndDate=@HolidayEndDate,");
            strSql.Append("TimeZoneID=@TimeZoneID");
            strSql.Append(" where HolidayID=@HolidayID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@HolidayName",      SqlDbType.NVarChar, 50),
                new SqlParameter("@UserGroupID",      SqlDbType.Int,       4),
                new SqlParameter("@HolidayType",      SqlDbType.Int,       4),
                new SqlParameter("@HolidayStartDate", SqlDbType.NVarChar, 10),
                new SqlParameter("@HolidayEndDate",   SqlDbType.NVarChar, 10),
                new SqlParameter("@TimeZoneID",       SqlDbType.Int,       4),
                new SqlParameter("@HolidayID",        SqlDbType.Int, 4)
            };
            parameters[0].Value = model.HolidayName;
            parameters[1].Value = model.UserGroupID;
            parameters[2].Value = model.HolidayType;
            parameters[3].Value = model.HolidayStartDate;
            parameters[4].Value = model.HolidayEndDate;
            parameters[5].Value = model.TimeZoneID;
            parameters[6].Value = model.HolidayID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public KryptonAccessController.AccessDataBase.Model.Holiday DataRowToModel(DataRow row)
 {
     KryptonAccessController.AccessDataBase.Model.Holiday model = new KryptonAccessController.AccessDataBase.Model.Holiday();
     if (row != null)
     {
         if (row["HolidayID"] != null && row["HolidayID"].ToString() != "")
         {
             model.HolidayID = int.Parse(row["HolidayID"].ToString());
         }
         if (row["HolidayName"] != null)
         {
             model.HolidayName = row["HolidayName"].ToString();
         }
         if (row["UserGroupID"] != null && row["UserGroupID"].ToString() != "")
         {
             model.UserGroupID = int.Parse(row["UserGroupID"].ToString());
         }
         if (row["HolidayType"] != null && row["HolidayType"].ToString() != "")
         {
             model.HolidayType = int.Parse(row["HolidayType"].ToString());
         }
         if (row["HolidayStartDate"] != null)
         {
             model.HolidayStartDate = row["HolidayStartDate"].ToString();
         }
         if (row["HolidayEndDate"] != null)
         {
             model.HolidayEndDate = row["HolidayEndDate"].ToString();
         }
         if (row["TimeZoneID"] != null && row["TimeZoneID"].ToString() != "")
         {
             model.TimeZoneID = int.Parse(row["TimeZoneID"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public KryptonAccessController.AccessDataBase.Model.Holiday GetModel(int HolidayID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 HolidayID,HolidayName,UserGroupID,HolidayType,HolidayStartDate,HolidayEndDate,TimeZoneID from Holiday ");
            strSql.Append(" where HolidayID=@HolidayID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@HolidayID", SqlDbType.Int, 4)
            };
            parameters[0].Value = HolidayID;

            KryptonAccessController.AccessDataBase.Model.Holiday model = new KryptonAccessController.AccessDataBase.Model.Holiday();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

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