コード例 #1
0
ファイル: LabelSingle.cs プロジェクト: radtek/opendental
        ///<summary></summary>
        public static void PrintAppointment(long aptNum)
        {
            SheetDef        sheetDef;
            List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.LabelAppointment);

            if (customSheetDefs.Count == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelAppointment);
            }
            else
            {
                sheetDef = customSheetDefs[0];
                SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            Sheet sheet = SheetUtil.CreateSheet(sheetDef);

            SheetParameter.SetParameter(sheet, "AptNum", aptNum);
            SheetFiller.FillFields(sheet);
            try {
                SheetPrinting.Print(sheet);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
        private void butPrint_Click(object sender, System.EventArgs e)
        {
            //only visible if sheet==null.
            if (comboSendStatus.SelectedIndex == (int)RxSendStatus.InElectQueue ||
                comboSendStatus.SelectedIndex == (int)RxSendStatus.SentElect)
            {
                //do not change status
            }
            else
            {
                comboSendStatus.SelectedIndex = (int)RxSendStatus.Printed;
            }
            if (!SaveRx())
            {
                return;
            }
            SheetDef        sheetDef;
            List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.Rx);

            if (customSheetDefs.Count == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.Rx);
            }
            else
            {
                sheetDef = customSheetDefs[0];
                SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            sheet = SheetUtil.CreateSheet(sheetDef, PatCur.PatNum);
            SheetParameter.SetParameter(sheet, "RxNum", RxPatCur.RxNum);
            SheetFiller.FillFields(sheet);
            SheetUtil.CalculateHeights(sheet, this.CreateGraphics());
            SheetPrinting.PrintRx(sheet, RxPatCur.IsControlled);
            DialogResult = DialogResult.OK;
        }
コード例 #3
0
ファイル: SheetDefs.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Returns the SheetTypeEnum & Sheet Def defaults for a clinic, if clinics is not on/or user is altering HQ settings
        ///it will instead return user defaults, if neither is present then it will return the pratice default.</summary>
        public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefs(long clinicNum = 0, params SheetTypeEnum[] arrSheetTypes)
        {
            //No need to check RemotingRole; no call to db.
            Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>();

            foreach (SheetTypeEnum sheetTypeEnum in arrSheetTypes)
            {
                SheetDef defaultSheetDef = GetSheetDef(PrefC.GetDefaultSheetDefNum(sheetTypeEnum), false);
                if (clinicNum == 0)
                {
                    if (defaultSheetDef == null)
                    {
                        defaultSheetDef = SheetsInternal.GetSheetDef(sheetTypeEnum);
                    }
                    retVal.Add(sheetTypeEnum, defaultSheetDef);
                }
                else
                {
                    ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(sheetTypeEnum), clinicNum);
                    defaultSheetDef = SheetsInternal.GetSheetDef(sheetTypeEnum);
                    if (clinicPrefCur != null && PIn.Long(clinicPrefCur.ValueString) != 0)                 //If ValueString is 0 then we want to keep it as the internal sheet def.
                    {
                        defaultSheetDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false);
                    }
                    if (clinicPrefCur != null)                   //If there was a row in the clinicpref table, add whatever the sheetdef was to the retval dictionary.
                    {
                        retVal.Add(sheetTypeEnum, defaultSheetDef);
                    }
                }
            }
            return(retVal);
        }
