Пример #1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textFeeAmt.errorProvider1.GetError(textFeeAmt) != "" ||
         textPriInsAmt.errorProvider1.GetError(textPriInsAmt) != "" ||
         textSecInsAmt.errorProvider1.GetError(textSecInsAmt) != "" ||
         textDiscount.errorProvider1.GetError(textDiscount) != "" ||
         textPatAmt.errorProvider1.GetError(textPatAmt) != ""
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (comboPriority.SelectedIndex == 0)
     {
         ProcCur.Priority = 0;
     }
     else
     {
         ProcCur.Priority = DefB.Short[(int)DefCat.TxPriorities][comboPriority.SelectedIndex - 1].DefNum;
     }
     ProcCur.ToothNumTP = textToothNumTP.Text;
     ProcCur.Surf       = textSurf.Text;
     ProcCur.ProcCode   = textCode.Text;
     ProcCur.Descript   = textDescript.Text;
     ProcCur.FeeAmt     = PIn.PDouble(textFeeAmt.Text);
     ProcCur.PriInsAmt  = PIn.PDouble(textPriInsAmt.Text);
     ProcCur.SecInsAmt  = PIn.PDouble(textSecInsAmt.Text);
     ProcCur.Discount   = PIn.PDouble(textDiscount.Text);
     ProcCur.PatAmt     = PIn.PDouble(textPatAmt.Text);
     ProcTPs.InsertOrUpdate(ProcCur, false);           //IsNew not applicable here
     DialogResult = DialogResult.OK;
 }
Пример #2
0
        private void butDelete_Click(object sender, System.EventArgs e)
        {
            ProcTPs.Delete(ProcCur);
            SecurityLogs.MakeLogEntry(Permissions.TreatPlanEdit, ProcCur.PatNum, "Delete tp proc: " + ProcCur.Descript);

            DialogResult = DialogResult.OK;
        }
Пример #3
0
 private void butOK_Click(object sender, EventArgs e)
 {
     SaveSignature();            //"saves" signature to TPCur, does not save to DB.
     TreatPlans.Update(TPcur);   //save signature to DB.
     TPcur.ListProcTPs = ProcTPs.RefreshForTP(TPcur.TreatPlanNum);
     if (DoPrintUsingSheets)
     {
         SheetParameter.SetParameter(SheetTP, "TreatPlan", TPcur);               //update TP on sheet to have new signature for generating pdfs
     }
     if (TPcur.Signature.Length > 0 && TPcur.DocNum == 0 && PrefC.GetBool(PrefName.TreatPlanSaveSignedToPdf))
     {
         SigChanged = true;
     }
     else if (TPcur.DocNum > 0 && !Documents.DocExists(TPcur.DocNum) && PrefC.GetBool(PrefName.TreatPlanSaveSignedToPdf))
     {
         //Setting SigChanged to True will resave document below.
         SigChanged = MsgBox.Show(this, MsgBoxButtons.YesNo, "Cannot find saved copy of signed PDF, would you like to resave the document?");
     }
     if (PrefC.GetBool(PrefName.TreatPlanSaveSignedToPdf) && SaveDocDelegate != null && SigChanged && TPcur.Signature.Length > 0)
     {
         List <Document> docs = SaveDocDelegate(true, SheetTP);
         if (docs.Count > 0)
         {
             TPcur.DocNum = docs[0].DocNum;                //attach first Doc to TP.
             TreatPlans.Update(TPcur);                     //update docnum. must be called after signature is updated.
         }
     }
     SecurityLogs.MakeLogEntry(Permissions.TreatPlanEdit, TPcur.PatNum, "Sign TP");
     DialogResult = DialogResult.OK;
 }
