Ejemplo n.º 1
0
        ///<summary>An important part of creating a "canadian claim" is setting all the missing teeth.  So this must be passed in.  It is preferrable to not include any dates with the missing teeth.  This will force the user to enter dates.</summary>
        public static CanadianClaim Insert(int claimNum, List <CanadianExtract> missingList)
        {
            CanadianExtracts.UpdateForClaim(claimNum, missingList);
            string command = "INSERT INTO canadianclaim (ClaimNum) VALUES("
                             + "'" + POut.PInt(claimNum) + "')";

            //+"'"+POut.PString(schoolName)+"')";
            General.NonQ(command);
            CanadianClaim retVal = new CanadianClaim();

            retVal.ClaimNum           = claimNum;
            retVal.MaterialsForwarded = "";
            return(retVal);
        }
Ejemplo n.º 2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textAccidentDate.errorProvider1.GetError(textAccidentDate) != "" ||
         textDateInitialUpper.errorProvider1.GetError(textDateInitialUpper) != "" ||
         textDateInitialLower.errorProvider1.GetError(textDateInitialLower) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     #region Warnings
     string warning = "";
     if (!radioSecondaryYes.Checked && !radioSecondaryNo.Checked && !radioSecondaryX.Checked)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Secondary coverage not indicated.";
     }
     if (textReferralProvider.Text != "" && comboReferralReason.SelectedIndex == 0)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Referral reason is required if provider indicated.";
     }
     if (textReferralProvider.Text == "" && comboReferralReason.SelectedIndex != 0)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Referring provider required if referring reason is indicated.";
     }
     if (listEligibilityCode.SelectedIndex == 0 && textSchoolName.Text == "")
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "School should be entered if full-time student.";
     }
     if (listEligibilityCode.SelectedIndex == -1)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Eligibility code is required.";
     }
     if (listPayeeCode.SelectedIndex == -1)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Payee not selected.";
     }
     if (textAccidentDate.Text != "")
     {
         if (PIn.PDate(textAccidentDate.Text) > DateTime.Today)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Accident date must be in the past.";
         }
         if (PIn.PDate(textAccidentDate.Text).Year < 1980)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Accident date is not reasonable.";
         }
     }
     //Max prosth----------------------------------------------------------------------------------------------------------
     if (!radioMaxProsthYes.Checked && !radioMaxProsthNo.Checked && !radioMaxProsthX.Checked)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Max prosth not indicated.";
     }
     if (textDateInitialUpper.Text != "")
     {
         if (PIn.PDate(textDateInitialUpper.Text) > DateTime.Today)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Initial max date must be in the past.";
         }
         if (PIn.PDate(textDateInitialUpper.Text).Year < 1900)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Initial max date is not reasonable.";
         }
     }
     if (radioMaxProsthNo.Checked)
     {
         if (textDateInitialUpper.Text == "")
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Max initial date is required if 'no' is checked.";
         }
         if (comboMaxProsthMaterial.SelectedIndex == 0)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Max prosth material must be indicated";                  // (unless for a crown).";
         }
     }
     if (comboMaxProsthMaterial.SelectedIndex != 0 && radioMaxProsthX.Checked)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Max prosth should not have a material selected.";
     }
     //Mand prosth----------------------------------------------------------------------------------------------------------
     if (!radioMandProsthYes.Checked && !radioMandProsthNo.Checked && !radioMandProsthX.Checked)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Mand prosth not indicated.";
     }
     if (textDateInitialLower.Text != "")
     {
         if (PIn.PDate(textDateInitialLower.Text) > DateTime.Today)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Initial mand date must be in the past.";
         }
         if (PIn.PDate(textDateInitialLower.Text).Year < 1900)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Initial mand date is not reasonable.";
         }
     }
     if (radioMandProsthNo.Checked)
     {
         if (textDateInitialLower.Text == "")
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Mand initial date is required if 'no' is checked.";
         }
         if (comboMandProsthMaterial.SelectedIndex == 0)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += "Mand prosth material must be indicated";                  // (unless for a crown).";
         }
     }
     if (comboMandProsthMaterial.SelectedIndex != 0 && radioMandProsthX.Checked)
     {
         if (warning != "")
         {
             warning += "\r\n";
         }
         warning += "Mand prosth should not have a material selected.";
     }
     //missing teeth------------------------------------------------------------------------------
     if (radioMandProsthYes.Checked)
     {
         if (comboMandProsthMaterial.SelectedIndex != 7)              //if not a crown
         {
             if (MissingList.Count == 0)
             {
                 if (warning != "")
                 {
                     warning += "\r\n";
                 }
                 warning += "Missing teeth need to be entered.";
             }
             else
             {
                 bool missingDatesPresent = false;
                 for (int i = 0; i < MissingList.Count; i++)
                 {
                     if (MissingList[i].DateExtraction.Year > 1880)
                     {
                         missingDatesPresent = true;
                     }
                 }
                 if (!missingDatesPresent)
                 {
                     if (warning != "")
                     {
                         warning += "\r\n";
                     }
                     warning += "Dates need to be entered for missing teeth.";
                 }
             }
         }
     }
     if (radioMaxProsthYes.Checked)
     {
         if (comboMaxProsthMaterial.SelectedIndex != 7)               //if not a crown
         {
             if (MissingList.Count == 0)
             {
                 if (warning != "")
                 {
                     warning += "\r\n";
                 }
                 warning += "Missing teeth need to be entered.";
             }
             else
             {
                 bool missingDatesPresent = false;
                 for (int i = 0; i < MissingList.Count; i++)
                 {
                     if (MissingList[i].DateExtraction.Year > 1880)
                     {
                         missingDatesPresent = true;
                     }
                 }
                 if (!missingDatesPresent)
                 {
                     if (warning != "")
                     {
                         warning += "\r\n";
                     }
                     warning += "Dates need to be entered for missing teeth.";
                 }
             }
         }
     }
     if (warning != "")
     {
         DialogResult result = MessageBox.Show("Warnings:\r\n" + warning + "\r\nDo you wish to continue anyway?", "",
                                               MessageBoxButtons.OKCancel);
         if (result != DialogResult.OK)
         {
             return;
         }
     }
     #endregion Warnings
     CanCur.MaterialsForwarded = "";
     if (checkEmail.Checked)
     {
         CanCur.MaterialsForwarded += "E";
     }
     if (checkCorrespondence.Checked)
     {
         CanCur.MaterialsForwarded += "C";
     }
     if (checkModels.Checked)
     {
         CanCur.MaterialsForwarded += "M";
     }
     if (checkXrays.Checked)
     {
         CanCur.MaterialsForwarded += "X";
     }
     if (checkImages.Checked)
     {
         CanCur.MaterialsForwarded += "I";
     }
     if (radioSecondaryYes.Checked)
     {
         CanCur.SecondaryCoverage = "Y";
     }
     if (radioSecondaryNo.Checked)
     {
         CanCur.SecondaryCoverage = "N";
     }
     if (radioSecondaryX.Checked)
     {
         CanCur.SecondaryCoverage = "X";
     }
     CanCur.ReferralProviderNum = textReferralProvider.Text;
     CanCur.ReferralReason      = comboReferralReason.SelectedIndex;
     CanCur.EligibilityCode     = listEligibilityCode.SelectedIndex + 1;
     CanCur.SchoolName          = textSchoolName.Text;
     CanCur.PayeeCode           = listPayeeCode.SelectedIndex + 1;
     ClaimCur.AccidentDate      = PIn.PDate(textAccidentDate.Text);
     //CanCur.CardSequenceNumber=PIn.PInt(textCardSequenceNumber.Text);
     //max prosth-----------------------------------------------------------------------------------------------------
     if (radioMaxProsthYes.Checked)
     {
         CanCur.IsInitialUpper = "Y";
     }
     if (radioMaxProsthNo.Checked)
     {
         CanCur.IsInitialUpper = "N";
     }
     if (radioMandProsthX.Checked)
     {
         CanCur.IsInitialUpper = "X";
     }
     CanCur.DateInitialUpper  = PIn.PDate(textDateInitialUpper.Text);
     CanCur.MaxProsthMaterial = comboMaxProsthMaterial.SelectedIndex;
     //mand prosth-----------------------------------------------------------------------------------------------------
     if (radioMandProsthYes.Checked)
     {
         CanCur.IsInitialLower = "Y";
     }
     if (radioMandProsthNo.Checked)
     {
         CanCur.IsInitialLower = "N";
     }
     if (radioMandProsthX.Checked)
     {
         CanCur.IsInitialLower = "X";
     }
     CanCur.DateInitialLower   = PIn.PDate(textDateInitialLower.Text);
     CanCur.MandProsthMaterial = comboMandProsthMaterial.SelectedIndex;
     CanadianExtracts.UpdateForClaim(ClaimCur.ClaimNum, MissingList);
     CanadianClaims.Update(CanCur);
     DialogResult = DialogResult.OK;
 }