private void FillDataRowPartsList(List <string> dataRowParts) { List_DataRow_Parts.Items.Clear(); if (currentDataRow != null) { Translation translation = null; foreach (string translationID in dataRowParts) { translation = controller.FindTranslationById(translationID); //If it's a custom txt || std translation, add the Engl. translation if (translationID.Contains(MyronWebUAT.dataType_customText.ToString() + "_") || translationID.Contains(MyronWebUAT.dataType_stdTranslation.ToString() + "_")) { List_DataRow_Parts.Items.Add(translation.eng_MY); } //If it's a fixed translation, add the description else if (translationID.Contains(MyronWebUAT.dataType_fixedTranslation.ToString() + "_")) { List_DataRow_Parts.Items.Add(((ValuedFixedTranslation)translation).valueDescription); } //If it's a conditioned translation, add the description else if (translationID.Contains(MyronWebUAT.dataType_fixedTranslation.ToString() + "_")) { List_DataRow_Parts.Items.Add(((ValuedConditionedTranslation)translation).valueDescription); } } } List_DataRow_Parts.Refresh(); RefreshFinalDataRowTextBox(); }
private void Btn_DataRow_Add_Click(object sender, EventArgs e) { if (dataRowNewPart == MyronWebUAT.dataType_customText && Text_DataRow_CustomText.Text != "") { Translation customText = new Translation(MyronWebUAT.dataType_customText, Text_DataRow_CustomText.Text, Text_DataRow_CustomText.Text, Text_DataRow_CustomText.Text); //Save the new customText in the controller controller.customTextTranslations.Add(customText); //New Custom text created and added to the datarow currentDataRow.dataRowParts.Add(customText.translationID); //Update the list List_DataRow_Parts.Items.Add(customText.eng_MY); List_DataRow_Parts.Refresh(); RefreshFinalDataRowTextBox(); HideDataRowCustomTextField(); } else if (dataRowNewPart == MyronWebUAT.dataType_stdTranslation && Cmb_DataRow_Translations.SelectedIndex != MyronWebUAT.admin_notSelected) { Translation stdTranslation = controller.standardTranslations[Cmb_DataRow_Translations.SelectedIndex]; //Std translation added to the datarow currentDataRow.dataRowParts.Add(stdTranslation.translationID); //Update the list List_DataRow_Parts.Items.Add(stdTranslation.eng_MY); List_DataRow_Parts.Refresh(); RefreshFinalDataRowTextBox(); //Make the Cmb visilble and its label Cmb_DataRow_Translations.Visible = false; Lbl_DataRow_SelectTranslation.Visible = false; Cmb_DataRow_Translations.Items.Clear(); } else if (dataRowNewPart == MyronWebUAT.dataType_fixedTranslation && Cmb_DataRow_Translations.SelectedIndex != MyronWebUAT.admin_notSelected) { ValuedFixedTranslation fixedTranslation = controller.fixedTranslations[Cmb_DataRow_Translations.SelectedIndex]; //Fixed translation added to the datarow currentDataRow.dataRowParts.Add(fixedTranslation.translationID); //Update the list with the description List_DataRow_Parts.Items.Add(fixedTranslation.valueDescription); List_DataRow_Parts.Refresh(); RefreshFinalDataRowTextBox(); //Make the Cmb visilble and its label Cmb_DataRow_Translations.Visible = false; Lbl_DataRow_SelectTranslation.Visible = false; Cmb_DataRow_Translations.Items.Clear(); } else if (dataRowNewPart == MyronWebUAT.dataType_conditionedTranslation && Cmb_DataRow_Translations.SelectedIndex != MyronWebUAT.admin_notSelected) { ValuedConditionedTranslation conditionedTranslation = controller.conditionedTranslations[Cmb_DataRow_Translations.SelectedIndex]; //Conditioned translation added to the datarow currentDataRow.dataRowParts.Add(conditionedTranslation.translationID); //Update the list with the description List_DataRow_Parts.Items.Add(conditionedTranslation.valueDescription); List_DataRow_Parts.Refresh(); RefreshFinalDataRowTextBox(); //Make the Cmb visilble and its label Cmb_DataRow_Translations.Visible = false; Lbl_DataRow_SelectTranslation.Visible = false; Cmb_DataRow_Translations.Items.Clear(); } Text_DataRow_CustomText.Text = ""; Btn_DataRow_Cancel.PerformClick(); }
private void Btn_admin_edit_Click(object sender, EventArgs e) { if (List_Admin_Items.SelectedIndex != MyronWebUAT.admin_notSelected) { admin_EditionMode = MyronWebUAT.admin_editmode_edit; ToggleEditorGroups(Cmb_Admin_ContentType.SelectedIndex); //Lock elements that can cause problems and enable Cancel button Cmb_Admin_ContentType.Enabled = false; List_Admin_Items.Enabled = false; Btn_Admin_Delete.Enabled = false; Btn_Admin_Edit.Enabled = false; Btn_Admin_Cancel.Enabled = true; int index = List_Admin_Items.SelectedIndex; //Load data into the fields depending on the content type if (Cmb_Admin_ContentType.SelectedIndex == MyronWebUAT.admin_contenttype_dataRows) { currentDataRow = controller.dataRows[index]; Text_DataRow_Description.Text = currentDataRow.description; List_DataRow_Parts.Items.Clear(); for (int i = 0; i < currentDataRow.dataRowParts.Count; i++) { List_DataRow_Parts.Items.Add(controller.GetTranslationDescription(currentDataRow.dataRowParts[i])); } List_DataRow_Parts.Refresh(); RefreshFinalDataRowTextBox(); HideDataRowCustomTextField(); } else if (Cmb_Admin_ContentType.SelectedIndex == MyronWebUAT.admin_contenttype_valuedConditionedTranslations) { Text_Cdtl_ValueDescriptor.Text = controller.conditionedTranslations[index].valueDescription; Chck_Cdtl_UsesVariable.Checked = controller.conditionedTranslations[index].canUseVariable; Text_Cdtl_Variable.Text = controller.conditionedTranslations[index].variable; Text_Cdtl_MY.Text = controller.conditionedTranslations[index].eng_MY; Text_Cdtl_CAAZ.Text = controller.conditionedTranslations[index].eng_CAAZ; Text_Cdtl_CAFR.Text = controller.conditionedTranslations[index].fr_CA; Cmb_Cdtl_ConditionType.SelectedIndex = controller.conditionedTranslations[index].conditionType; Text_Cdtl_ElseMY.Text = controller.conditionedTranslations[index].elseEng_MY; Text_Cdtl_ElseCAAZ.Text = controller.conditionedTranslations[index].elseEng_CAAZ; Text_Cdtl_ElseFRCA.Text = controller.conditionedTranslations[index].elseFR_CA; } else if (Cmb_Admin_ContentType.SelectedIndex == MyronWebUAT.admin_contenttype_valuedFixedTranslations) { Text_Fixed_ValueDescription.Text = controller.fixedTranslations[index].valueDescription; Text_Fixed_MY.Text = controller.fixedTranslations[index].eng_MY; Text_Fixed_CAAZ.Text = controller.fixedTranslations[index].eng_CAAZ; Text_Fixed_CAFR.Text = controller.fixedTranslations[index].fr_CA; Cmb_Fixed_ValueType.SelectedIndex = controller.fixedTranslations[index].valueType; } else if (Cmb_Admin_ContentType.SelectedIndex == MyronWebUAT.admin_contenttype_standardTranslations) { Text_TextOnly_EngMY.Text = controller.standardTranslations[index].eng_MY; Text_TextOnly_EngCAAZ.Text = controller.standardTranslations[index].eng_CAAZ; Text_TextOnly_FRCA.Text = controller.standardTranslations[index].fr_CA; } else if (Cmb_Admin_ContentType.SelectedIndex == MyronWebUAT.admin_contenttype_templates) { for (int i = 0; i < controller.dataRows.Count; i++) { Cmb_Temp_DataRows.Items.Add(controller.dataRows[i].description); } currentTemplate = controller.templates[index]; Text_Temp_Description.Text = currentTemplate.templateName; RefreshTemplateItemSizeList(); RefreshTemplateImprintAreaList(); RefreshTemplateChargesList(); Radio_Temp_ItemSize.Checked = true; } } }