Esempio n. 1
0
        private void podTypeLockLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (!podTypeCB.Enabled)
            {
                if (MessageBox.Show("Any changes to podcast type will mean the production code will need to be updated. " +
                                    "This should only be done if absolutely necessary." +
                                    "\n\nAre you sure you want to continue?",
                                    "Production Code Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    MessageBox.Show("The production code will not be updated until the type field is locked. ", "Production Code Warning",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    togglePodTypeToState(true);
                }
            }
            else
            {
                //if the type has changed then ask if they wanna continue with the prodcode update
                if ((origPod.typeId != ((PodType)podTypeCB.SelectedItem).id) &&
                    (MessageBox.Show("The podcast type was changed. Are you sure you want to continue? " +
                                     "\nThis will result in an update to the production code.",
                                     "Production Code Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes))
                {
                    ProdCodeManager prodCodeManager = new ProdCodeManager(selPod, (Retrospective)retroComboBox.SelectedItem);

                    selPod.prodCode    = prodCodeManager.assignNewPodType(selPod.prodCode, ((PodType)podTypeCB.SelectedItem).code);
                    selPod.typeId      = ((PodType)podTypeCB.SelectedItem).id;
                    podProdCodeTB.Text = selPod.prodCode;

                    //if(tableData.updatePodProdCodeAndTypeId(selPod) > 0)
                    //{
                    //MessageBox.Show("Original Production Code: " + origPod.prodCode +
                    //    "\nNew Production Code: " + selPod.prodCode + "\tTypeID: " + selPod.typeId,
                    //    "Production Code Warning",
                    //    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    //}
                }
                else
                {
                    //revert back to original type
                    for (int i = 0; i < podTypeCB.Items.Count; i++)
                    {
                        if (((PodType)podTypeCB.Items[i]).id == origPod.typeId)
                        {
                            podTypeCB.SelectedIndex = i;
                        }
                    }
                }

                togglePodTypeToState(false);
            }
        }
Esempio n. 2
0
 private string configureProdCode(Podcast pod)
 {
     PCM = new ProdCodeManager(pod, (Retrospective)retroComboBox.SelectedItem);
     return(PCM.contructProdCode());
 }