private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescription.Text == "")
            {
                MsgBox.Show(this, "Description cannot be blank.");
                return;
            }
            //We do not allow global fee schedules to be associated to FeeSchedGroups.
            //Prevent a fee sched that is associated to a group to be turned into a global fee schedule.
            if (PrefC.GetBool(PrefName.ShowFeeSchedGroups) && checkIsGlobal.Checked)
            {
                if (FeeSchedGroups.GetAllForFeeSched(FeeSchedCur.FeeSchedNum).Count() > 0)
                {
                    MsgBox.Show(this, "Not allowed to make Fee Schedule global, a Fee Schedule Group exists for this Fee Schedule.");
                    return;
                }
            }
            FeeSchedCur.Description  = textDescription.Text;
            FeeSchedCur.FeeSchedType = (FeeScheduleType)listType.SelectedIndex;
            FeeSchedCur.IsHidden     = checkIsHidden.Checked;
            bool isGlobalOld = FeeSchedCur.IsGlobal;

            FeeSchedCur.IsGlobal = checkIsGlobal.Checked;
            if (FeeSchedCur.IsNew)
            {
                FeeSchedCur.IsNew = false;
                ListFeeScheds.Add(FeeSchedCur);
            }
            if (isGlobalOld != FeeSchedCur.IsGlobal)
            {
                string log = "Edited Fee Schedule \"" + textDescription.Text + "\": Changed \"Use Headquarter's Fees\" from ";
                if (isGlobalOld)
                {
                    log += "Checked ";
                }
                else
                {
                    log += "Unchecked ";
                }
                if (FeeSchedCur.IsGlobal)
                {
                    log += "to Checked";
                }
                else
                {
                    log += "to Unchecked";
                }
                SecurityLogs.MakeLogEntry(Permissions.FeeSchedEdit, 0, log);
            }
            DialogResult = DialogResult.OK;
        }
Beispiel #2
0
 public FormFeeSchedGroupEdit(FeeSchedGroup feeSchedGroupCur)
 {
     InitializeComponent();
     Lan.F(this);
     _feeSchedGroupCur   = feeSchedGroupCur;
     _listClinicsInGroup = Clinics.GetClinics(_feeSchedGroupCur.ListClinicNumsAll ?? new List <long>());
     if (_feeSchedGroupCur.FeeSchedNum > 0)
     {
         _listOtherGroupsWithFeeSched = FeeSchedGroups.GetAllForFeeSched(_feeSchedGroupCur.FeeSchedNum)
                                        .FindAll(x => x.FeeSchedGroupNum != _feeSchedGroupCur.FeeSchedGroupNum);
     }
     _listFeeScheds = FeeScheds.GetDeepCopy(true);
     //Global fee schedules cannot be localized, so there can't be clinic overrides for them. This block also exists in FormFeeSchedEdit.cs
     _listFeeScheds.RemoveAll(x => x.IsGlobal == true);
 }
Beispiel #3
0
 private void comboFeeSched_SelectedIndexChanged(object sender, EventArgs e)
 {
     _listOtherGroupsWithFeeSched = FeeSchedGroups.GetAllForFeeSched(((ODBoxItem <FeeSched>)comboFeeSched.SelectedItem).Tag.FeeSchedNum)
                                    .FindAll(x => x.FeeSchedGroupNum != _feeSchedGroupCur.FeeSchedGroupNum);
     RefreshAvailableClinics();
 }