Esempio n. 1
0
 private void FormSheetFieldCheckBox_Load(object sender, EventArgs e)
 {
     if (IsReadOnly)
     {
         butOK.Enabled     = false;
         butDelete.Enabled = false;
     }
     //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
     AvailFields = SheetFieldsAvailable.GetList(SheetDefCur.SheetType, OutInCheck.Check);
     listFields.Items.Clear();
     for (int i = 0; i < AvailFields.Count; i++)
     {
         //static text is not one of the options.
         listFields.Items.Add(AvailFields[i].FieldName);
         if (SheetFieldDefCur.FieldName == AvailFields[i].FieldName)
         {
             listFields.SelectedIndex = i;
         }
     }
     textXPos.Text           = SheetFieldDefCur.XPos.ToString();
     textYPos.Text           = SheetFieldDefCur.YPos.ToString();
     textWidth.Text          = SheetFieldDefCur.Width.ToString();
     textHeight.Text         = SheetFieldDefCur.Height.ToString();
     textRadioGroupName.Text = SheetFieldDefCur.RadioButtonGroup;
     checkRequired.Checked   = SheetFieldDefCur.IsRequired;
     textTabOrder.Text       = SheetFieldDefCur.TabOrder.ToString();
 }
Esempio n. 2
0
 private void FormSheetFieldCheckBox_Load(object sender, EventArgs e)
 {
     _listDiseaseDefs            = DiseaseDefs.GetDeepCopy(true);
     textYPos.MaxVal             = SheetDefCur.HeightTotal - 1;//The maximum y-value of the sheet field must be within the page vertically.
     labelReportableName.Visible = false;
     textReportableName.Visible  = false;
     if (SheetFieldDefCur.FieldName.StartsWith("misc"))
     {
         labelReportableName.Visible = true;
         textReportableName.Visible  = true;
         textReportableName.Text     = SheetFieldDefCur.ReportableName;
     }
     if (IsReadOnly)
     {
         butOK.Enabled     = false;
         butDelete.Enabled = false;
     }
     //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
     AvailFields    = SheetFieldsAvailable.GetList(SheetDefCur.SheetType, OutInCheck.Check);
     isMedHistSheet = SheetDefCur.SheetType == SheetTypeEnum.MedicalHistory;
     listFields.Items.Clear();
     for (int i = 0; i < AvailFields.Count; i++)
     {
         //static text is not one of the options.
         listFields.Items.Add(AvailFields[i].FieldName);
         //Sheets will have dynamic field names like "allergy:Pen".  They will always start with a valid FieldName.
         if (SheetFieldDefCur.FieldName.StartsWith(AvailFields[i].FieldName))
         {
             listFields.SelectedIndex = i;
         }
     }
     if (isMedHistSheet)
     {
         radioYes.Checked = true;
         if (SheetFieldDefCur.FieldName.StartsWith("allergy:"))
         {
             FillListMedical(MedicalListType.allergy);
             SetListMedicalSelectedIndex(MedicalListType.allergy, SheetFieldDefCur.FieldName.Remove(0, 8));
         }
         else if (SheetFieldDefCur.FieldName.StartsWith("problem:"))
         {
             FillListMedical(MedicalListType.problem);
             SetListMedicalSelectedIndex(MedicalListType.problem, SheetFieldDefCur.FieldName.Remove(0, 8));
         }
         if (SheetFieldDefCur.RadioButtonValue == "N")
         {
             radioNo.Checked  = true;
             radioYes.Checked = false;
         }
     }
     textXPos.Text           = SheetFieldDefCur.XPos.ToString();
     textYPos.Text           = SheetFieldDefCur.YPos.ToString();
     textWidth.Text          = SheetFieldDefCur.Width.ToString();
     textHeight.Text         = SheetFieldDefCur.Height.ToString();
     textRadioGroupName.Text = SheetFieldDefCur.RadioButtonGroup;
     checkRequired.Checked   = SheetFieldDefCur.IsRequired;
     textTabOrder.Text       = SheetFieldDefCur.TabOrder.ToString();
 }
Esempio n. 3
0
        private void FormSheetFieldInput_Load(object sender, EventArgs e)
        {
            textYPos.MaxVal             = SheetDefCur.HeightTotal - 1;//The maximum y-value of the sheet field must be within the page vertically.
            labelReportableName.Visible = false;
            textReportableName.Visible  = false;
            if (SheetFieldDefCur.FieldName.StartsWith("misc"))
            {
                labelReportableName.Visible = true;
                textReportableName.Visible  = true;
                textReportableName.Text     = SheetFieldDefCur.ReportableName;
            }
            if (IsReadOnly)
            {
                butOK.Enabled     = false;
                butDelete.Enabled = false;
            }
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(SheetDefCur.SheetType, OutInCheck.In);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName.StartsWith(AvailFields[i].FieldName))
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            for (int i = 0; i < Enum.GetNames(typeof(GrowthBehaviorEnum)).Length; i++)
            {
                comboGrowthBehavior.Items.Add(Enum.GetNames(typeof(GrowthBehaviorEnum))[i]);
                if ((int)SheetFieldDefCur.GrowthBehavior == i)
                {
                    comboGrowthBehavior.SelectedIndex = i;
                }
            }
            textXPos.Text         = SheetFieldDefCur.XPos.ToString();
            textYPos.Text         = SheetFieldDefCur.YPos.ToString();
            textWidth.Text        = SheetFieldDefCur.Width.ToString();
            textHeight.Text       = SheetFieldDefCur.Height.ToString();
            checkRequired.Checked = SheetFieldDefCur.IsRequired;
            textTabOrder.Text     = SheetFieldDefCur.TabOrder.ToString();
        }