Пример #4
0
        private void FormTPsign_Load(object sender, System.EventArgs e)
        {
            //this window never comes up for new TP.  Always saved ahead of time.
            if (!Security.IsAuthorized(Permissions.TreatPlanSign, TPcur.DateTP))
            {
                butOK.Enabled = false;
                signatureBoxWrapper.Enabled = false;
            }
            LayoutToolBar();
            ToolBarMain.Buttons["FullPage"].Pushed = true;
            previewContr.Location = new Point(0, ToolBarMain.Bottom);
            previewContr.Size     = new Size(ClientRectangle.Width, ClientRectangle.Height - ToolBarMain.Height - panelSig.Height);
            if (Document.DefaultPageSettings.PrintableArea.Height == 0)
            {
                Document.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100);
            }
            SetSize();
            previewContr.Document = Document;
            ToolBarMain.Buttons["PageNum"].Text = (previewContr.StartPage + 1).ToString()
                                                  + " / " + TotalPages.ToString();
            proctpList = ProcTPs.RefreshForTP(TPcur.TreatPlanNum);
            signatureBoxWrapper.SignatureMode = UI.SignatureBoxWrapper.SigMode.TreatPlan;
            string keyData = TreatPlans.GetKeyDataForSignatureHash(TPcur, proctpList);

            signatureBoxWrapper.FillSignature(TPcur.SigIsTopaz, keyData, TPcur.Signature);
        }
Пример #5
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     //if(IsNew){
     //	DialogResult=DialogResult.Cancel;
     //	return;
     //}
     ProcTPs.DeleteForTP(PlanCur.TreatPlanNum);
     try{
         TreatPlans.Delete(PlanCur);
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     TreatPlans.Delete(PlanCur);
     DialogResult = DialogResult.OK;
 }
Пример #6
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     //if(IsNew){
     //	DialogResult=DialogResult.Cancel;
     //	return;
     //}
     ProcTPs.DeleteForTP(PlanCur.TreatPlanNum);
     try{
         TreatPlans.Delete(PlanCur);
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     SecurityLogs.MakeLogEntry(Permissions.TreatPlanEdit, PlanCur.PatNum, "Delete TP: " + PlanCur.DateTP.ToShortDateString());
     DialogResult = DialogResult.OK;
 }
Пример #7
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textFeeAmt.errorProvider1.GetError(textFeeAmt) != "" ||
         textPriInsAmt.errorProvider1.GetError(textPriInsAmt) != "" ||
         textSecInsAmt.errorProvider1.GetError(textSecInsAmt) != "" ||
         textDiscount.errorProvider1.GetError(textDiscount) != "" ||
         textPatAmt.errorProvider1.GetError(textPatAmt) != "" ||
         !textFeeAllowed.IsValid
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (comboPriority.SelectedIndex == 0)
     {
         ProcCur.Priority = 0;
     }
     else
     {
         ProcCur.Priority = _listTxPriorityDefs[comboPriority.SelectedIndex - 1].DefNum;
     }
     ProcCur.ToothNumTP = textToothNumTP.Text;
     ProcCur.Surf       = textSurf.Text;
     ProcCur.ProcCode   = textCode.Text;
     ProcCur.Descript   = textDescript.Text;
     ProcCur.FeeAmt     = PIn.Double(textFeeAmt.Text);
     ProcCur.PriInsAmt  = PIn.Double(textPriInsAmt.Text);
     ProcCur.SecInsAmt  = PIn.Double(textSecInsAmt.Text);
     ProcCur.Discount   = PIn.Double(textDiscount.Text);
     ProcCur.PatAmt     = PIn.Double(textPatAmt.Text);
     ProcCur.Prognosis  = textPrognosis.Text;
     ProcCur.Dx         = textDx.Text;
     ProcCur.ProcAbbr   = textProcAbbr.Text;
     ProcCur.FeeAllowed = PIn.Double(textFeeAllowed.Text);
     ProcTPs.InsertOrUpdate(ProcCur, false);           //IsNew not applicable here
     SecurityLogs.MakeLogEntry(Permissions.TreatPlanEdit, ProcCur.PatNum, "Edit proc: " + ProcCur.Descript);
     DialogResult = DialogResult.OK;
 }
