Example #1
0
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Provide instruction on how the physical material should be treated after digization is complete.";
                switch (CurrentLanguage)
                {
                case Web_Language_Enum.English:
                    Acronym = defaultAcronym;
                    break;

                case Web_Language_Enum.Spanish:
                    Acronym = defaultAcronym;
                    break;

                case Web_Language_Enum.French:
                    Acronym = defaultAcronym;
                    break;

                default:
                    Acronym = defaultAcronym;
                    break;
                }
            }

            string term = String.Empty;

            if (Bib.Tracking.Disposition_Advice > 0)
            {
                term = SobekCM_Library_Settings.Disposition_Term_Future(Bib.Tracking.Disposition_Advice);
            }
            render_helper(Output, term, Bib.Tracking.Disposition_Advice_Notes, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, false);
        }
        private void adviceLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Edit_Disposition_Advice_Form trackingForm = new Edit_Disposition_Advice_Form(trackingInfoObj.Disposition_Advice, trackingInfoObj.Disposition_Advice_Notes);

            if (trackingForm.ShowDialog() == DialogResult.OK)
            {
                int    type  = trackingForm.Disposition_Type_ID;
                string notes = trackingForm.Disposition_Notes;

                if ((type != trackingInfoObj.Disposition_Advice) || (notes.Trim() != trackingInfoObj.Disposition_Advice_Notes.Trim()))
                {
                    if (Resource_Object.Database.SobekCM_Database.Edit_Disposition_Advice(itemid, type, notes))
                    {
                        trackingInfoObj.Disposition_Advice       = (short)type;
                        trackingInfoObj.Disposition_Advice_Notes = notes;

                        string disposition = SobekCM_Library_Settings.Disposition_Term_Future(trackingInfoObj.Disposition_Advice).ToUpper();
                        if (trackingInfoObj.Disposition_Advice_Notes.Trim().Length > 0)
                        {
                            adviceLinkLabel.Text = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes;
                            adviceLabel.Text     = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes;
                        }
                        else
                        {
                            adviceLinkLabel.Text = disposition;
                            adviceLabel.Text     = disposition;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error encountered while saving disposition advice!    ", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
        /// <summary> Constructor for a new instance of the Edit_Disposition_Advice_Form class </summary>
        /// <param name="Initial_Disposition_Type"> Initialy disposition type to display </param>
        /// <param name="Initial_Notes"> Initial disposition advice notes to display </param>
        public Edit_Disposition_Advice_Form(int Initial_Disposition_Type, string Initial_Notes)
        {
            InitializeComponent();
            DialogResult = DialogResult.Cancel;

            notes  = String.Empty;
            typeId = -1;

            if (!Windows_Appearance_Checker.is_XP_Theme)
            {
                textBox1.BorderStyle = BorderStyle.FixedSingle;
                comboBox1.FlatStyle  = FlatStyle.Flat;
            }

            // Add each possible disposition type
            List <string> dispositionTypes = SobekCM_Library_Settings.Disposition_Types_Future;

            foreach (string thisType in dispositionTypes)
            {
                comboBox1.Items.Add(thisType);
            }
            comboBox1.Text = SobekCM_Library_Settings.Disposition_Term_Future(Initial_Disposition_Type);
            textBox1.Text  = Initial_Notes;

            BackColor = Color.FromArgb(240, 240, 240);
        }
        private void editDispositionAdviceMenuItem_Click(object sender, EventArgs e)
        {
            if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0))
            {
                return;
            }

            Edit_Disposition_Advice_Form trackingBox = new Edit_Disposition_Advice_Form();

            if (trackingBox.ShowDialog() == DialogResult.OK)
            {
                Cursor = Cursors.WaitCursor;
                int    updated    = 0;
                int    typeid     = trackingBox.Disposition_Type_ID;
                string notes      = trackingBox.Disposition_Notes;
                string typeString = SobekCM_Library_Settings.Disposition_Term_Future(typeid);
                foreach (DataRow thisRow in gridPanel.Selected_Row)
                {
                    int itemid = Convert.ToInt32(thisRow["ItemID"]);
                    if (itemid > 0)
                    {
                        if (thisRow["Disposition_Date"] == DBNull.Value)
                        {
                            if (SobekCM_Database.Edit_Disposition_Advice(itemid, typeid, notes))
                            {
                                thisRow["Disposition_Advice"] = typeString;
                                //thisRow["Disposition_Advice_Notes"] = notes;
                            }
                            updated++;
                        }
                    }
                }

                Cursor = Cursors.Default;
                gridPanel.Refresh();
                MessageBox.Show(updated + " records updated.");
            }
        }
        private void show_milestones_worklog()
        {
            // Pull the tracking information
            trackingInfo = SobekCM_Database.Tracking_Get_History_Archives(itemid, null);

            // Pull out the standard tracking milestones
            trackingInfoObj = new Tracking_Info();
            trackingInfoObj.Set_Tracking_Info(trackingInfo);
            if (trackingInfoObj.Digital_Acquisition_Milestone.HasValue)
            {
                acquisitionLabel.Text = trackingInfoObj.Digital_Acquisition_Milestone.Value.ToShortDateString();
            }
            if (trackingInfoObj.Image_Processing_Milestone.HasValue)
            {
                imageProcessingLabel.Text = trackingInfoObj.Image_Processing_Milestone.Value.ToShortDateString();
            }
            if (trackingInfoObj.Quality_Control_Milestone.HasValue)
            {
                qcLabel.Text = trackingInfoObj.Quality_Control_Milestone.Value.ToShortDateString();
            }
            if (trackingInfoObj.Online_Complete_Milestone.HasValue)
            {
                onlineCompleteLabel.Text = trackingInfoObj.Online_Complete_Milestone.Value.ToShortDateString();
            }

            if (trackingInfoObj.Born_Digital)
            {
                if (trackingInfoObj.Material_Received_Date.HasValue)
                {
                    if (trackingInfoObj.Material_Rec_Date_Estimated)
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString() + " (estimated - Born Digital)";
                    }
                    else
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString() + " (Born Digital)";
                    }
                }
                else
                {
                    receivedLabel.Text = "Born Digital";
                }
            }
            else
            {
                if (trackingInfoObj.Material_Received_Date.HasValue)
                {
                    if (trackingInfoObj.Material_Rec_Date_Estimated)
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString() + " (estimated)";
                    }
                    else
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString();
                    }
                }
            }
            if (trackingInfoObj.Disposition_Date.HasValue)
            {
                adviceLinkLabel.Hide();
                adviceLabel.Show();
                dispositionLabel.Show();
                dispositionLinkLabel.Hide();
                string disposition = SobekCM_Library_Settings.Disposition_Term_Past(trackingInfoObj.Disposition_Type).ToUpper();
                if (trackingInfoObj.Disposition_Notes.Trim().Length > 0)
                {
                    dispositionLabel.Text = disposition + " " + trackingInfoObj.Disposition_Date.Value.ToShortDateString() + " - " + trackingInfoObj.Disposition_Notes;
                }
                else
                {
                    dispositionLabel.Text = disposition + " " + trackingInfoObj.Disposition_Date.Value.ToShortDateString();
                }
            }
            else
            {
                adviceLabel.Hide();
                adviceLinkLabel.Show();
                dispositionLabel.Hide();
                dispositionLinkLabel.Show();
            }


            if (trackingInfoObj.Disposition_Advice > 0)
            {
                string disposition = SobekCM_Library_Settings.Disposition_Term_Future(trackingInfoObj.Disposition_Advice).ToUpper();
                if (trackingInfoObj.Disposition_Advice_Notes.Trim().Length > 0)
                {
                    adviceLinkLabel.Text = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes;
                    adviceLabel.Text     = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes;
                }
                else
                {
                    adviceLinkLabel.Text = disposition;
                    adviceLabel.Text     = disposition;
                }
            }

            if ((!trackingInfoObj.Locally_Archived) && (!trackingInfoObj.Remotely_Archived))
            {
                archivingLabel1.Text = "NOT ARCHIVED";
                archivingLabel2.Text = String.Empty;
            }
            else
            {
                if (trackingInfoObj.Locally_Archived)
                {
                    archivingLabel1.Text = "Locally Stored on CD or Tape";
                    archivingLabel2.Text = trackingInfoObj.Remotely_Archived ? "Archived Remotely (FDA)" : String.Empty;
                }
                else
                {
                    archivingLabel1.Text = "Archived Remotely (FDA)";
                    archivingLabel2.Text = String.Empty;
                }
            }
            if (trackingInfoObj.Tracking_Box.Length > 0)
            {
                trackingBoxLabel.Text = trackingInfoObj.Tracking_Box;
            }


            // Show the history table
            if (historyPanel == null)
            {
                historyPanel = new CustomGrid_Panel
                {
                    Size     = new Size(historyTabPage.Width - 20, historyTabPage.Height - 20),
                    Location = new Point(10, 10)
                };
                historyPanel.Style.Default_Column_Width = 80;
                historyPanel.Style.Default_Column_Color = Color.LightBlue;
                historyPanel.Style.Header_Back_Color    = Color.DarkBlue;
                historyPanel.Style.Header_Fore_Color    = Color.White;
                historyPanel.BackColor   = Color.White;
                historyPanel.BorderStyle = BorderStyle.FixedSingle;
                historyPanel.Anchor      = (((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
                historyTabPage.Controls.Add(historyPanel);
            }

            historyPanel.DataTable = trackingInfo.Tables[1];
            historyPanel.Style.Column_Styles[0].Visible     = false;
            historyPanel.Style.Column_Styles[1].BackColor   = Color.White;
            historyPanel.Style.Column_Styles[1].Width       = 150;
            historyPanel.Style.Column_Styles[2].Width       = 80;
            historyPanel.Style.Column_Styles[2].Header_Text = "Completed";
            historyPanel.Style.Column_Styles[3].Header_Text = "User";
            historyPanel.Style.Column_Styles[3].Width       = 100;
            historyPanel.Style.Column_Styles[4].Header_Text = "Location";
            historyPanel.Style.Column_Styles[5].Width       = 200;
        }