コード例 #4
0
ファイル: FormRpRouting.cs プロジェクト: steev90/opendental
        /// <summary>Specify a sheetDefNum of 0 for the internal Routing slip.</summary>
        private void PrintRoutingSlips(List <long> aptNums, long sheetDefNum)
        {
            SheetDef sheetDef;

            if (sheetDefNum == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.RoutingSlip);
            }
            else
            {
                sheetDef = SheetDefs.GetSheetDef(sheetDefNum);              //includes fields and parameters
            }
            List <Sheet> sheetBatch = SheetUtil.CreateBatch(sheetDef, aptNums);

            if (sheetBatch.Count == 0)
            {
                MsgBox.Show(this, "There are no routing slips to print.");
                return;
            }
            try {
                SheetPrinting.PrintBatch(sheetBatch);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #5
0
ファイル: SheetDefs.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Passing in a clinicNum of 0 will use the base default sheet def.  Otherwise returns the clinic specific default sheetdef.</summary>
        public static SheetDef GetSheetsDefault(SheetTypeEnum sheetType, long clinicNum = 0)
        {
            //No need to check RemotingRole; no call to db.
            ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(sheetType), clinicNum);
            SheetDef   defaultSheetDef;

            if (clinicPrefCur == null)           //If there wasn't a row for the specific clinic, use the base default sheetdef
            {
                defaultSheetDef = GetSheetDef(PrefC.GetDefaultSheetDefNum(sheetType), false);
                if (defaultSheetDef == null)
                {
                    defaultSheetDef = SheetsInternal.GetSheetDef(sheetType);
                }
                return(defaultSheetDef);               //Return the base default sheetdef
            }
            //Clinic specific sheet def found
            if (PIn.Long(clinicPrefCur.ValueString) == 0)           //If ValueString is 0 then we want to keep it as the internal sheet def.
            {
                defaultSheetDef = SheetsInternal.GetSheetDef(sheetType);
            }
            else
            {
                defaultSheetDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false);
            }
            return(defaultSheetDef);
        }
コード例 #6
0
        private void butSlip_Click(object sender, EventArgs e)
        {
            int idx = gridMain.GetSelectedIndex();

            if (idx == -1)
            {
                MsgBox.Show(this, "Please select a referral first");
                return;
            }
            Referral referral = ReferralL.GetReferral(((RefAttach)gridMain.ListGridRows[idx].Tag).ReferralNum);

            if (referral == null)
            {
                return;
            }
            SheetDef sheetDef;

            if (referral.Slip == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip);
            }
            else
            {
                sheetDef = SheetDefs.GetSheetDef(referral.Slip);
            }
            Sheet sheet = SheetUtil.CreateSheet(sheetDef, PatNum);

            SheetParameter.SetParameter(sheet, "PatNum", PatNum);
            SheetParameter.SetParameter(sheet, "ReferralNum", referral.ReferralNum);
            SheetFiller.FillFields(sheet);
            SheetUtil.CalculateHeights(sheet);
            FormSheetFillEdit.ShowForm(sheet);
        }
コード例 #7
0
        private void butSlip_Click(object sender, EventArgs e)
        {
            int idx = gridMain.GetSelectedIndex();

            if (idx == -1)
            {
                MsgBox.Show(this, "Please select a referral first");
                return;
            }
            Referral referral = Referrals.GetReferral(RefAttachList[idx].ReferralNum);
            SheetDef sheetDef;

            if (referral.Slip == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip);
            }
            else
            {
                sheetDef = SheetDefs.GetSheetDef(referral.Slip);
            }
            Sheet sheet = SheetUtil.CreateSheet(sheetDef, PatNum);

            SheetParameter.SetParameter(sheet, "PatNum", PatNum);
            SheetParameter.SetParameter(sheet, "ReferralNum", referral.ReferralNum);
            SheetFiller.FillFields(sheet);
            SheetUtil.CalculateHeights(sheet, this.CreateGraphics());
            FormSheetFillEdit FormS = new FormSheetFillEdit(sheet);

            FormS.ShowDialog();
            //grid will not be refilled, so no need to reselect.
        }
コード例 #8
0
 private void FillGridInternal()
 {
     //Get the list of SheetDefs that are for Dashboards.
     SheetDef[] sheetDefs = Enum.GetValues(typeof(SheetInternalType)).OfType <SheetInternalType>()
                            .Where(x => x.GetAttributeOrDefault <SheetInternalAttribute>().DoShowInDashboardSetup)
                            .Select(x => SheetsInternal.GetSheetDef(x))
                            .ToArray();
     FillGrid(gridInternal, true, sheetDefs);
 }
コード例 #9
0
ファイル: SheetDefs.cs プロジェクト: ChemBrain/OpenDental
        public static SheetDef GetInternalOrCustom(SheetInternalType sheetInternalType)
        {
            SheetDef retVal = SheetsInternal.GetSheetDef(sheetInternalType);
            SheetDef custom = GetCustomForType(retVal.SheetType).OrderBy(x => x.Description).ThenBy(x => x.SheetDefNum).FirstOrDefault();

            if (custom != null)
            {
                retVal = GetSheetDef(custom.SheetDefNum);
            }
            return(retVal);
        }
