public static int UpdateHistorialData(DataDuDoan sl, double capacity)
            {
                string sql = "UPDATE DuLieuDuDoan SET capacity_db = @cap, ghi_db = @ghi , envtemp_db = @evn " +
                             " WHERE time_db = @time ";
                SqlParameter param1 = new SqlParameter("@time", SqlDbType.DateTime);

                param1.Value = sl.date;
                SqlParameter param2 = new SqlParameter("@cap", SqlDbType.Float);

                param2.Value = capacity;
                SqlParameter param3 = new SqlParameter("@ghi", SqlDbType.Float);

                param3.Value = sl.ghi;
                SqlParameter param4 = new SqlParameter("@evn", SqlDbType.Float);

                param4.Value = sl.air_temperature;

                return(DAO.UpdateDataBySQLWithParametes(sql, param1, param2, param3, param4));
            }
            public static int InsertHistorialData(DataDuDoan sl, double capacity)
            {
                string sql = "INSERT INTO DuLieuDuDoan ( time_db , capacity_db, ghi_db , envtemp_db ) " +
                             "VALUES ( @time, @cap, @ghi, @evn )";
                SqlParameter param1 = new SqlParameter("@time", SqlDbType.DateTime);

                param1.Value = sl.date;
                SqlParameter param2 = new SqlParameter("@cap", SqlDbType.Float);

                param2.Value = capacity;
                SqlParameter param3 = new SqlParameter("@ghi", SqlDbType.Float);

                param3.Value = sl.ghi;
                SqlParameter param4 = new SqlParameter("@evn", SqlDbType.Float);

                param4.Value = sl.air_temperature;

                return(DAO.UpdateDataBySQLWithParametes(sql, param1, param2, param3, param4));
            }