Пример #8
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     ProcTPs.Delete(ProcCur);
     DialogResult = DialogResult.OK;
 }
Пример #9
0
 private void FormTPsign_Load(object sender, System.EventArgs e)
 {
     //this window never comes up for new TP.  Always saved ahead of time.
     if (!Security.IsAuthorized(Permissions.TreatPlanEdit, TPcur.DateTP))
     {
         butOK.Enabled        = false;
         sigBox.Enabled       = false;
         butClearSig.Enabled  = false;
         butTopazSign.Enabled = false;
     }
     LayoutToolBar();
     ToolBarMain.Buttons["FullPage"].Pushed = true;
     previewContr.Location = new Point(0, ToolBarMain.Bottom);
     previewContr.Size     = new Size(ClientRectangle.Width, ClientRectangle.Height - ToolBarMain.Height - panelSig.Height);
     if (Document.DefaultPageSettings.PrintableArea.Height == 0)
     {
         Document.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100);
     }
     SetSize();
     previewContr.Document = Document;
     ToolBarMain.Buttons["PageNum"].Text = (previewContr.StartPage + 1).ToString()
                                           + " / " + TotalPages.ToString();
     labelInvalidSig.Visible = false;
     sigBox.Visible          = true;
     proctpList = ProcTPs.RefreshForTP(TPcur.TreatPlanNum);
     if (TPcur.SigIsTopaz)
     {
         if (TPcur.Signature != "")
         {
             //if(allowTopaz) {
             sigBox.Visible      = false;
             sigBoxTopaz.Visible = true;
             CodeBase.TopazWrapper.ClearTopaz(sigBoxTopaz);
             CodeBase.TopazWrapper.SetTopazCompressionMode(sigBoxTopaz, 0);
             CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz, 0);
             string keystring = TreatPlans.GetHashString(TPcur, proctpList);
             CodeBase.TopazWrapper.SetTopazKeyString(sigBoxTopaz, keystring);
             CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz, 2);                   //high encryption
             CodeBase.TopazWrapper.SetTopazCompressionMode(sigBoxTopaz, 2);                  //high encryption
             CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz, TPcur.Signature);
             sigBoxTopaz.Refresh();
             //If sig is not showing, then try encryption mode 3 for signatures signed with old SigPlusNet.dll.
             if (CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz) == 0)
             {
                 CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz, 3);                       //Unknown mode (told to use via TopazSystems)
                 CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz, TPcur.Signature);
             }
             if (CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz) == 0)
             {
                 labelInvalidSig.Visible = true;
             }
             //}
         }
     }
     else
     {
         if (TPcur.Signature != "")
         {
             sigBox.Visible      = true;
             sigBoxTopaz.Visible = false;
             sigBox.ClearTablet();
             //sigBox.SetSigCompressionMode(0);
             //sigBox.SetEncryptionMode(0);
             sigBox.SetKeyString(TreatPlans.GetHashString(TPcur, proctpList));
             //"0000000000000000");
             //sigBox.SetAutoKeyData(ProcCur.Note+ProcCur.UserNum.ToString());
             //sigBox.SetEncryptionMode(2);//high encryption
             //sigBox.SetSigCompressionMode(2);//high compression
             sigBox.SetSigString(TPcur.Signature);
             if (sigBox.NumberOfTabletPoints() == 0)
             {
                 labelInvalidSig.Visible = true;
             }
             sigBox.SetTabletState(0);                    //not accepting input.  To accept input, change the note, or clear the sig.
         }
     }
 }
