Exemplo n.º 1
0
        public void updateCheckboxAndTextbox(out VolumeType type, CheckBox chk1, CheckBox chk2, TextBox txt1, TextBox txt2,
                                             Label lbl1, Label lbl2, ClearVolumeError_delegate clear1, ClearRelativeVolumeProportionError_delegate clear2, bool is1Rel)
        {
            if (chk2.Checked)
            {
                type = is1Rel ? VolumeType.Absolute : VolumeType.Relative;
                if (chk1.Checked)
                {
                    chk1.Checked = false;
                }
                clear1();
                clear2();
            }
            else if (chk1.Checked)
            {
                type = is1Rel ? VolumeType.Relative : VolumeType.Absolute;
            }
            else
            {
                type = VolumeType.NotSpecified;
            }

            // toggle checkboxes and labels
            txt2.Visible = chk2.Checked;
            lbl2.Visible = chk2.Checked;
            txt2.Enabled = chk2.Checked;

            txt1.Visible = !chk2.Checked;
            lbl1.Visible = !chk2.Checked;
            txt1.Enabled = chk2.Checked;

            ReportCommandDetailChanged();
        }
Exemplo n.º 2
0
 protected void txtVolumeCommandRelative_helper(CheckDest_delegate checkDest, CheckBox cbRel, TextBox txtRel,
                                                ClearVolumeError_delegate clearErr,
                                                ShowVolumeError_delegate showErr, ref double relVol)
 {
     // if returns true, we want to stop user from making changes
     if (checkDest != null && checkDest()) //IAT
     {
         return;
     }
     ReportCommandDetailChanged();
     if (txtRel.TextLength == 0 && cbRel.Checked)
     {
         showErr(VolumeError.MINIMUM_AMOUNT);
     }
     else
     {
         try
         {
             if (cbRel.Checked)
             {
                 relVol = double.Parse(txtRel.Text);
                 if ((relVol < minimumRelative_Ratio ||
                      relVol > maximumRelative_Ratio))
                 {
                     //                           ShowRelativeVolumeProportionError(0);
                     showErr(VolumeError.RELATIVE_VIAL_AMOUNT);
                 }
                 else
                 {
                     clearErr();
                 }
             }
             else
             {
                 clearErr();
             }
         }
         catch
         {
             relVol = minimumRelative_TipVolume;
         }
     }
 }