Esempio n. 4
0
        private void FormSheetFieldDefEdit_Load(object sender, EventArgs e)
        {
            textYPos.MaxVal = SheetDefCur.HeightTotal - 1;        //The maximum y-value of the sheet field must be within the page vertically.
            if (IsReadOnly)
            {
                butOK.Enabled     = false;
                butDelete.Enabled = false;
            }
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(SheetDefCur.SheetType, OutInCheck.Out);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName == AvailFields[i].FieldName)
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            for (int i = 0; i < Enum.GetNames(typeof(GrowthBehaviorEnum)).Length; i++)
            {
                comboGrowthBehavior.Items.Add(Enum.GetNames(typeof(GrowthBehaviorEnum))[i]);
                if ((int)SheetFieldDefCur.GrowthBehavior == i)
                {
                    comboGrowthBehavior.SelectedIndex = i;
                }
            }
            for (int i = 0; i < Enum.GetNames(typeof(System.Windows.Forms.HorizontalAlignment)).Length; i++)
            {
                comboTextAlign.Items.Add(Enum.GetNames(typeof(System.Windows.Forms.HorizontalAlignment))[i]);
                if ((int)SheetFieldDefCur.TextAlign == i)
                {
                    comboTextAlign.SelectedIndex = i;
                }
            }
            checkIsLocked.Checked = IsNew ? true : SheetFieldDefCur.IsLocked;
            textXPos.Text         = SheetFieldDefCur.XPos.ToString();
            textYPos.Text         = SheetFieldDefCur.YPos.ToString();
            textWidth.Text        = SheetFieldDefCur.Width.ToString();
            textHeight.Text       = SheetFieldDefCur.Height.ToString();
            butColor.BackColor    = SheetFieldDefCur.ItemColor;
        }
Esempio n. 5
0
        private void FormSheetFieldInput_Load(object sender, EventArgs e)
        {
            labelReportableName.Visible = false;
            textReportableName.Visible  = false;
            if (SheetFieldDefCur.FieldName.StartsWith("misc"))
            {
                labelReportableName.Visible = true;
                textReportableName.Visible  = true;
                textReportableName.Text     = SheetFieldDefCur.ReportableName;
            }
            if (_isEditMobile)
            {
                groupBox1.Enabled           = false;
                comboGrowthBehavior.Enabled = false;
                textTabOrder.Enabled        = false;
            }
            textUiLabelMobile.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobile.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(_sheetDefCur.SheetType, OutInCheck.In);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName.StartsWith(AvailFields[i].FieldName))
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior);
            checkRequired.Checked = SheetFieldDefCur.IsRequired;
            textTabOrder.Text     = SheetFieldDefCur.TabOrder.ToString();
            if (!string.IsNullOrEmpty(SheetFieldDefCur.UiLabelMobile))              //Already has a value that user has setup previously.
            {
                textUiLabelMobile.Text = SheetFieldDefCur.UiLabelMobile;
            }
        }