コード例 #10
0
ファイル: LabelSingle.cs プロジェクト: radtek/opendental
        ///<summary></summary>
        public static void PrintCarriers(List <long> carrierNums)
        {
            SheetDef     sheetDef   = SheetsInternal.GetSheetDef(SheetInternalType.LabelCarrier);
            List <Sheet> sheetBatch = SheetUtil.CreateBatch(sheetDef, carrierNums);

            try{
                SheetPrinting.PrintBatch(sheetBatch);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #11
0
        private void listSheetType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!IsInitial)
            {
                return;
            }
            if (listSheetType.SelectedIndex == -1)
            {
                return;
            }
            SheetDef sheetdef = null;

            checkHasMobileLayout.Enabled = false;
            switch (_sheetTypeSelected)
            {
            case SheetTypeEnum.LabelCarrier:
            case SheetTypeEnum.LabelPatient:
            case SheetTypeEnum.LabelReferral:
                sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail);
                if (textDescription.Text == "")
                {
                    textDescription.Text = _sheetTypeSelected.GetDescription();
                }
                comboFontName.Text       = sheetdef.FontName;
                textFontSize.Text        = sheetdef.FontSize.ToString();
                textWidth.Text           = sheetdef.Width.ToString();
                textHeight.Text          = sheetdef.Height.ToString();
                checkIsLandscape.Checked = sheetdef.IsLandscape;
                break;

            case SheetTypeEnum.ReferralSlip:
                sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip);
                if (textDescription.Text == "")
                {
                    textDescription.Text = _sheetTypeSelected.GetDescription();
                }
                comboFontName.Text       = sheetdef.FontName;
                textFontSize.Text        = sheetdef.FontSize.ToString();
                textWidth.Text           = sheetdef.Width.ToString();
                textHeight.Text          = sheetdef.Height.ToString();
                checkIsLandscape.Checked = sheetdef.IsLandscape;
                break;

            case SheetTypeEnum.PatientForm:
            case SheetTypeEnum.MedicalHistory:
                checkHasMobileLayout.Enabled = true;
                break;
            }
            if (!checkHasMobileLayout.Enabled)              //Only change the check state if the selected form does not allow mobile sheet layout
            {
                checkHasMobileLayout.Checked = false;
            }
        }
コード例 #12
0
        ///<summary>Reloads the control with any new sheet layouts available.
        ///This should only be called if a dynamic sheetDef was added/modified/deleted, the SheetLayoutMode has changed, or a new user signed in.</summary>
        public void ReloadSheetLayout(SheetFieldLayoutMode sheetFieldLayoutMode, Dictionary <string, Control> dictionaryControls)
        {
            long practiceDefaultSheetDefNum = PrefC.GetLong(PrefName.SheetsDefaultChartModule);

            ListSheetDefsLayout = SheetDefs.GetCustomForType(_sheetType);
            ListSheetDefsLayout.Add(SheetsInternal.GetSheetDef(SheetsInternal.GetInternalType(_sheetType))); //Internal at bottom of list. UI reflects this too.
            ListSheetDefsLayout = ListSheetDefsLayout
                                  .OrderBy(x => x.SheetDefNum != practiceDefaultSheetDefNum)                 //practice default sheetdef should be at the top of the list
                                  .ThenBy(x => x.SheetDefNum == 0)                                           //if the internal sheetdef is not the default it should be last
                                  .ThenBy(x => x.Description)                                                //order custom sheetdefs by description
                                  .ThenBy(x => x.SheetDefNum).ToList();                                      //then by SheetDefNum to be deterministic order
            InitLayoutForSheetDef(GetLayoutForUser(), sheetFieldLayoutMode, dictionaryControls, true);       //Force refresh in case they edit current layout.
        }
コード例 #13
0
        public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefs()
        {
            //No need to check RemotingRole; no call to db.
            Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>();
            SheetDef defaultRxDef = GetSheetDef(PrefC.GetDefaultSheetDefNum(SheetTypeEnum.Rx), false);

            if (defaultRxDef == null)
            {
                defaultRxDef = SheetsInternal.GetSheetDef(SheetTypeEnum.Rx);
            }
            retVal.Add(SheetTypeEnum.Rx, defaultRxDef);
            return(retVal);
        }
コード例 #14
0
        private List <Sheet> GetSheetsForTransfer(List <long> listPatNumsToTransfer)
        {
            List <Sheet>   retVal       = new List <Sheet>();
            List <Patient> listPatients = Patients.GetMultPats(listPatNumsToTransfer).ToList();

            foreach (Patient pat in listPatients)
            {
                Sheet sheetCemt = SheetUtil.CreateSheet(SheetsInternal.GetSheetDef(SheetInternalType.PatientTransferCEMT));
                SheetFiller.FillFieldsForPatientTransferCEMT(sheetCemt, pat);
                retVal.Add(sheetCemt);
            }
            return(retVal);
        }
コード例 #15
0
ファイル: FormDepositEdit.cs プロジェクト: nampn/ODental
        private void butPrint_Click(object sender, System.EventArgs e)
        {
            if (textDate.errorProvider1.GetError(textDate) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            if (IsNew)
            {
                if (!SaveToDB())
                {
                    return;
                }
            }
            else             //not new
                             //Only allowed to change date and bank account info, NOT attached checks.
                             //We enforce security here based on date displayed, not date entered.
                             //If user is trying to change date without permission:
            {
                DateTime date = PIn.Date(textDate.Text);
                if (Security.IsAuthorized(Permissions.DepositSlips, date, true))
                {
                    if (!SaveToDB())
                    {
                        return;
                    }
                }
                //if security.NotAuthorized, then it simply skips the save process before printing
            }
            SheetDef        sheetDef         = null;
            List <SheetDef> depositSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.DepositSlip);

            if (depositSheetDefs.Count > 0)
            {
                sheetDef = depositSheetDefs[0];
                SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            else
            {
                sheetDef = SheetsInternal.DepositSlip();
            }
            Sheet sheet = SheetUtil.CreateSheet(sheetDef, 0);

            SheetParameter.SetParameter(sheet, "DepositNum", DepositCur.DepositNum);
            SheetFiller.FillFields(sheet);
            SheetUtil.CalculateHeights(sheet, this.CreateGraphics());
            FormSheetFillEdit FormSF = new FormSheetFillEdit(sheet);

            FormSF.ShowDialog();
            DialogResult = DialogResult.OK;          //this is imporant, since we don't want to insert the deposit slip twice.
        }
コード例 #16
0
ファイル: LabelSingle.cs プロジェクト: radtek/opendental
        public static void PrintPatientLFPatNum(long patNum)
        {
            SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFPatNum);
            Sheet    sheet    = SheetUtil.CreateSheet(sheetDef);

            SheetParameter.SetParameter(sheet, "PatNum", patNum);
            SheetFiller.FillFields(sheet);
            try {
                SheetPrinting.Print(sheet);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #17
0
ファイル: FormLabCaseEdit.cs プロジェクト: nampn/ODental
        /*private void buttonEmail_Click(object sender,EventArgs e) {
         *      int CurPatNum=CaseCur.PatNum;
         *      EmailMessage message=new EmailMessage();
         *      message.PatNum=CurPatNum;
         *      Patient pat=Patients.GetPat(CurPatNum);
         *      message.ToAddress="";//pat.Email;
         *      message.FromAddress=PrefC.GetString(PrefName.EmailSenderAddress");
         *      message.Subject=Lan.g(this,"RE: ")+pat.GetNameFL();
         *      FormEmailMessageEdit FormE=new FormEmailMessageEdit(message);
         *      FormE.IsNew=true;
         *      FormE.ShowDialog();
         *
         * }*/

        private void butSlip_Click(object sender, EventArgs e)
        {
            if (sheet == null)           //create new
            {
                if (!SaveToDb())
                {
                    return;
                }
                Laboratory lab = ListLabs[listLab.SelectedIndex];
                SheetDef   sheetDef;
                if (lab.Slip == 0)
                {
                    sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabSlip);
                }
                else
                {
                    sheetDef = SheetDefs.GetSheetDef(lab.Slip);
                }
                sheet = SheetUtil.CreateSheet(sheetDef, CaseCur.PatNum);
                SheetParameter.SetParameter(sheet, "PatNum", CaseCur.PatNum);
                SheetParameter.SetParameter(sheet, "LabCaseNum", CaseCur.LabCaseNum);
                SheetFiller.FillFields(sheet);
                SheetUtil.CalculateHeights(sheet, this.CreateGraphics());
                FormSheetFillEdit FormS = new FormSheetFillEdit(sheet);
                FormS.ShowDialog();
                //if(FormS.DialogResult!=DialogResult.OK) {
                //	sheet=null;
                //	return;
                //}
            }
            else              //edit existing
            {
                SheetFields.GetFieldsAndParameters(sheet);
                FormSheetFillEdit FormS = new FormSheetFillEdit(sheet);
                FormS.ShowDialog();
                //if(FormS.DialogResult!=DialogResult.OK) {
                //	return;
                //}
            }
            //refresh
            sheet = Sheets.GetLabSlip(CaseCur.PatNum, CaseCur.LabCaseNum);
            if (sheet == null)
            {
                butSlip.Text = Lan.g(this, "New Slip");
            }
            else
            {
                butSlip.Text = Lan.g(this, "Edit Slip");
            }
        }
コード例 #18
0
        private void PrintRoutingSlipsForAppts(List <long> listAptNums)
        {
            SheetDef        sheetDef;
            List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.RoutingSlip);

            if (customSheetDefs.Count == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.RoutingSlip);
            }
            else
            {
                sheetDef = customSheetDefs[0];              //Instead of doing this, we could give the user a list to pick from on this form.
                //SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            PrintRoutingSlips(listAptNums, sheetDef.SheetDefNum);
        }
