Example #1
0
        private void FindEqualTimeEntry(UserTimeEntry iUserTimeEntry,
                                        List <UserTimeEntry> listUserTimeEntry, out ExcelUserTimeEntry excelTimeEntry)
        {
            excelTimeEntry = new ExcelUserTimeEntry(iUserTimeEntry.ProjectName, iUserTimeEntry.IssueName,
                                                    iUserTimeEntry.Comment, iUserTimeEntry.ActivityName,
                                                    iUserTimeEntry.HeadName, iUserTimeEntry.DateStart,
                                                    iUserTimeEntry.DateFinish, iUserTimeEntry.Hours);

            int iIndex = 0;

            while (iIndex < listUserTimeEntry.Count)
            {
                UserTimeEntry jUserTimeEntry = listUserTimeEntry[iIndex];
                if ((jUserTimeEntry.ProjectName == iUserTimeEntry.ProjectName) &
                    (jUserTimeEntry.ActivityName == iUserTimeEntry.ActivityName) &
                    (jUserTimeEntry.Value.Id != iUserTimeEntry.Value.Id))
                {
                    if (jUserTimeEntry.DateFinish > excelTimeEntry.DateFinish)
                    {
                        excelTimeEntry.DateFinish = jUserTimeEntry.DateFinish;
                    }
                    excelTimeEntry.Hours = excelTimeEntry.Hours + jUserTimeEntry.Hours;
                }
                iIndex++;
            }
        }
Example #2
0
        private bool isExistExcelTimeEntry(UserTimeEntry userTimeEntry, List <ExcelUserTimeEntry> listExcelTimeEntry)
        {
            bool isEqual = false;

            ExcelUserTimeEntry excelUserTimeEntry = listExcelTimeEntry.Find(x => ((x.ProjectName == userTimeEntry.ProjectName) &
                                                                                  (x.IssueName == userTimeEntry.IssueName) &
                                                                                  (x.Comment == userTimeEntry.Comment) &
                                                                                  (x.ActivityName == userTimeEntry.ActivityName)));

            if (excelUserTimeEntry != null)
            {
                isEqual = true;
            }

            return(isEqual);
        }
Example #3
0
        public void GetExcelTimeEntry(UserRedmine userRedmine)
        {
            userRedmine.listExcelUserTimeEntry.Clear();

            int iIndex = 0;

            while (iIndex < userRedmine.listMounthUserTimeEntry.Count)
            {
                UserTimeEntry iUserTimeEntry = userRedmine.listMounthUserTimeEntry[iIndex];
                if (!isExistExcelTimeEntry(iUserTimeEntry, userRedmine.listExcelUserTimeEntry))
                {
                    ExcelUserTimeEntry excelUserTimeEntry = null;
                    FindEqualTimeEntry(iUserTimeEntry, userRedmine.listMounthUserTimeEntry, out excelUserTimeEntry);

                    if (excelUserTimeEntry != null)
                    {
                        userRedmine.listExcelUserTimeEntry.Add(excelUserTimeEntry);
                    }
                }
                iIndex++;
            }
        }