Пример #10
0
        private void FormTPsign_Load(object sender, System.EventArgs e)
        {
            //this window never comes up for new TP.  Always saved ahead of time.
            if (!Security.IsAuthorized(Permissions.TreatPlanSign, TPcur.DateTP))
            {
                butOK.Enabled = false;
                signatureBoxWrapper.Enabled         = false;
                signatureBoxWrapperPractice.Enabled = false;
                textTypeSig.Enabled         = false;
                textTypeSigPractice.Enabled = false;
            }
            _hasSigPractice = (SheetTP == null ? false : (SheetTP.SheetFields.Any(x => x.FieldType == SheetFieldType.SigBoxPractice) && DoPrintUsingSheets));
            LayoutToolBar();
            ToolBarMain.Buttons["FullPage"].Pushed = true;
            previewContr.Location = new Point(0, ToolBarMain.Bottom);
            previewContr.Size     = new Size(ClientRectangle.Width, ClientRectangle.Height - ToolBarMain.Height - panelSig.Height);
            if (Document == null)           //Only set when not pringing using sheets, shet via a MigraDoc.
            //TODO:Implement ODprintout pattern - MigraDoc
            //Just signing the TP, there is no way to print a Treat' Plan from the Sign TP window so suppress the printer dialogs.
            //Users will click the Print TP button from the Treat' Plan module when they want to print.
            {
                PrinterL.ControlPreviewOverride = previewContr;              //Sets the printdoc to previewContr.Document after validation. Otherwise shows error.
                SheetPrinting.Print(SheetTP, isPrintDocument: false, isPreviewMode: true);
                if (ODprintout.CurPrintout.SettingsErrorCode != PrintoutErrorCode.Success)
                {
                    DialogResult = DialogResult.Cancel;
                    return;
                }
                Document = ODprintout.CurPrintout.PrintDoc;
            }
            else              //MigraDoc
            {
                if (Document.DefaultPageSettings.PrintableArea.Height == 0)
                {
                    Document.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100);
                }
                previewContr.Document = Document;
            }
            SetSize();
            ToolBarMain.Buttons["PageNum"].Text = (previewContr.StartPage + 1).ToString()
                                                  + " / " + TotalPages.ToString();
            proctpList = ProcTPs.RefreshForTP(TPcur.TreatPlanNum);
            //Fill TP signature
            signatureBoxWrapper.SignatureMode = UI.SignatureBoxWrapper.SigMode.TreatPlan;
            string keyData = TreatPlans.GetKeyDataForSignatureHash(TPcur, proctpList);

            signatureBoxWrapper.FillSignature(TPcur.SigIsTopaz, keyData, TPcur.Signature);
            SheetField sheetField;

            if (SheetTP != null)
            {
                sheetField = SheetTP.SheetFields.FirstOrDefault(x => x.FieldType == SheetFieldType.SigBox);
                if (sheetField != null && !string.IsNullOrEmpty(sheetField.FieldName))
                {
                    labelSig.Text = $"{sheetField.FieldName} sign here --->";
                }
                sheetField = SheetTP.GetSheetFieldByName("SignatureText");
                if (sheetField != null)
                {
                    textTypeSig.Text     = TPcur.SignatureText;
                    labelTypeSig.Visible = true;
                    textTypeSig.Visible  = true;
                }
            }
            //Fill TP practice signature if printing using sheets
            if (_hasSigPractice)
            {
                signatureBoxWrapperPractice.Visible       = true;
                labelSigPractice.Visible                  = true;
                signatureBoxWrapperPractice.SignatureMode = UI.SignatureBoxWrapper.SigMode.TreatPlan;
                signatureBoxWrapperPractice.FillSignature(TPcur.SigIsTopaz, keyData, TPcur.SignaturePractice);
                sheetField = SheetTP.SheetFields.FirstOrDefault(x => x.FieldType == SheetFieldType.SigBoxPractice);
                if (sheetField != null && !string.IsNullOrEmpty(sheetField.FieldName))
                {
                    labelSigPractice.Text = $"{sheetField.FieldName} sign here --->";
                }
                sheetField = SheetTP.GetSheetFieldByName("SignaturePracticeText");
                if (sheetField != null)
                {
                    textTypeSigPractice.Text     = TPcur.SignaturePracticeText;
                    labelTypeSigPractice.Visible = true;                  //defaulted to be hidden
                    textTypeSigPractice.Visible  = true;
                }
            }
        }