コード例 #19
0
 private void RefreshAndFillGrids(long selectedSheetNum = -1)
 {
     #region Refresh both sheetDef lists
     SheetDefs.RefreshCache();
     SheetFieldDefs.RefreshCache();
     _listOtherSheetDefs = new List <SheetDef>()
     {
         SheetsInternal.GetSheetDef(SheetInternalType.ChartModule)
     };                                                                                                                 //Must always be first in list.
     List <SheetDef> listCustomSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.ChartModule);
     //_listOtherSheetDefs.AddRange(listCustomSheetDefs.FindAll(x => x.UserNum!=Security.CurUser.UserNum));//All other users.
     //_listCustomSheetDefs=listCustomSheetDefs.FindAll(x => x.UserNum==Security.CurUser.UserNum);
     #endregion
     FillGrid(gridOtherLayouts, _listOtherSheetDefs, selectedSheetNum);
     FillGrid(gridCustomLayouts, _listCustomSheetDefs, selectedSheetNum);
 }
コード例 #20
0
ファイル: LabelSingle.cs プロジェクト: radtek/opendental
        public static void PrintText(long patNum, string text)
        {
            SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelText);
            Sheet    sheet    = SheetUtil.CreateSheet(sheetDef);

            SheetParameter.SetParameter(sheet, "PatNum", patNum);
            sheet.Parameters.Add(new SheetParameter(false, "text"));
            SheetParameter.SetParameter(sheet, "text", text);
            SheetFiller.FillFields(sheet);
            try {
                SheetPrinting.Print(sheet);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #21
0
        public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefsForClinic(long clinicNum)
        {
            //No need to check RemotingRole; no call to db.
            Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>();
            ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(SheetTypeEnum.Rx), clinicNum);
            SheetDef   defaultRxDef  = SheetsInternal.GetSheetDef(SheetTypeEnum.Rx);

            if (clinicPrefCur != null && PIn.Long(clinicPrefCur.ValueString) != 0)         //If ValueString is 0 then we want to keep it as the internal sheet def.
            {
                defaultRxDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false);
            }
            if (clinicPrefCur != null)           //If there was a row in the clinicpref table, add whatever the sheetdef was to the retval dictionary.
            {
                retVal.Add(SheetTypeEnum.Rx, defaultRxDef);
            }
            return(retVal);
        }
