/// <summary> Method to read the tracking information dataset from the SobekCM database /// and set all the internal values in this object </summary> /// <param name="Tracking_Info"> DataSet with all the history, media, and archives information </param> public void Set_Tracking_Info(DataSet Tracking_Info) { firstFlagsByte = (byte)8; // Pull all the worklog history values out of the table worklogWorkHistory.Clear(); DataColumn workflowNameColumn = Tracking_Info.Tables[1].Columns["Workflow Name"]; DataColumn workflowDateColumn = Tracking_Info.Tables[1].Columns["Completed Date"]; DataColumn workflowAuthorColumn = Tracking_Info.Tables[1].Columns["WorkPerformedBy"]; DataColumn workflowFilepathColumn = Tracking_Info.Tables[1].Columns["WorkingFilePath"]; DataColumn workflowNoteColumn = Tracking_Info.Tables[1].Columns["Note"]; DataTable workTable = Tracking_Info.Tables[1]; foreach (DataRow thisRow in Tracking_Info.Tables[1].Rows) { Tracking_Progress addProgress = null; if (thisRow[workflowDateColumn] == DBNull.Value) { addProgress = new Tracking_Progress(thisRow[workflowNameColumn].ToString(), thisRow[workflowAuthorColumn].ToString(), thisRow[workflowFilepathColumn].ToString(), thisRow[workflowNoteColumn].ToString(), null); } else { string dateAsString = thisRow[workflowDateColumn].ToString().Trim(); if (dateAsString.Length > 0) { addProgress = new Tracking_Progress(thisRow[workflowNameColumn].ToString(), thisRow[workflowAuthorColumn].ToString(), thisRow[workflowFilepathColumn].ToString(), thisRow[workflowNoteColumn].ToString(), Convert.ToDateTime(thisRow[workflowDateColumn])); } else { addProgress = new Tracking_Progress(thisRow[workflowNameColumn].ToString(), thisRow[workflowAuthorColumn].ToString(), thisRow[workflowFilepathColumn].ToString(), thisRow[workflowNoteColumn].ToString(), null); } } worklogWorkHistory.Add(addProgress); } // Set flag about archived files ( but don't keep the files right now ) if (Tracking_Info.Tables[2].Rows.Count > 0) { firstFlagsByte = (byte)(firstFlagsByte | ((byte)64)); } // Pull all the archive media values out of the table archiveMedia.Clear(); if (Tracking_Info.Tables[0].Rows.Count > 0) { DataColumn mediaNumberColumn = Tracking_Info.Tables[0].Columns["CD_Number"]; DataColumn mediaFilerangeColumn = Tracking_Info.Tables[0].Columns["File_Range"]; DataColumn mediaSizeColumn = Tracking_Info.Tables[0].Columns["Size"]; DataColumn mediaImgesColumn = Tracking_Info.Tables[0].Columns["Images"]; DataColumn mediaDateColumn = Tracking_Info.Tables[0].Columns["Date_Burned"]; foreach (DataRow thisRow in Tracking_Info.Tables[0].Rows) { string size = String.Empty; if (thisRow[mediaSizeColumn] != DBNull.Value) { size = thisRow[mediaSizeColumn].ToString(); } int images = 0; if (thisRow[mediaImgesColumn] != DBNull.Value) { images = Convert.ToInt32(thisRow[mediaImgesColumn]); } Tracking_ArchiveMedia addMedia = new Tracking_ArchiveMedia(thisRow[mediaNumberColumn].ToString(), thisRow[mediaFilerangeColumn].ToString(), images, size, Convert.ToDateTime(thisRow[mediaDateColumn])); archiveMedia.Add(addMedia); } } // Pull all the single tracking values out of the dataset if (Tracking_Info.Tables[3].Rows.Count > 0) { DataRow itemRow = Tracking_Info.Tables[3].Rows[0]; Locally_Archived = Convert.ToBoolean(itemRow["Locally_Archived"]); Remotely_Archived = Convert.ToBoolean(itemRow["Remotely_Archived"]); Born_Digital = Convert.ToBoolean(itemRow["Born_Digital"]); if (itemRow["Disposition_Advice"] == DBNull.Value) { dispositionAdvice = -1; } else { dispositionAdvice = Convert.ToInt16(itemRow["Disposition_Advice"]); } if (itemRow["Material_Received_Date"] == DBNull.Value) { material_recd_date = null; } else { material_recd_date = Convert.ToDateTime(itemRow["Material_Received_Date"]); } Material_Rec_Date_Estimated = Convert.ToBoolean(itemRow["Material_Recd_Date_Estimated"]); if (itemRow["VIDSource"] != DBNull.Value) { vid_source = itemRow["VIDSource"].ToString(); } lastMilestone = Convert.ToInt16(itemRow["Last_Milestone"]); if (itemRow["Milestone_DigitalAcquisition"] == DBNull.Value) { digitalAcquisition = null; } else { digitalAcquisition = Convert.ToDateTime(itemRow["Milestone_DigitalAcquisition"]); } if (itemRow["Milestone_ImageProcessing"] == DBNull.Value) { imageProcessing = null; } else { imageProcessing = Convert.ToDateTime(itemRow["Milestone_ImageProcessing"]); } if (itemRow["Milestone_QualityControl"] == DBNull.Value) { qualityControl = null; } else { qualityControl = Convert.ToDateTime(itemRow["Milestone_QualityControl"]); } if (itemRow["Milestone_OnlineComplete"] == DBNull.Value) { onlineComplete = null; } else { onlineComplete = Convert.ToDateTime(itemRow["Milestone_OnlineComplete"]); } if (itemRow["Disposition_Date"] == DBNull.Value) { disposition_date = null; } else { disposition_date = Convert.ToDateTime(itemRow["Disposition_Date"]); } if (itemRow["Disposition_Type"] == DBNull.Value) { dispositionType = -1; } else { dispositionType = Convert.ToInt16(itemRow["Disposition_Type"]); } if (itemRow["Tracking_Box"] == DBNull.Value) { trackingBox = String.Empty; } else { trackingBox = itemRow["Tracking_Box"].ToString(); } if (itemRow["Disposition_Advice_Notes"] == DBNull.Value) { dispositionAdviceNotes = String.Empty; } else { dispositionAdviceNotes = itemRow["Disposition_Advice_Notes"].ToString(); } if (itemRow["Disposition_Notes"] == DBNull.Value) { dispositionNotes = String.Empty; } else { dispositionNotes = itemRow["Disposition_Notes"].ToString(); } Born_Digital = Convert.ToBoolean(itemRow["Born_Digital"]); } }
/// <summary> Method to read the tracking information dataset from the SobekCM database /// and set all the internal values in this object </summary> /// <param name="Tracking_Info"> DataSet with all the history, media, and archives information </param> public void Set_Tracking_Info(DataSet Tracking_Info) { firstFlagsByte = (byte) 8; // Pull all the worklog history values out of the table worklogWorkHistory.Clear(); DataColumn workflowNameColumn = Tracking_Info.Tables[1].Columns["Workflow Name"]; DataColumn workflowDateColumn = Tracking_Info.Tables[1].Columns["Completed Date"]; DataColumn workflowAuthorColumn = Tracking_Info.Tables[1].Columns["WorkPerformedBy"]; DataColumn workflowFilepathColumn = Tracking_Info.Tables[1].Columns["WorkingFilePath"]; DataColumn workflowNoteColumn = Tracking_Info.Tables[1].Columns["Note"]; DataTable workTable = Tracking_Info.Tables[1]; foreach (DataRow thisRow in Tracking_Info.Tables[1].Rows) { Tracking_Progress addProgress = null; if (thisRow[workflowDateColumn] == DBNull.Value) addProgress = new Tracking_Progress(thisRow[workflowNameColumn].ToString(), thisRow[workflowAuthorColumn].ToString(), thisRow[workflowFilepathColumn].ToString(), thisRow[workflowNoteColumn].ToString(), null); else { string dateAsString = thisRow[workflowDateColumn].ToString().Trim(); if (dateAsString.Length > 0) { addProgress = new Tracking_Progress(thisRow[workflowNameColumn].ToString(), thisRow[workflowAuthorColumn].ToString(), thisRow[workflowFilepathColumn].ToString(), thisRow[workflowNoteColumn].ToString(), Convert.ToDateTime(thisRow[workflowDateColumn])); } else { addProgress = new Tracking_Progress(thisRow[workflowNameColumn].ToString(), thisRow[workflowAuthorColumn].ToString(), thisRow[workflowFilepathColumn].ToString(), thisRow[workflowNoteColumn].ToString(), null); } } worklogWorkHistory.Add(addProgress); } // Set flag about archived files ( but don't keep the files right now ) if (Tracking_Info.Tables[2].Rows.Count > 0) firstFlagsByte = (byte) (firstFlagsByte | ((byte) 64)); // Pull all the archive media values out of the table archiveMedia.Clear(); if (Tracking_Info.Tables[0].Rows.Count > 0) { DataColumn mediaNumberColumn = Tracking_Info.Tables[0].Columns["CD_Number"]; DataColumn mediaFilerangeColumn = Tracking_Info.Tables[0].Columns["File_Range"]; DataColumn mediaSizeColumn = Tracking_Info.Tables[0].Columns["Size"]; DataColumn mediaImgesColumn = Tracking_Info.Tables[0].Columns["Images"]; DataColumn mediaDateColumn = Tracking_Info.Tables[0].Columns["Date_Burned"]; foreach (DataRow thisRow in Tracking_Info.Tables[0].Rows) { string size = String.Empty; if (thisRow[mediaSizeColumn] != DBNull.Value) size = thisRow[mediaSizeColumn].ToString(); int images = 0; if (thisRow[mediaImgesColumn] != DBNull.Value) images = Convert.ToInt32(thisRow[mediaImgesColumn]); Tracking_ArchiveMedia addMedia = new Tracking_ArchiveMedia(thisRow[mediaNumberColumn].ToString(), thisRow[mediaFilerangeColumn].ToString(), images, size, Convert.ToDateTime(thisRow[mediaDateColumn])); archiveMedia.Add(addMedia); } } // Pull all the single tracking values out of the dataset DataRow itemRow = Tracking_Info.Tables[3].Rows[0]; Locally_Archived = Convert.ToBoolean(itemRow["Locally_Archived"]); Remotely_Archived = Convert.ToBoolean(itemRow["Remotely_Archived"]); Born_Digital = Convert.ToBoolean(itemRow["Born_Digital"]); if (itemRow["Disposition_Advice"] == DBNull.Value) dispositionAdvice = -1; else dispositionAdvice = Convert.ToInt16(itemRow["Disposition_Advice"]); if (itemRow["Material_Received_Date"] == DBNull.Value) material_recd_date = null; else material_recd_date = Convert.ToDateTime(itemRow["Material_Received_Date"]); Material_Rec_Date_Estimated = Convert.ToBoolean(itemRow["Material_Recd_Date_Estimated"]); if (itemRow["VIDSource"] != DBNull.Value) vid_source = itemRow["VIDSource"].ToString(); lastMilestone = Convert.ToInt16(itemRow["Last_Milestone"]); if (itemRow["Milestone_DigitalAcquisition"] == DBNull.Value) digitalAcquisition = null; else digitalAcquisition = Convert.ToDateTime(itemRow["Milestone_DigitalAcquisition"]); if (itemRow["Milestone_ImageProcessing"] == DBNull.Value) imageProcessing = null; else imageProcessing = Convert.ToDateTime(itemRow["Milestone_ImageProcessing"]); if (itemRow["Milestone_QualityControl"] == DBNull.Value) qualityControl = null; else qualityControl = Convert.ToDateTime(itemRow["Milestone_QualityControl"]); if (itemRow["Milestone_OnlineComplete"] == DBNull.Value) onlineComplete = null; else onlineComplete = Convert.ToDateTime(itemRow["Milestone_OnlineComplete"]); if (itemRow["Disposition_Date"] == DBNull.Value) disposition_date = null; else disposition_date = Convert.ToDateTime(itemRow["Disposition_Date"]); if (itemRow["Disposition_Type"] == DBNull.Value) dispositionType = -1; else dispositionType = Convert.ToInt16(itemRow["Disposition_Type"]); if (itemRow["Tracking_Box"] == DBNull.Value) trackingBox = String.Empty; else trackingBox = itemRow["Tracking_Box"].ToString(); if (itemRow["Disposition_Advice_Notes"] == DBNull.Value) dispositionAdviceNotes = String.Empty; else dispositionAdviceNotes = itemRow["Disposition_Advice_Notes"].ToString(); if (itemRow["Disposition_Notes"] == DBNull.Value) dispositionNotes = String.Empty; else dispositionNotes = itemRow["Disposition_Notes"].ToString(); Born_Digital = Convert.ToBoolean(itemRow["Born_Digital"]); }