Example #1
0
        ///<summary>ClinicNum of 0 creates a default rule for all clinics.</summary>
        public static void CreateCustomSheet(SheetInternalType sheetInternalType, bool createEClipboardRule = true, long clinicNum = 0, int days = 30)
        {
            var sheetDef = SheetDefs.GetInternalOrCustom(sheetInternalType);

            sheetDef.IsNew = true;
            SheetDefs.InsertOrUpdate(sheetDef);
            if (!createEClipboardRule)
            {
                return;
            }
            var existingAll    = EClipboardSheetDefs.Refresh();
            var existingClinic = existingAll.FindAll(x => x.ClinicNum == clinicNum);
            int items          = 0;

            existingClinic.ForEach(x => { x.ItemOrder = ++items; });
            existingAll.Add(new EClipboardSheetDef()
            {
                ClinicNum        = clinicNum,
                ResubmitInterval = TimeSpan.FromDays(days),
                SheetDefNum      = sheetDef.SheetDefNum,
                ItemOrder        = ++items,
            });
            EClipboardSheetDefs.Sync(existingAll, EClipboardSheetDefs.Refresh());
            SheetDefs.RefreshCache();
        }
Example #2
0
 private void CheckHasMobileLayout_CheckedChanged(object sender, EventArgs e)
 {
     if (!checkHasMobileLayout.Checked && SheetDefCur.SheetDefNum > 0 && EClipboardSheetDefs.IsSheetDefInUse(SheetDefCur.SheetDefNum))
     {
         MsgBox.Show("This sheet is currently being used by eClipboard, which requires sheets to have a mobile layout. " +
                     "You must remove this form from eClipboard rules before you can remove the mobile layout for this sheet.");
         checkHasMobileLayout.Checked = true;
     }
 }
 private void FillTabEClipboard()
 {
     //Fill the list of sheets
     _listEClipboardSheets = EClipboardSheetDefs.Refresh();
     //Set Clinics or No
     if (!PrefC.HasClinicsEnabled)
     {
         checkEClipboardUseDefaults.Visible = false;
     }
     else
     {
         clinicPickerEClipboard.SelectionChangeCommitted += new System.EventHandler(this.ClinicPickerEClipboard_SelectionChangeCommitted);
     }
     EClipboardSetControlsForClinicPrefs();
     //Subscribe to eclipboard events to fill grid if needed
     EClipboardEvent.Fired += eClipboardChangedEvent_Fired;
 }
 private void SaveTabEClipboard()
 {
     EClipboardPushPrefs();
     EClipboardSheetDefs.Sync(_listEClipboardSheets, EClipboardSheetDefs.Refresh());
     EClipboardEvent.Fired -= eClipboardChangedEvent_Fired;
 }