コード例 #22
0
        /*private void buttonEmail_Click(object sender,EventArgs e) {
         *      int CurPatNum=CaseCur.PatNum;
         *      EmailMessage message=new EmailMessage();
         *      message.PatNum=CurPatNum;
         *      Patient pat=Patients.GetPat(CurPatNum);
         *      message.ToAddress="";//pat.Email;
         *      message.FromAddress=PrefC.GetString(PrefName.EmailSenderAddress");
         *      message.Subject=Lan.g(this,"RE: ")+pat.GetNameFL();
         *      FormEmailMessageEdit FormE=new FormEmailMessageEdit(message);
         *      FormE.IsNew=true;
         *      FormE.ShowDialog();
         *
         * }*/

        private void butSlip_Click(object sender, EventArgs e)
        {
            if (sheet == null)           //create new
            {
                if (!SaveToDb())
                {
                    return;
                }
                Laboratory lab = ListLabs[listLab.SelectedIndex];
                SheetDef   sheetDef;
                if (lab.Slip == 0)
                {
                    sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabSlip);
                }
                else
                {
                    sheetDef = SheetDefs.GetSheetDef(lab.Slip);
                }
                sheet = SheetUtil.CreateSheet(sheetDef, CaseCur.PatNum);
                SheetParameter.SetParameter(sheet, "PatNum", CaseCur.PatNum);
                SheetParameter.SetParameter(sheet, "LabCaseNum", CaseCur.LabCaseNum);
                SheetFiller.FillFields(sheet);
                SheetUtil.CalculateHeights(sheet, this.CreateGraphics());
                FormSheetFillEdit FormS = new FormSheetFillEdit(sheet);
                FormS.ShowDialog();
            }
            else              //edit existing
            {
                SheetFields.GetFieldsAndParameters(sheet);
                FormSheetFillEdit FormS = new FormSheetFillEdit(sheet);
                FormS.ShowDialog();
            }
            //refresh
            sheet = Sheets.GetLabSlip(CaseCur.PatNum, CaseCur.LabCaseNum);
            if (sheet == null)
            {
                butSlip.Text = Lan.g(this, "New Slip");
            }
            else
            {
                butSlip.Text      = Lan.g(this, "Edit Slip");
                butCancel.Enabled = false;              //user can still click X to close window, but we do handle that as well.
            }
        }
コード例 #23
0
ファイル: FormSheetDef.cs プロジェクト: steev90/opendental
        private void listSheetType_Click(object sender, EventArgs e)
        {
            if (!IsInitial)
            {
                return;
            }
            if (listSheetType.SelectedIndex == -1)
            {
                return;
            }
            SheetDef sheetdef = null;

            switch ((SheetTypeEnum)listSheetType.SelectedIndex)
            {
            case SheetTypeEnum.LabelCarrier:
            case SheetTypeEnum.LabelPatient:
            case SheetTypeEnum.LabelReferral:
                sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail);
                if (textDescription.Text == "")
                {
                    textDescription.Text = ((SheetTypeEnum)listSheetType.SelectedIndex).ToString();
                }
                comboFontName.Text       = sheetdef.FontName;
                textFontSize.Text        = sheetdef.FontSize.ToString();
                textWidth.Text           = sheetdef.Width.ToString();
                textHeight.Text          = sheetdef.Height.ToString();
                checkIsLandscape.Checked = sheetdef.IsLandscape;
                break;

            case SheetTypeEnum.ReferralSlip:
                sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip);
                if (textDescription.Text == "")
                {
                    textDescription.Text = ((SheetTypeEnum)listSheetType.SelectedIndex).ToString();
                }
                comboFontName.Text       = sheetdef.FontName;
                textFontSize.Text        = sheetdef.FontSize.ToString();
                textWidth.Text           = sheetdef.Width.ToString();
                textHeight.Text          = sheetdef.Height.ToString();
                checkIsLandscape.Checked = sheetdef.IsLandscape;
                break;
            }
        }
