Ejemplo n.º 1
0
 private void FormFeeSchedGroups_Load(object sender, EventArgs e)
 {
     SetFilterControlsAndAction(() => FilterFeeSchedGroups(), textFeeSched);
     //No restricting clinics because this window assumes that the user is an admin without restricted clinics
     _listAllClinics             = Clinics.GetWhere(x => x.ClinicNum > -1 && x.IsHidden == false).OrderBy(x => x.Abbr).ToList(); //Get all Clinics from cache that are not hidden
     _listFeeSchedGroups         = FeeSchedGroups.GetAll().OrderBy(x => x.Description).ToList();
     _listFeeSchedGroupsFiltered = _listFeeSchedGroups.DeepCopyList <FeeSchedGroup, FeeSchedGroup>();
     FillClinicCombo();
     FilterFeeSchedGroups();
 }
Ejemplo n.º 2
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     //This button is hidden if the user is adding a new FeeSchedGroup.
     if (MsgBox.Show(this, MsgBoxButtons.YesNo, "Are you sure you want to delete this Fee Schedule Group?"))
     {
         FeeSchedGroups.Delete(_feeSchedGroupCur.FeeSchedGroupNum);
     }
     DialogResult = DialogResult.Cancel;
     this.Close();
 }
Ejemplo n.º 3
0
        private void gridGroups_CellDoubleClick(object sender, UI.ODGridClickEventArgs e)
        {
            FeeSchedGroup         feeSchedGroupCur = (FeeSchedGroup)gridGroups.ListGridRows[e.Row].Tag;
            FormFeeSchedGroupEdit formFG           = new FormFeeSchedGroupEdit(feeSchedGroupCur);

            formFG.ShowDialog();
            if (formFG.DialogResult == DialogResult.OK)
            {
                FeeSchedGroups.Update(feeSchedGroupCur);
            }
            //Still need to refresh incase the user deleted the FeeSchedGroup, since it returns DialogResult.Cancel.
            FilterFeeSchedGroups();
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
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);
 }
Ejemplo n.º 6
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FeeSchedGroup feeSchedGroupNew = new FeeSchedGroup()
            {
                ListClinicNumsAll = new List <long>(), IsNew = true
            };
            FormFeeSchedGroupEdit formFG = new FormFeeSchedGroupEdit(feeSchedGroupNew);

            formFG.ShowDialog();
            if (formFG.DialogResult == DialogResult.OK)
            {
                FeeSchedGroups.Insert(feeSchedGroupNew);
                _listFeeSchedGroups.Add(feeSchedGroupNew);
                _listFeeSchedGroups = _listFeeSchedGroups.OrderBy(x => x.Description).ToList();
                FilterFeeSchedGroups();
            }
        }
Ejemplo n.º 7
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();
 }