Пример #1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (ScreenList.Length == 0)
     {
         if (MessageBox.Show("Since you have no items in the list, the screener and location information cannot be saved. Continue?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
         {
             return;
         }
     }
     ScreenGroupCur.SGDate      = PIn.Date(textScreenDate.Text);
     ScreenGroupCur.Description = textDescription.Text;
     ScreenGroupCur.ProvName    = textProvName.Text;
     ScreenGroupCur.ProvNum     = comboProv.SelectedIndex + 1;    //this works for -1 also.
     if (comboCounty.SelectedIndex == -1)
     {
         ScreenGroupCur.County = "";
     }
     else
     {
         ScreenGroupCur.County = comboCounty.SelectedItem.ToString();
     }
     if (comboGradeSchool.SelectedIndex == -1)
     {
         ScreenGroupCur.GradeSchool = "";
     }
     else
     {
         ScreenGroupCur.GradeSchool = comboGradeSchool.SelectedItem.ToString();
     }
     ScreenGroupCur.PlaceService = (PlaceOfService)comboPlaceService.SelectedIndex;
     ScreenGroups.Update(ScreenGroupCur);
     Screens.UpdateForGroup(ScreenGroupCur);
     DialogResult = DialogResult.OK;
 }
Пример #2
0
 private void FillGrid()
 {
     ScreenList = Screens.Refresh(ScreenGroupCur.ScreenGroupNum);
     ListViewItem[] items = new ListViewItem[ScreenList.Length];
     for (int i = 0; i < items.Length; i++)
     {
         items[i] = new ListViewItem(ScreenList[i].ScreenGroupOrder.ToString());
         items[i].SubItems.Add(ScreenList[i].GradeLevel.ToString());
         if (ScreenList[i].Age == 0)
         {
             items[i].SubItems.Add("");
         }
         else
         {
             items[i].SubItems.Add(ScreenList[i].Age.ToString());
         }
         items[i].SubItems.Add(ScreenList[i].Race.ToString());
         items[i].SubItems.Add(ScreenList[i].Gender.ToString());
         items[i].SubItems.Add(ScreenList[i].Urgency.ToString());
         items[i].SubItems.Add(getX(ScreenList[i].HasCaries));
         items[i].SubItems.Add(getX(ScreenList[i].EarlyChildCaries));
         items[i].SubItems.Add(getX(ScreenList[i].CariesExperience));
         items[i].SubItems.Add(getX(ScreenList[i].ExistingSealants));
         items[i].SubItems.Add(getX(ScreenList[i].NeedsSealants));
         items[i].SubItems.Add(getX(ScreenList[i].MissingAllTeeth));
         items[i].SubItems.Add(ScreenList[i].Comments);
     }
     listMain.Items.Clear();
     listMain.Items.AddRange(items);
 }
Пример #3
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     //can only get to here if not IsNew
     FillCur();
     Screens.Update(ScreenCur);
     DialogResult = DialogResult.OK;
 }
Пример #4
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         Screens.Delete(ScreenCur);
         DialogResult = DialogResult.Cancel;
         if (ScreenPatCur != null)
         {
             ScreenPatCur.PatScreenPerm = PatScreenPerm.Unknown;
         }
         IsDeleted = true;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this screening?"))
     {
         return;
     }
     if (ScreenPatCur != null)
     {
         ScreenPatCur.PatScreenPerm = PatScreenPerm.Unknown;
     }
     IsDeleted = true;
     Screens.Delete(ScreenCur);
     DialogResult = DialogResult.Cancel;
 }
Пример #5
0
        private void FillGrid()
        {
            ScreenList = Screens.Refresh(ScreenGroupCur.ScreenGroupNum);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g(this, "#"), 30);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Grade"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Age"), 40);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Race"), 60);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Sex"), 40);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Urgency"), 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Caries"), 45);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "ECC"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "CarExp"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "ExSeal"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "NeedSeal"), 60);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "NoTeeth"), 60);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Comments"), 100);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ScreenList.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ScreenList[i].ScreenGroupOrder.ToString());
                row.Cells.Add(ScreenList[i].GradeLevel.ToString());
                row.Cells.Add(ScreenList[i].Age.ToString());
                row.Cells.Add(ScreenList[i].Race.ToString());
                row.Cells.Add(ScreenList[i].Gender.ToString());
                row.Cells.Add(ScreenList[i].Urgency.ToString());
                row.Cells.Add(getX(ScreenList[i].HasCaries));
                row.Cells.Add(getX(ScreenList[i].EarlyChildCaries));
                row.Cells.Add(getX(ScreenList[i].CariesExperience));
                row.Cells.Add(getX(ScreenList[i].ExistingSealants));
                row.Cells.Add(getX(ScreenList[i].NeedsSealants));
                row.Cells.Add(getX(ScreenList[i].MissingAllTeeth));
                row.Cells.Add(ScreenList[i].Comments);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Пример #6
0
 private void AddSome(int numberToAdd)
 {
     FillCur();
     for (int i = 0; i < numberToAdd; i++)
     {
         Screens.Insert(ScreenCur);
         ScreenCur.ScreenGroupOrder = ScreenCur.ScreenGroupOrder + 1; //increments for next
     }
     DialogResult = DialogResult.OK;                                  //this triggers window to come back up again.
 }
Пример #7
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     //the first 6 fields are handled when the ScreenGroup is saved.
     if (!_isValid)             //If validation failed and they still want to continue, do Cancel instead.
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     ScreenCur.ScreenGroupOrder = PIn.Int(textScreenGroupOrder.Text);
     ScreenCur.ScreenGroupNum   = ScreenGroupCur.ScreenGroupNum;
     if (radioUnknown.Checked)
     {
         ScreenCur.Gender = PatientGender.Unknown;
     }
     else if (radioM.Checked)
     {
         ScreenCur.Gender = PatientGender.Male;
     }
     else if (radioF.Checked)
     {
         ScreenCur.Gender = PatientGender.Female;
     }
     ScreenCur.RaceOld    = (PatientRaceOld)listRace.SelectedIndex;
     ScreenCur.GradeLevel = (PatientGrade)comboGradeLevel.SelectedIndex;
     if (textBirthdate.Text != "" && textAge.Text == "")         //Birthdate is present but age isn't entered, calculate it.
     {
         ScreenCur.Age = PIn.Byte(Patients.DateToAge(PIn.DateT(textBirthdate.Text)).ToString());
     }
     else if (textAge.Text != "")           //Age was manually entered, use it.
     {
         ScreenCur.Age = PIn.Byte(textAge.Text);
     }
     else              //No age information was entered at all.
     {
         ScreenCur.Age = 0;
     }
     ScreenCur.Urgency          = (TreatmentUrgency)listUrgency.SelectedIndex;
     ScreenCur.HasCaries        = GetCheckState(checkHasCaries);
     ScreenCur.NeedsSealants    = GetCheckState(checkNeedsSealants);
     ScreenCur.CariesExperience = GetCheckState(checkCariesExperience);
     ScreenCur.EarlyChildCaries = GetCheckState(checkEarlyChildCaries);
     ScreenCur.ExistingSealants = GetCheckState(checkExistingSealants);
     ScreenCur.MissingAllTeeth  = GetCheckState(checkMissingAllTeeth);
     ScreenCur.Birthdate        = PIn.Date(textBirthdate.Text);   //"" is OK
     ScreenCur.Comments         = textComments.Text;
     if (IsNew)
     {
         Screens.Insert(ScreenCur);
     }
     else
     {
         Screens.Update(ScreenCur);
     }
     DialogResult = DialogResult.OK;
 }
Пример #8
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (listMain.SelectedIndices.Count == 0)
     {
         MessageBox.Show("Please select items first.");
         return;
     }
     for (int i = 0; i < listMain.SelectedIndices.Count; i++)
     {
         Screens.Delete(ScreenList[listMain.SelectedIndices[i]]);
     }
     FillGrid();
 }
Пример #9
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         Screens.Delete(ScreenCur);
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this screening?"))
     {
         return;
     }
     Screens.Delete(ScreenCur);
     DialogResult = DialogResult.Cancel;
 }
Пример #10
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (ScreenList.Length > 0)
     {
         if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this screening group? All screenings in this group will be deleted?"))
         {
             return;
         }
     }
     for (int i = 0; i < ScreenList.Length; i++)
     {
         Screens.Delete(ScreenList[i]);
     }
     ScreenGroups.Delete(ScreenGroupCur);
     DialogResult = DialogResult.Cancel;
 }
Пример #11
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (gridMain.SelectedIndices.Length != 1)
     {
         MessageBox.Show("Please select one item first.");
         return;
     }
     ScreenGroupCur = ScreenGroupList[gridMain.GetSelectedIndex()];
     OpenDentBusiness.Screen[] screenList = Screens.Refresh(ScreenGroupCur.ScreenGroupNum);
     if (screenList.Length > 0)
     {
         MessageBox.Show("Not allowed to delete a screening group with items in it.");
         return;
     }
     ScreenGroups.Delete(ScreenGroupCur);
     FillGrid();
 }
Пример #12
0
        private void butDelete_Click(object sender, System.EventArgs e)
        {
            if (listMain.SelectedIndices.Count != 1)
            {
                MessageBox.Show("Please select one item first.");
                return;
            }
            ScreenGroup ScreenGroupCur = ScreenGroups.List[listMain.SelectedIndices[0]];

            Screens.Refresh(ScreenGroupCur.ScreenGroupNum);
            if (Screens.List.Length > 0)
            {
                MessageBox.Show("Not allowed to delete a screening group with items in it.");
                return;
            }
            ScreenGroups.Delete(ScreenGroupCur);
            FillGrid();
        }
Пример #13
0
        private void butDelete_Click(object sender, System.EventArgs e)
        {
            if (gridMain.SelectedIndices.Length != 1)
            {
                MessageBox.Show("Please select one item first.");
                return;
            }
            ScreenGroup screenGroupCur = _listScreenGroups[gridMain.GetSelectedIndex()];
            List <OpenDentBusiness.Screen> listScreens = Screens.GetScreensForGroup(screenGroupCur.ScreenGroupNum);

            if (listScreens.Count > 0)
            {
                MessageBox.Show("Not allowed to delete a screening group with items in it.");
                return;
            }
            ScreenGroups.Delete(screenGroupCur);
            FillGrid();
        }
Пример #14
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     //the first 6 fields are handled when the ScreenGroup is saved.
     ScreenCur.ScreenGroupOrder = PIn.Int(textScreenGroupOrder.Text);
     ScreenCur.ScreenGroupNum   = ScreenGroupCur.ScreenGroupNum;
     if (radioUnknown.Checked)
     {
         ScreenCur.Gender = PatientGender.Unknown;
     }
     else if (radioM.Checked)
     {
         ScreenCur.Gender = PatientGender.Male;
     }
     else if (radioF.Checked)
     {
         ScreenCur.Gender = PatientGender.Female;
     }
     ScreenCur.Race             = (PatientRaceOld)listRace.SelectedIndex;
     ScreenCur.GradeLevel       = (PatientGrade)comboGradeLevel.SelectedIndex;
     ScreenCur.Age              = PIn.Byte(textAge.Text);//"" is OK
     ScreenCur.Urgency          = (TreatmentUrgency)listUrgency.SelectedIndex;
     ScreenCur.HasCaries        = GetCheckState(checkHasCaries);
     ScreenCur.NeedsSealants    = GetCheckState(checkNeedsSealants);
     ScreenCur.CariesExperience = GetCheckState(checkCariesExperience);
     ScreenCur.EarlyChildCaries = GetCheckState(checkEarlyChildCaries);
     ScreenCur.ExistingSealants = GetCheckState(checkExistingSealants);
     ScreenCur.MissingAllTeeth  = GetCheckState(checkMissingAllTeeth);
     ScreenCur.Birthdate        = PIn.Date(textBirthdate.Text);   //"" is OK
     ScreenCur.Comments         = textComments.Text;
     if (IsNew)
     {
         Screens.Insert(ScreenCur);
     }
     else
     {
         Screens.Update(ScreenCur);
     }
     DialogResult = DialogResult.OK;
 }