コード例 #24
0
ファイル: FormRpRouting.cs プロジェクト: steev90/opendental
        private void butOK_Click(object sender, System.EventArgs e)
        {
            //validate user input
            if (textDate.errorProvider1.GetError(textDate) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            if (textDate.Text.Length == 0)
            {
                MessageBox.Show(Lan.g(this, "Date is required."));
                return;
            }
            date = PIn.Date(textDate.Text);
            if (listProv.SelectedIndices.Count == 0)
            {
                MessageBox.Show(Lan.g(this, "You must select at least one provider."));
                return;
            }
            List <long> provNums = new List <long>();

            for (int i = 0; i < listProv.SelectedIndices.Count; i++)
            {
                provNums.Add(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum);
            }
            List <long>     aptNums = Appointments.GetRouting(date, provNums);
            SheetDef        sheetDef;
            List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.RoutingSlip);

            if (customSheetDefs.Count == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.RoutingSlip);
            }
            else
            {
                sheetDef = customSheetDefs[0];              //Instead of doing this, we could give the user a list to pick from on this form.
                //SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            PrintRoutingSlips(aptNums, sheetDef.SheetDefNum);
            DialogResult = DialogResult.OK;
        }
コード例 #25
0
        private void FillGrid1()
        {
            grid1.BeginUpdate();
            grid1.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableSheetDef", "Description"), 170);

            grid1.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSheetDef", "Type"), 100);
            grid1.Columns.Add(col);
            grid1.Rows.Clear();
            ODGridRow row;

            internalList = SheetsInternal.GetAllInternal();
            for (int i = 0; i < internalList.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(internalList[i].Description);                //Enum.GetNames(typeof(SheetInternalType))[i]);
                row.Cells.Add(internalList[i].SheetType.ToString());
                grid1.Rows.Add(row);
            }
            grid1.EndUpdate();
        }
コード例 #26
0
        private void FormSheetDefs_Load(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup, true))
            {
                butNew.Enabled   = false;
                butCopy.Enabled  = false;
                butCopy2.Enabled = false;
                grid2.Enabled    = false;
            }
            internalList = SheetsInternal.GetAllInternal();
            internalList = internalList.OrderBy(x => x.SheetType.ToString()).ToList();
            List <SheetTypeEnum> listSheetTypes = internalList.Select(x => x.SheetType).Distinct().ToList();

            listFilter.SetItems(listSheetTypes,
                                (x => x.ToString()),
                                (x => _sheetTypeFilter.Contains(x))
                                );
            FillGrid1();
            FillGrid2();
            comboLabel.Items.Clear();
            comboLabel.Items.Add(Lan.g(this, "Default"));
            comboLabel.SelectedIndex = 0;
            LabelList = new List <SheetDef>();
            for (int i = 0; i < _listSheetDefs.Count; i++)
            {
                if (_listSheetDefs[i].SheetType == SheetTypeEnum.LabelPatient)
                {
                    LabelList.Add(_listSheetDefs[i].Copy());
                }
            }
            for (int i = 0; i < LabelList.Count; i++)
            {
                comboLabel.Items.Add(LabelList[i].Description);
                if (PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum) == LabelList[i].SheetDefNum)
                {
                    comboLabel.SelectedIndex = i + 1;
                }
            }
        }
