示例#1
0
        private void FillGrid()
        {
            Automations.RefreshCache();
            _listAutomations = Automations.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Description", 200);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Trigger", 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Action", 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Details", 200);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            UI.GridRow row;
            string     detail;

            for (int i = 0; i < _listAutomations.Count; i++)
            {
                row = new OpenDental.UI.GridRow();
                row.Cells.Add(_listAutomations[i].Description);
                if (_listAutomations[i].Autotrigger == AutomationTrigger.CompleteProcedure)
                {
                    row.Cells.Add(_listAutomations[i].ProcCodes);
                }
                else
                {
                    row.Cells.Add(_listAutomations[i].Autotrigger.ToString());
                }
                row.Cells.Add(_listAutomations[i].AutoAction.ToString());
                //details:
                detail = "";
                if (_listAutomations[i].AutoAction == AutomationAction.CreateCommlog)
                {
                    detail += Defs.GetName(DefCat.CommLogTypes, _listAutomations[i].CommType)
                              + ".  " + _listAutomations[i].MessageContent;
                }
                else if (_listAutomations[i].AutoAction == AutomationAction.PrintPatientLetter)
                {
                    detail += SheetDefs.GetDescription(_listAutomations[i].SheetDefNum);
                }
                else if (_listAutomations[i].AutoAction == AutomationAction.PrintReferralLetter)
                {
                    detail += SheetDefs.GetDescription(_listAutomations[i].SheetDefNum);
                }
                else if (_listAutomations[i].AutoAction == AutomationAction.ChangePatStatus)
                {
                    detail += Lans.g("enum" + nameof(PatientStatus), _listAutomations[i].PatStatus.GetDescription());
                }
                row.Cells.Add(detail);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }