private void Text_KeyUp(object sender, KeyEventArgs e) { if (KeyDownDate != null) { HoldingList.Add((DateTime.Now - (DateTime)KeyDownDate).TotalMilliseconds); } }
private static HoldingList ReadHoldingList(IExcelDataReader reader, Book book, int target) { HoldingList holdingList = new HoldingList(); holdingList.LibraryId = DataRepository.Library.GetName(Constant.TargetLibraries[target]).LibraryId; holdingList.BookId = DataRepository.Book.GetbyISBN(book.ISBN).BookId; holdingList.Count = reader.GetInt32(10); holdingList.ReceiptDate = reader.GetString(12).CleanNULL(); holdingList.Classification = book.KDCId == "K1000" ? true : false; return(holdingList); }
private HandWriting GetHandWriting(int?userId = null) { return(new HandWriting { UserId = userId, Pauses = Math.Round(PausesList.Average(), 2), Holding = Math.Round(HoldingList.Average(), 2), ErrorsCount = Math.Round((double)(ErrorCount * 100) / UserText.Length, 2), Overlapping = Math.Round((double)(OverlappingCount * 100) / UserText.Length, 2), Speed = Math.Round((double)UserText.Length / ((DateTime)EndEnterDate - (DateTime)StartEnterDate).TotalMinutes, 2) }); }
public ProjectDirectory(string n) : base(n) { files = new HoldingList <DIRECTORY, FILE>((DIRECTORY)this); directorys = new HoldingList <DIRECTORY, DIRECTORY>((DIRECTORY)this); }
public MExpFunction() { id = ""; m_exp_expressions = new HoldingList <MExpElement, MExpExpression>(this); OnConstructor(); }
//코드 변경 static void Main(string[] args) { #region// HashSet HashSet <string> bookSet = new HashSet <string>(); HashSet <string> holdingListEntity = new HashSet <string>(); List <Book> books = DataRepository.Book.GetAll(); List <HoldingList> holdingLists = DataRepository.HoldingList.GetAll(); foreach (Book book in books) { bookSet.Add(book.Name + book.ISBN); } foreach (HoldingList holdingList in holdingLists) { holdingListEntity.Add(holdingList.LibraryId + holdingList.BookId.ToString()); } #endregion #region//도서관DB입력 List <LibraryAPI> libraries = new List <LibraryAPI>(1100); for (int i = 1; i <= 3; i++) { libraries.AddRange(LibraryAPI.Instance.LoadLibraries(i)); } foreach (var library in libraries) { for (int i = 0; i < Constant.TargetLibraries.Length; i++) { if (library.Name == Constant.TargetLibraries[i]) { System.Console.WriteLine($"{library.LocationId[0]} / {library.LocationId[1]} / {library.Name}"); // Insert 확인용 DataRepository.Library.InsertAPI(library); } } } #endregion #region//책,홀딩리스트 입력 for (int target = 16; target >= 0; target--) { using (var stream = File.Open($@"BookData\{Constant.TargetLibraries[target]} 장서 대출목록 (2020년 06월).xlsx", FileMode.Open, FileAccess.Read)) { // Auto-detect format, supports: // - Binary Excel files (2.0-2003 format; *.xls) // - OpenXml Excel files (2007 format; *.xlsx) using (var reader = ExcelReaderFactory.CreateReader(stream)) { // Choose one of either 1 or 2: reader.Read(); while (reader.Read()) { Book book = ReadBook(reader); string nameWithISBN = book.Name + book.ISBN; if (!bookSet.Contains(nameWithISBN)) { bookSet.Add(nameWithISBN); Debug.WriteLine($"책 들어간다{target} : {reader.GetInt32(0)} / {book.Name} / {book.Author} / {book.Publisher}"); // Insert 확인용 DataRepository.Book.Insert(book); } HoldingList holdingList = ReadHoldingList(reader, book, target); string bookidWithLibraryid = holdingList.LibraryId + holdingList.BookId.ToString(); if (!holdingListEntity.Contains(bookidWithLibraryid)) { holdingListEntity.Add(bookidWithLibraryid); Debug.WriteLine($" 홀딩리스트{target} : {reader.GetInt32(0)} / {holdingList.BookId} / {holdingList.LibraryId}"); DataRepository.HoldingList.Insert(holdingList); } } Debug.WriteLine("\n끝"); } } } #endregion }