Beispiel #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (!Utils.isEmpty(cmbTask.Text))
     {
         string code = cmbTask.Text.Split(':')[0];
         //MessageBox.Show(String.Format(Queries.select_teeth_task_info_task_code_and_teeth_id, code, patientTeeth.ID));
         DataTable table = DatabaseHandler.getInstance().getTable(String.Format(Queries.select_teeth_task_info_based_task_code_and_teeth_id, code, patientTeeth.ID));
         if (Utils.isObjectNull(table))
         {
             if (!DatabaseHandler.getInstance().modifyTable(String.Format(Queries.insert_teeth_task_info, id, code, txtCost.Text, txtNotes.Text)))
             {
             }
             else
             {
                 /////////will fix later to add latest value directly to table
                 teethTaskInfoList.fill(DatabaseHandler.getInstance().getTable(String.Format(Queries.select_teeth_task_info_based_teeth_id, id)));
             }
         }
         else
         {
             MessageBox.Show("This teeth already has diagnosis code " + code);
         }
     }
     else
     {
         MessageBox.Show("Choose a task first");
     }
 }
Beispiel #2
0
 private void cmbTask_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!Utils.isEmpty(cmbTask.Text))
     {
         String[] split = cmbTask.Text.Split(':');
         double   cost  = DatabaseHandler.getInstance().getDoubleData(String.Format(Queries.select_task_info_cost_based_code_and_name, split[0], split[1]));
         txtCost.Text = Convert.ToString(cost);
     }
 }
Beispiel #3
0
 public static void limitedNumberInputOnly(object sender, int max)
 {
     if (!handled)
     {
         TextBox obj = (TextBox)sender;
         if (Utils.hasExceeded(obj.Text, max) || !Utils.isValidNumber(Utils.getLastCharacter(obj.Text)))
         {
             handled = true;
             if (!Utils.isEmpty(obj.Text))
             {
                 obj.Text = obj.Text.Substring(0, obj.Text.Length - 1);
             }
         }
     }
     else
     {
         handled = false;
     }
 }