Esempio n. 1
0
 public Week(YearWeek yearWeek, string alias)
 {
     this.PartitionKey = yearWeek.ToString();
     this.RowKey       = alias;
     this.Year         = yearWeek.Year;
     this.WeekNumber   = yearWeek.Week;
     this.WeekEndDate  = DateUtilities.DateOfWeek(yearWeek);
     this.Alias        = alias;
 }
Esempio n. 2
0
 public Week(YearWeek yearWeek, string alias)
 {
     this.PartitionKey = yearWeek.ToString();
     this.RowKey = alias;
     this.Year = yearWeek.Year;
     this.WeekNumber = yearWeek.Week;
     this.WeekEndDate = DateUtilities.DateOfWeek(yearWeek);
     this.Alias = alias;
 }
Esempio n. 3
0
        public static IEnumerable<Week> GetWeekAll(YearWeek yearWeek)
        {
            // Create the CloudTable object that represents the table.
            CloudTable table = _tableClient.GetTableReference("week");
            table.CreateIfNotExists();

            var weeks = from result in table.CreateQuery<Week>()
                       where result.PartitionKey == string.Format("{0}_{1}", yearWeek.Year, yearWeek.Week)
                       select result;

            return weeks;
        }
Esempio n. 4
0
        public static Week GetWeek(YearWeek yearWeek, string person)
        {
            // Create the CloudTable object that represents the table.
            CloudTable table = _tableClient.GetTableReference("week");
            table.CreateIfNotExists();

            var week = from result in table.CreateQuery<Week>()
                       where result.PartitionKey == string.Format("{0}_{1}", yearWeek.Year, yearWeek.Week)
                       && result.RowKey == person
                       select result;

            return week.FirstOrDefault();
        }
Esempio n. 5
0
 public static DateTime DateOfWeek(YearWeek yearWeek)
 {
     return DateOfWeek(yearWeek.Year, yearWeek.Week);
 }