Esempio n. 1
0
 public static void CreateIssue(DataStructureClass.DataStructure NewData)
 {
     if (Properties.Settings.Default.Connection)
     {
         ServerClass.CreateIssue(NewData);
     }
     else
     {
         LocalClass.CreateIssue(NewData);
     }
 }
Esempio n. 2
0
 public static void EditIssue(DataStructureClass.DataStructure EditedData)
 {
     if (Properties.Settings.Default.Connection)
     {
         ServerClass.EditIssue(EditedData);
     }
     else
     {
         LocalClass.EditIssue(EditedData);
         LocalClass.EditIssueCommit(EditedData);
     }
 }
Esempio n. 3
0
 public static void CommitOneTimeEntry(int Id, string CommentText, int Activity)
 {
     Console.WriteLine(DateTime.Now + ": BuisinessLogicClass.CommitOneTimeEntry: " + Id);
     if (Properties.Settings.Default.Connection)
     {
         ServerClass.CommitTime(Id, CommentText, Activity, DateTime.Now, GetOneIssue(Id));
     }
     else
     {
         LocalClass.CommitTime(Id, CommentText, Activity);
     }
     DataStructureClass.DataStructure IssueData = LocalClass.GetOneIssue(Id);
     IssueData._notCommittedWorkingTime = 0;
     LocalClass.EditIssue(IssueData);
 }
Esempio n. 4
0
 public static void OldCommits(bool OperationType)
 {
     Console.WriteLine(DateTime.Now + ": BuisinessLogicClass.OldCommits");
     if (OperationType)
     {
         foreach (string line in LocalClass.GetLocalCommits())
         {
             try
             {
                 if (line.Substring(0, 5) == "Time:")
                 {
                     string    newLine = line.Substring(5);
                     TimeEntry Entry   = JsonConvert.DeserializeObject <TimeEntry>(newLine);
                     DataStructureClass.DataStructure IssueData = new DataStructureClass.DataStructure()
                     {
                         _notCommittedWorkingTime = Convert.ToInt32(Entry.Hours * 3600),
                         _id           = Entry.Issue.Id,
                         _projectId    = Entry.Project.Id,
                         _assignedToId = Entry.User.Id
                     };
                     ServerClass.CommitTime(Entry.Issue.Id, Entry.Comments, Entry.Activity.Id, Convert.ToDateTime(Entry.SpentOn), IssueData);
                 }
                 if (line.Substring(0, 5) == "Edit:")
                 {
                     string newLine = line.Substring(5);
                     DataStructureClass.DataStructure IssueData = JsonConvert.DeserializeObject <DataStructureClass.DataStructure>(newLine);
                     ServerClass.EditIssue(IssueData);
                 }
                 if (line.Substring(0, 5) == "NewI:")
                 {
                     string    newLine = line.Substring(5);
                     TimeEntry Entry   = JsonConvert.DeserializeObject <TimeEntry>(newLine);
                     DataStructureClass.DataStructure IssueData = JsonConvert.DeserializeObject <DataStructureClass.DataStructure>(newLine);
                     ServerClass.CreateIssue(IssueData);
                 }
             }
             catch
             {
                 MessageBox.Show("The" + line.Substring(0, 4) + "failed to get to the server.", "Send data to server fail", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     else
     {
         LocalClass.DeleteLocalCommits();
     }
 }
Esempio n. 5
0
 public static bool CheckForOldCommits()
 {
     return(LocalClass.CheckForOldCommits());
 }
Esempio n. 6
0
 public static void CleanUpIssuesFile()
 {
     LocalClass.CleanUpIssuesFile();
 }
Esempio n. 7
0
 public static string[,] GetVariables(int LineId)
 {
     return(LocalClass.GetVariables(LineId));
 }
Esempio n. 8
0
 public static void SaveTimeTicked(int IssueId, int TimeAmount)
 {
     LocalClass.AutomaticSaveTime(IssueId, TimeAmount);
 }
Esempio n. 9
0
 public static DataStructureClass.DataStructure GetOneIssue(int IssueId)
 {
     return(LocalClass.GetOneIssue(IssueId));
 }
Esempio n. 10
0
 public static DataStructureClass.DataStructure[] GetAllIssues()
 {
     DataStructureClass.DataStructure[] allIssues = LocalClass.GetAllIssues();
     return(allIssues);
 }
Esempio n. 11
0
 public static void Init()
 {
     LocalClass.Init();
 }