Esempio n. 6
0
        private void FormSheetFieldDefEdit_Load(object sender, EventArgs e)
        {
            if (IsReadOnly)
            {
                butOK.Enabled     = false;
                butDelete.Enabled = false;
            }
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(SheetDefCur.SheetType, OutInCheck.Out);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName == AvailFields[i].FieldName)
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            for (int i = 0; i < Enum.GetNames(typeof(GrowthBehaviorEnum)).Length; i++)
            {
                comboGrowthBehavior.Items.Add(Enum.GetNames(typeof(GrowthBehaviorEnum))[i]);
                if ((int)SheetFieldDefCur.GrowthBehavior == i)
                {
                    comboGrowthBehavior.SelectedIndex = i;
                }
            }
            textXPos.Text   = SheetFieldDefCur.XPos.ToString();
            textYPos.Text   = SheetFieldDefCur.YPos.ToString();
            textWidth.Text  = SheetFieldDefCur.Width.ToString();
            textHeight.Text = SheetFieldDefCur.Height.ToString();
        }
        private void FormSheetFieldDefEdit_Load(object sender, EventArgs e)
        {
            if (_isEditMobile)
            {
                comboGrowthBehavior.Enabled = false;
                groupBox1.Enabled           = false;
            }
            textUiLabelMobile.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobile.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(_sheetDefCur.SheetType, OutInCheck.Out);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName == AvailFields[i].FieldName)
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior);
            comboTextAlign.Items.AddEnums <HorizontalAlignment>();
            comboTextAlign.SetSelected((int)SheetFieldDefCur.TextAlign);
            checkIsLocked.Checked = SheetFieldDefCur.IsNew ? true : SheetFieldDefCur.IsLocked;
            butColor.BackColor    = SheetFieldDefCur.ItemColor;
            if (!string.IsNullOrEmpty(SheetFieldDefCur.UiLabelMobile))              //Already has a value that user has setup previously.
            {
                textUiLabelMobile.Text = SheetFieldDefCur.UiLabelMobile;
            }
        }
        private void FormSheetFieldCheckBox_Load(object sender, EventArgs e)
        {
            _listDiseaseDefs = DiseaseDefs.GetDeepCopy(true);
            if (_isEditMobile)
            {
                textTabOrder.Enabled = false;
            }
            labelReportableName.Visible = false;
            textReportableName.Visible  = false;
            if (SheetFieldDefCur.FieldName.StartsWith("misc"))
            {
                labelReportableName.Visible = true;
                textReportableName.Visible  = true;
                textReportableName.Text     = SheetFieldDefCur.ReportableName;
            }
            textUiLabelMobileMisc.Visible             = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobileMisc.Visible            = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            textUiLabelMobileRadioButtonMisc.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobileRadioButtonMisc.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            textUiLabelMobile.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobile.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            textUiLabelMobileCheckBoxNonMisc.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobileCheckBoxNonMisc.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelAlsoActs.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            //Not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype.
            //These names will not include the ':' for allergies and problems.
            List <SheetFieldDef> listSheetFieldDefs = SheetFieldsAvailable.GetList(_sheetDefCur.SheetType, OutInCheck.Check);

            //If an existing SheetFieldDefCur is not found in the list, add it so we maintain current selection.
            if (SheetFieldDefCur.FieldName.In("FluorideProc", "AssessmentProc") || SheetFieldDefCur.FieldName.StartsWith("Proc:"))
            {
                //Couldn't find the current sheetfielddef.  Add it to the list.
                //Checkboxes associated to procedure codes will never be present in SheetFieldsAvailable.GetList(...).
                //Previously this list would contain AssessmentProc and FluorideProc.
                //All other checkboxes associated to proc codes will not exists in list either.
                listSheetFieldDefs.Add(SheetFieldDefCur);
            }
            listBoxFields.SetItems(
                listSheetFieldDefs,
                (item) => item.FieldName,
                (item) => SheetFieldDefCur.FieldName.StartsWith(item.FieldName));
            _sheetDefCur.SheetFieldDefs
            .Where(x => !string.IsNullOrEmpty(x.RadioButtonGroup))
            .GroupBy(x => x.RadioButtonGroup)
            .Select(x => x.Key)
            .ForEach(x => { comboRadioGroupNameMisc.Items.Add(x); });
            comboRadioGroupNameMisc.Text          = SheetFieldDefCur.RadioButtonGroup;
            checkRequired.Checked                 = SheetFieldDefCur.IsRequired;
            textTabOrder.Text                     = SheetFieldDefCur.TabOrder.ToString();
            textUiLabelMobileMisc.Text            = SheetFieldDefCur.UiLabelMobile;
            textUiLabelMobileRadioButtonMisc.Text = SheetFieldDefCur.UiLabelMobileRadioButton;
            textUiLabelMobile.Text                = SheetFieldDefCur.UiLabelMobile;
            textUiLabelMobileCheckBoxNonMisc.Text = SheetFieldDefCur.UiLabelMobile;
            textMobileMedicalNameOverride.Text    = SheetFieldDefCur.UiLabelMobile;
            if (_isMedHistSheet)
            {
                radioYes.Checked = true;
                if (_selectedFieldName == "allergy")
                {
                    //Will be of format allergy:Aspirin
                    FillListMedical(MedicalListType.allergy);
                }
                else if (_selectedFieldName == "problem")
                {
                    //Will be of format problem:Bleeding
                    FillListMedical(MedicalListType.problem);
                }
                if (SheetFieldDefCur.RadioButtonValue == "N")
                {
                    radioNo.Checked  = true;
                    radioYes.Checked = false;
                }
            }
            if (_sheetDefCur.SheetType == SheetTypeEnum.Screening)
            {
                butAddProc.Visible = true;
            }
            if (radioYes.Checked)
            {
                //If checkbox's text is not the default of "Yes", display the customized text in override box
                if (SheetFieldDefCur.UiLabelMobileRadioButton != radioYes.Text)
                {
                    textMobileCheckOverride.Text = SheetFieldDefCur.UiLabelMobileRadioButton;
                }
            }
            else if (radioNo.Checked)
            {
                //If checkbox's text is not the default of "No", display the customized text in override box
                if (SheetFieldDefCur.UiLabelMobileRadioButton != radioNo.Text)
                {
                    textMobileCheckOverride.Text = SheetFieldDefCur.UiLabelMobileRadioButton;
                }
            }
        }