示例#1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textRuleDesc.Text == "")
     {
         MsgBox.Show(this, "Description not allowed to be blank.");
         return;
     }
     if (!ProcedureCodes.IsValidCode(textCodeStart.Text) ||
         !ProcedureCodes.IsValidCode(textCodeEnd.Text))
     {
         MsgBox.Show(this, "Start and end codes must be valid procedure codes.");
         return;
     }
     ApptRuleCur.RuleDesc  = textRuleDesc.Text;
     ApptRuleCur.CodeStart = textCodeStart.Text;
     ApptRuleCur.CodeEnd   = textCodeEnd.Text;
     ApptRuleCur.IsEnabled = checkIsEnabled.Checked;
     if (IsNew)
     {
         AppointmentRules.Insert(ApptRuleCur);
     }
     else
     {
         AppointmentRules.Update(ApptRuleCur);
     }
     DialogResult = DialogResult.OK;
 }
示例#2
0
        private void FillGrid()
        {
            AppointmentRules.Refresh();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Description", 200);

            gridMain.Columns.Add(col);
            col = new ODGridColumn("Start Code", 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("End Code", 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Enabled", 50, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            UI.ODGridRow row;
            for (int i = 0; i < AppointmentRules.List.Length; i++)
            {
                row = new OpenDental.UI.ODGridRow();
                row.Cells.Add(AppointmentRules.List[i].RuleDesc);
                row.Cells.Add(AppointmentRules.List[i].ADACodeStart);
                row.Cells.Add(AppointmentRules.List[i].ADACodeEnd);
                if (AppointmentRules.List[i].IsEnabled)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
示例#3
0
        private void FillGrid()
        {
            AppointmentRules.RefreshCache();
            _listAppointmentRules = AppointmentRules.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Description", 200);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Start Code", 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("End Code", 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Enabled", 50, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            UI.GridRow row;
            for (int i = 0; i < _listAppointmentRules.Count; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(_listAppointmentRules[i].RuleDesc);
                row.Cells.Add(_listAppointmentRules[i].CodeStart);
                row.Cells.Add(_listAppointmentRules[i].CodeEnd);
                if (_listAppointmentRules[i].IsEnabled)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
示例#4
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     AppointmentRules.Delete(ApptRuleCur);
     DialogResult = DialogResult.OK;
 }