예제 #1
0
 protected void NameSaveButton_Click(object sender, EventArgs e)
 {
     if (nameTextBox.Text != String.Empty && feeTextBox.Text != String.Empty)
     {
         try
         {
             var aTestNames = new TestNames
             {
                 TestName   = nameTextBox.Text,
                 Fee        = Convert.ToDouble(feeTextBox.Text),
                 TestTypeId = Convert.ToInt32(typeDropDownList.SelectedValue)
             };
             nameMessageLabel.Text = (Convert.ToDouble(feeTextBox.Text) > 0)
                 ? _aNameManager.SaveTestName(aTestNames)
                 : "Please insert amount greater than zero";
         }
         catch
         {
             nameMessageLabel.Text = "Please Insert information in the right format";
         }
     }
     else
     {
         nameMessageLabel.Text = "Please insert information properly";
     }
     Page_Load(sender, e);
 }