コード例 #27
0
ファイル: LabelSingle.cs プロジェクト: radtek/opendental
        ///<summary></summary>
        public static void PrintPat(long patNum)
        {
            SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail);

            if (PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum) != 0)           //Try to use custom label sheet.
            {
                try {
                    sheetDef = SheetDefs.GetSheetDef(PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum));
                }
                catch {                //The default label could not be retrieved so just use the internal sheet.
                }
            }
            Sheet sheet = SheetUtil.CreateSheet(sheetDef);

            SheetParameter.SetParameter(sheet, "PatNum", patNum);
            SheetFiller.FillFields(sheet);
            try{
                SheetPrinting.Print(sheet);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #28
0
        ///<summary></summary>
        public static void PrintCarriers(List <long> carrierNums)
        {
            SheetDef        sheetDef;
            List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.LabelCarrier);

            if (customSheetDefs.Count == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelCarrier);
            }
            else
            {
                sheetDef = customSheetDefs[0];
                SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            List <Sheet> sheetBatch = SheetUtil.CreateBatch(sheetDef, carrierNums);

            try{
                SheetPrinting.PrintBatch(sheetBatch);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #29
0
ファイル: LabelSingle.cs プロジェクト: nampn/ODental
        ///<summary></summary>
        public static void PrintPat(long patNum)
        {
            SheetDef sheetDef;

            if (PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum) == 0)
            {
                sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail);
            }
            else
            {
                sheetDef = SheetDefs.GetSheetDef(PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum));
            }
            Sheet sheet = SheetUtil.CreateSheet(sheetDef);

            SheetParameter.SetParameter(sheet, "PatNum", patNum);
            SheetFiller.FillFields(sheet);
            try{
                SheetPrinting.Print(sheet);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #30
0
        ///<summary>Fills the combo box passed in with all of the sheet defs available for the passed in sheet type.</summary>
        private void FillSheetDefComboBox(ComboBox comboBox, SheetTypeEnum sheetType)
        {
            List <SheetDef> listSheetDefs = new List <SheetDef>();

            //Some sheet types have multiple "internal" examples for user convenience.
            //We need to make sure that we give ALL internal types as options for defaults.
            switch (sheetType)
            {
            case SheetTypeEnum.LabelPatient:
                //TODO: When there are multiple "internal" sheet defs available for the user to pick,
                //	we need to store the selection made as a string within the clinicpref tables "ValueString" column.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFAddress));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFChartNumber));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFPatNum));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientRadiograph));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelText));
                break;

            case SheetTypeEnum.PatientForm:
                //TODO: When there are multiple "internal" sheet defs available for the user to pick,
                //	we need to store the selection made as a string within the clinicpref tables "ValueString" column.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.PatientRegistration));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.FinancialAgreement));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.HIPAA));
                break;

            case SheetTypeEnum.MedicalHistory:
                //TODO: When there are multiple "internal" sheet defs available for the user to pick,
                //	we need to store the selection made as a string within the clinicpref tables "ValueString" column.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistNewPat));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistSimple));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistUpdate));
                break;

            case SheetTypeEnum.Consent:
            case SheetTypeEnum.DepositSlip:
            case SheetTypeEnum.ExamSheet:
            case SheetTypeEnum.LabelAppointment:
            case SheetTypeEnum.LabelCarrier:
            case SheetTypeEnum.LabelReferral:
            case SheetTypeEnum.LabSlip:
            case SheetTypeEnum.MedLabResults:
            case SheetTypeEnum.PatientLetter:
            case SheetTypeEnum.PaymentPlan:
            case SheetTypeEnum.ReferralLetter:
            case SheetTypeEnum.ReferralSlip:
            case SheetTypeEnum.RoutingSlip:
            case SheetTypeEnum.Rx:
            case SheetTypeEnum.RxMulti:
            case SheetTypeEnum.Screening:
            case SheetTypeEnum.Statement:
            case SheetTypeEnum.TreatmentPlan:
            default:
                //Sheet types will typically only have one internal example for the user to copy from.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(sheetType));
                break;
            }
            listSheetDefs.AddRange(SheetDefs.GetCustomForType(sheetType));
            comboBox.Items.Clear();
            comboBox.DisplayMember = "Description";
            comboBox.ValueMember   = "SheetDef";
            if (PrefC.HasClinicsEnabled && ((ClinicWrapper)comboClinicDefault.SelectedItem).Clinic.ClinicNum != 0)
            {
                comboBox.Items.Add(new SheetDefWrapper(Lan.g(this, "Default")));
            }
            foreach (SheetDef defCur in listSheetDefs)
            {
                SheetDefWrapper defNew = new SheetDefWrapper(defCur);
                comboBox.Items.Add(defNew);
                if (defCur.SheetDefNum == PrefC.GetDefaultSheetDefNum(sheetType))
                {
                    comboBox.SelectedItem = defNew;
                }
            }
            if (comboBox.SelectedIndex == -1 && comboBox.Items.Count > 0)
            {
                comboBox.SelectedIndex = 0;
            }
        }