示例#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;
 }
示例#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;
 }
示例#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;
        }
示例#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();
        }
示例#5
0
 public static DateTime DateOfWeek(YearWeek yearWeek)
 {
     return DateOfWeek(yearWeek.Year, yearWeek.Week);
 }