Ejemplo n.º 1
0
        //TODO: How do I make this proper async
        internal async void Signup(string familyName, string value, string signupMessage)
        {
            var row = _spreadsheet.DatabaseSheet.DatabaseRows.GetValueOrDefault(familyName);

            if (row == null)
            {
                return;
            }

            string columnHeader = null;
            var    weekDay      = new Weekday(DayEnum.Sunday);

            do
            {
                if (signupMessage.IndexOf(weekDay.ToString()) > -1)
                {
                    columnHeader = weekDay.ToString();
                }
                weekDay.NextDay();
            } while (weekDay.Day != DayEnum.Sunday);
            if (columnHeader == null)
            {
                return;
            }

            var column = _spreadsheet.DatabaseSheet.DatabaseColumns.GetValueOrDefault(columnHeader);

            if (column == null)
            {
                return;
            }

            SpreadsheetHandler.UpdateCell(_service, _spreadsheet.Id, value, $"{_spreadsheet.DatabaseSheet.Name}!{column.ColumnLetters}{row.RowNumber}");
        }