public async Task<StorageResult> StoreIteration(Iteration iteration, string uri)
        {
            StorageResult result = new StorageResult();

            try
            {
                string json = JsonConvert.SerializeObject(iteration);

                string filename = string.Format("{0}.json", DateTime.Now.ToString("yyyy_MM_ddTHHmmss"));

                string path = Path.Combine(uri, filename);

                using (StreamWriter file = File.CreateText(path))
                {
                    await file.WriteAsync(json);
                }

                result.Status = StorageStatus.Success;
                //TODO: put string in resource file
                result.Message = string.Format("File '{0}' was successfully created.", path);
            }
            catch (Exception ex)
            {
                result.Status = StorageStatus.Error;
                result.Message = ex.Message;
            }

            return result;
        }
Esempio n. 2
0
 public DutyProvider()
 {
     _Iteration = new Iteration();
 }
Esempio n. 3
0
        public void SetIteration(Iteration iteration)
        {
            Iteration = iteration;

            OngoingDuty = iteration.Duties.FirstOrDefault(a => a.Status == (int)DutyStatus.Ongoing);
        }
Esempio n. 4
0
 public void StartNewIteration()
 {
     //we have to prepaire provider for new iteration
     Iteration = new Iteration();
     OngoingDuty = null;
 }