public List <dtoShowingSet> GetShowingSets() { dalShowingSet dalShowingSet = new dalShowingSet(); List <dtoShowingSet> listEmp = new List <dtoShowingSet>(); DataTable ShowingSets = dalShowingSet.GetShowingSets(); for (int i = 0; i < ShowingSets.Rows.Count; i++) { dtoShowingSet ShowingSet = new dtoShowingSet(); DataRow row = ShowingSets.Rows[i]; ShowingSet.SetID = Convert.ToInt32(row[0]); ShowingSet.StartTime = (TimeSpan)row[1]; ShowingSet.EndTime = (TimeSpan)row[2]; listEmp.Add(ShowingSet); } return(listEmp); }
/// <summary> /// Hàm cập nhập xuất chiếu /// </summary> /// <param name="set"></param> /// <returns></returns> public int UpdateShowingSet(dtoShowingSet set) { int count = 0; try { string sql = "UPDATE [dbo].[ShowingSet] SET [StartTime] = @StartTime, [EndTime] = @EndTime"; SqlParameter parameterStartTime = new SqlParameter("@StartTime", SqlDbType.DateTime); parameterStartTime.Value = set.StartTime; SqlParameter parameterEndTime = new SqlParameter("@EndTime", SqlDbType.DateTime); parameterEndTime.Value = set.EndTime; count = InsertUpdateDeleteData(sql, new[] { parameterStartTime, parameterEndTime }); } finally { CloseConnection(); } return(count); }