public void SendRecordToPrint(long recID) { PrintJob job = new PrintJob { RecordID = recID, CreationDate = DateTime.Now, LastStatusUpdateDate = DateTime.Now, Status = 0 }; context.PrintJobs.InsertOnSubmit(job); context.SubmitChanges(); }
public void ProcessIncommingRecords() { var cacheDirInfo = new DirectoryInfo(Config.InputCacheFolder); var storageDirInfo = new DirectoryInfo(Config.RecordStorageFolder); foreach (var fileInfo in cacheDirInfo.GetFiles("*.wav")) { RecordInfo recInfo = RecordInfo.FromFileName(fileInfo.Name); var qEmp = context.Employees.Where(e => e.Code == recInfo.EmpCode); if (qEmp.Count() == 0) throw new InvalidRecordInfoException(); Employee emp = qEmp.FirstOrDefault(); var dirs = storageDirInfo.GetDirectories(emp.Code); DirectoryInfo empDir; if (dirs.Length == 0) empDir = Directory.CreateDirectory(Path.Combine(storageDirInfo.FullName, emp.Code)); else empDir = dirs[0]; string toPath = Path.Combine(empDir.FullName, fileInfo.Name); File.Move(fileInfo.FullName, toPath); Record rec = new Record { Employee = emp, CaseNumber = recInfo.CaseNumber, RecordDate = recInfo.RecordDate, FileName = toPath }; PrintJob job = new PrintJob { Record = rec, CreationDate = DateTime.Now, LastStatusUpdateDate = DateTime.Now, Status = 0 }; context.Records.InsertOnSubmit(rec); context.PrintJobs.InsertOnSubmit(job); context.SubmitChanges(); } }
private void detach_PrintJobs(PrintJob entity) { this.SendPropertyChanging(); entity.Record = null; }
private void attach_PrintJobs(PrintJob entity) { this.SendPropertyChanging(); entity.Record = this; }
partial void DeletePrintJob(PrintJob instance);
partial void UpdatePrintJob(PrintJob instance);
partial void InsertPrintJob(PrintJob instance);