Ejemplo n.º 1
0
        public void SyncFromDataSourceToTableModel(IHost host)
        {
            var myMeta = new dbRoot();

            myMeta.Connect(dbDriver.SQL, ConnectionString);

            try
            {
                Engine.MuteNotify();
                var tablesTrans = Tables.BeginTransaction();
                foreach (ITable metaTable in myMeta.DefaultDatabase.Tables)
                {
                    var table = tablesTrans.GetNamedChild <TableElement>(metaTable.Name);
                    Tables.AddChild(table);

                    var columnsTrans = table.Columns.BeginTransaction();
                    foreach (IColumn metaColumn in metaTable.Columns)
                    {
                        var column = columnsTrans.GetNamedChild <ColumnElement>(metaColumn.Name);

                        column.Name             = metaColumn.Name;
                        column.IsNullable       = metaColumn.IsNullable;
                        column.IsAutoKey        = metaColumn.IsAutoKey;
                        column.IsInPrimaryKey   = metaColumn.IsInPrimaryKey;
                        column.Default          = metaColumn.Default;
                        column.Ordinal          = metaColumn.Ordinal;
                        column.DbType           = metaColumn.DataTypeName;
                        column.MaxLength        = metaColumn.NumericPrecision;
                        column.AutoKeySeed      = metaColumn.AutoKeySeed;
                        column.AutoKeyIncrement = metaColumn.AutoKeyIncrement;

                        table.Columns.AddChild(column);
                    }
                }

                //update foreign keys
                //must be done in a 2nd step since all columns are not available in the first loop
                foreach (ITable metaTable in myMeta.DefaultDatabase.Tables)
                {
                    var table            = tablesTrans.GetNamedChild <TableElement>(metaTable.Name);
                    var foreignKeysTrans = table.ForeignKeys.BeginTransaction();
                    foreach (IForeignKey metaForeignKey in metaTable.ForeignKeys)
                    {
                        if (metaForeignKey.PrimaryTable.Name == metaTable.Name)
                        {
                            continue;
                        }

                        var foreignKey = foreignKeysTrans.GetNamedChild <ForeignKeyElement>(metaForeignKey.Name);
                        foreignKey.PrimaryTable = tablesTrans.GetNamedChild <TableElement>(metaForeignKey.PrimaryTable.Name);
                        table.ForeignKeys.AddChild(foreignKey);
                        var foreignKeyTrans = foreignKey.BeginTransaction();

                        for (int i = 0; i < metaForeignKey.ForeignColumns.Count; i++)
                        {
                            var columnPair = new ColumnPairElement();
                            columnPair.PrimaryColumn = foreignKey.PrimaryTable.Columns.GetNamedChild <ColumnElement>(((IColumn)metaForeignKey.PrimaryColumns[i]).Name);
                            columnPair.ForeignColumn = foreignKey.ForeignTable.Columns.GetNamedChild <ColumnElement>(((IColumn)metaForeignKey.ForeignColumns[i]).Name);

                            foreignKey.AddChild(columnPair);
                        }
                    }
                }

                var viewTrans = Views.BeginTransaction();
                foreach (IView metaView in myMeta.DefaultDatabase.Views)
                {
                    var view = viewTrans.GetNamedChild <ViewElement>(metaView.Name);

                    view.Name = metaView.Name;
                    Views.AddChild(view);
                }

                var procTrans = Procedures.BeginTransaction();
                foreach (IProcedure metaProcedure in myMeta.DefaultDatabase.Procedures)
                {
                    if (metaProcedure.Type == 3)
                    {
                        continue;
                    }

                    var procedure = procTrans.GetNamedChild <ProcedureElement>(metaProcedure.Name);

                    procedure.Name = metaProcedure.Name;
                    Procedures.AddChild(procedure);
                }

                Engine.EnableNotify();
                Engine.OnNotifyChange();
            }
            catch
            {
                MessageBox.Show("Connection failed");
            }

            host.RefreshProjectTree();
        }
Ejemplo n.º 2
0
 public virtual DatabaseManager CreateDatabaseManager(GraphDatabaseFacade graphDatabaseFacade, PlatformModule platform, AbstractEditionModule edition, Procedures procedures, Logger msgLog)
 {
     return(new DefaultDatabaseManager(platform, edition, procedures, msgLog, graphDatabaseFacade));
 }
Ejemplo n.º 3
0
        protected internal static SecurityModule SetupSecurityModule(PlatformModule platformModule, AbstractEditionModule editionModule, Log log, Procedures procedures, string key)
        {
            SecurityModule.Dependencies  securityModuleDependencies = new SecurityModuleDependenciesDependencies(platformModule, editionModule, procedures);
            IEnumerable <SecurityModule> candidates = Service.load(typeof(SecurityModule));

            foreach (SecurityModule candidate in candidates)
            {
                if (candidate.Matches(key))
                {
                    try
                    {
                        candidate.Setup(securityModuleDependencies);
                        return(candidate);
                    }
                    catch (Exception e)
                    {
                        string errorMessage      = "Failed to load security module.";
                        string innerErrorMessage = e.Message;

                        if (!string.ReferenceEquals(innerErrorMessage, null))
                        {
                            log.Error(errorMessage + " Caused by: " + innerErrorMessage, e);
                        }
                        else
                        {
                            log.Error(errorMessage, e);
                        }
                        throw new Exception(errorMessage, e);
                    }
                }
            }
            string errorMessage = "Failed to load security module with key '" + key + "'.";

            log.Error(errorMessage);
            throw new System.ArgumentException(errorMessage);
        }
Ejemplo n.º 4
0
 public void NewProcedure(Procedure procedure)
 {
     Procedures.Add(procedure);
 }
Ejemplo n.º 5
0
 public Address GetProcedureAddress(Procedure proc)
 {
     return(Procedures.Where(de => de.Value == proc)
            .Select(de => de.Key)
            .FirstOrDefault());
 }
Ejemplo n.º 6
0
 public void Procedures_IsSameProcedureArea_SameToothNumPartialSurfMatch()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("5", "5", "", "", "ML", "M"));
 }
Ejemplo n.º 7
0
 public void Procedures_IsSameProcedureArea_HasNoArea()
 {
     //E.g. exams and BW's will not have any 'procedure areas' and should return true
     Assert.IsTrue(Procedures.IsSameProcedureArea("", "", "", "", "", ""));
 }
Ejemplo n.º 8
0
 public void Procedures_IsSameProcedureArea_DifferentToothNums()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("", "1", "", "", "", ""));
 }
Ejemplo n.º 9
0
 public void Procedures_IsSameProcedureArea_PartialMatchToothNums()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("22", "2", "", "", "", ""));
 }
Ejemplo n.º 10
0
        ///<summary>Creates a procedure and computes estimates for a patient where the secondary insurance has a COB rule of Medicaid.</summary>
        private void ComputeEstimatesFixedBenefits(string suffix, double procFee, double ppoFee, double fixedBenefitFee
                                                   , int priPercentCoveredOverride, bool hasSecondary, double secFee, Action <FixedBenefitAssertItem> assertAct)
        {
            Patient       pat                     = PatientT.CreatePatient(suffix);
            string        procStr                 = "D0150";
            Procedure     proc                    = ProcedureT.CreateProcedure(pat, procStr, ProcStat.TP, "", procFee);
            ProcedureCode procCode                = ProcedureCodes.GetProcCode(procStr);
            long          ppoFeeSchedNum          = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "PPO " + suffix);
            long          catPercFeeSchedNum      = FeeSchedT.CreateFeeSched(FeeScheduleType.Normal, "Category % " + suffix);
            long          fixedBenefitFeeSchedNum = FeeSchedT.CreateFeeSched(FeeScheduleType.FixedBenefit, "Fixed Benefit " + suffix);

            if (ppoFee > -1)
            {
                FeeT.CreateFee(ppoFeeSchedNum, procCode.CodeNum, ppoFee);
            }
            FeeT.CreateFee(fixedBenefitFeeSchedNum, procCode.CodeNum, fixedBenefitFee);
            InsuranceT.AddInsurance(pat, suffix, "p", ppoFeeSchedNum, copayFeeSchedNum: fixedBenefitFeeSchedNum);
            if (hasSecondary)
            {
                FeeT.CreateFee(catPercFeeSchedNum, procCode.CodeNum, secFee);
                InsuranceT.AddInsurance(pat, suffix, "", catPercFeeSchedNum, 2, false, EnumCobRule.Standard);
            }
            List <InsSub>  listSubs     = InsSubT.GetInsSubs(pat);
            List <InsPlan> listPlans    = InsPlans.RefreshForSubList(listSubs);
            List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum);
            InsPlan        priPlan      = InsPlanT.GetPlanForPriSecMed(PriSecMed.Primary, listPatPlans, listPlans, listSubs);
            InsPlan        secPlan      = null;

            if (hasSecondary)
            {
                secPlan = InsPlanT.GetPlanForPriSecMed(PriSecMed.Secondary, listPatPlans, listPlans, listSubs);
                //TODO:  Add diagnostic code benefit for 100%
                BenefitT.CreateCategoryPercent(secPlan.PlanNum, EbenefitCategory.Diagnostic, 100);
            }
            List <Benefit> listBens = Benefits.Refresh(listPatPlans, listSubs);

            Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, listPlans, listPatPlans, listBens, pat.Age, listSubs);
            List <ClaimProc> listClaimProcs = ClaimProcs.Refresh(pat.PatNum);

            if (priPercentCoveredOverride > 0)
            {
                foreach (ClaimProc cpCur in listClaimProcs)
                {
                    cpCur.PercentOverride = priPercentCoveredOverride;
                    ClaimProcs.Update(cpCur);
                }
                Procedures.ComputeEstimates(proc, pat.PatNum, new List <ClaimProc>(), false, listPlans, listPatPlans, listBens, pat.Age, listSubs);
                listClaimProcs = ClaimProcs.Refresh(pat.PatNum);
            }
            foreach (ClaimProc cpCur in listClaimProcs)
            {
                cpCur.PercentOverride = priPercentCoveredOverride;
                ClaimProcs.Update(cpCur);
            }
            Procedures.ComputeEstimates(proc, pat.PatNum, listClaimProcs, false, listPlans, listPatPlans, listBens, pat.Age, listSubs);
            listClaimProcs = ClaimProcs.Refresh(pat.PatNum);
            assertAct(new FixedBenefitAssertItem()
            {
                Procedure          = proc,
                PrimaryClaimProc   = listClaimProcs.FirstOrDefault(x => x.PlanNum == priPlan.PlanNum),
                SecondaryClaimProc = secPlan == null ? null : listClaimProcs.FirstOrDefault(x => x.PlanNum == secPlan.PlanNum),
            });
        }
Ejemplo n.º 11
0
 public void Procedures_IsSameProcedureArea_SameToothNums()
 {
     Assert.IsTrue(Procedures.IsSameProcedureArea("2", "2", "", "", "", ""));
 }
Ejemplo n.º 12
0
        /// <summary>claimType="P","S","PreAuth","W" (waiting to send).</summary>
        public static Claim CreateClaim(string claimType, List <PatPlan> PatPlanList, List <InsPlan> InsPlanList, List <ClaimProc> ClaimProcList,
                                        List <Procedure> procsForPat, Patient pat, List <Procedure> procsForClaim, List <Benefit> benefitList, List <InsSub> SubList,
                                        bool calculateLineNumber = true, string claimIdentifier = "")
        {
            //Claim ClaimCur=CreateClaim("P",PatPlanList,InsPlanList,ClaimProcList,procsForPat);
            InsPlan PlanCur1 = new InsPlan();
            InsSub  SubCur1  = new InsSub();
            InsPlan PlanCur2 = new InsPlan();
            InsSub  SubCur2  = new InsSub();

            switch (claimType)
            {
            case "P":
                SubCur1  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 1), SubList);
                PlanCur1 = InsPlans.GetPlan(SubCur1.PlanNum, InsPlanList);
                SubCur2  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 2), SubList);
                //PlanCur2=InsPlans.GetPlan(SubCur.PlanNum,InsPlanList);//can end up null
                break;

            case "S":
                SubCur1  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 2), SubList);
                PlanCur1 = InsPlans.GetPlan(SubCur1.PlanNum, InsPlanList);
                SubCur2  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 1), SubList);
                //PlanCur2=InsPlans.GetPlan(SubCur.PlanNum,InsPlanList);//can end up null
                break;

            case "PreAuth":
                SubCur1  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 1), SubList);
                PlanCur1 = InsPlans.GetPlan(SubCur1.PlanNum, InsPlanList);
                SubCur2  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 2), SubList);
                break;

            case "W":
                SubCur1  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 1), SubList);
                PlanCur1 = InsPlans.GetPlan(SubCur1.PlanNum, InsPlanList);
                SubCur2  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, 2), SubList);
                break;

            case "Med":
                SubCur1  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, PatPlans.GetOrdinal(PriSecMed.Medical, PatPlanList, InsPlanList, SubList)), SubList);
                PlanCur1 = InsPlans.GetPlan(SubCur1.PlanNum, InsPlanList);
                SubCur2  = InsSubs.GetSub(PatPlans.GetInsSubNum(PatPlanList, PatPlans.GetOrdinal(PriSecMed.Primary, PatPlanList, InsPlanList, SubList)), SubList);
                break;
            }
            //DataTable table=DataSetMain.Tables["account"];
            Procedure proc;

            //proc=Procedures.GetProcFromList(procsForPat,PIn.Long(table.Rows[gridAccount.SelectedIndices[0]]["ProcNum"].ToString()));
            //long clinicNum=proc.ClinicNum;
            ClaimProc[] claimProcs = new ClaimProc[procsForClaim.Count];          //1:1 with procs
            long        procNum;

            for (int i = 0; i < procsForClaim.Count; i++)       //loop through selected procs
            //and try to find an estimate that can be used
            {
                procNum       = procsForClaim[i].ProcNum;
                claimProcs[i] = Procedures.GetClaimProcEstimate(procNum, ClaimProcList, PlanCur1, SubCur1.InsSubNum);
            }
            for (int i = 0; i < claimProcs.Length; i++)       //loop through each claimProc
            //and create any missing estimates. This handles claims to 3rd and 4th ins co's.
            {
                if (claimProcs[i] == null)
                {
                    claimProcs[i] = new ClaimProc();
                    proc          = procsForClaim[i];
                    ClaimProcs.CreateEst(claimProcs[i], proc, PlanCur1, SubCur1);
                }
            }
            Claim claim = new Claim();

            Claims.Insert(claim);            //to retreive a key for new Claim.ClaimNum
            claim.PatNum        = pat.PatNum;
            claim.DateService   = claimProcs[claimProcs.Length - 1].ProcDate;
            claim.ClinicNum     = procsForClaim[0].ClinicNum;
            claim.DateSent      = DateTime.Today;
            claim.DateSentOrig  = claim.DateSent;
            claim.ClaimStatus   = "S";
            claim.AttachedFlags = "Mail";
            if (!string.IsNullOrEmpty(claimIdentifier))
            {
                claim.ClaimIdentifier = claimIdentifier;
            }
            //datereceived
            switch (claimType)
            {
            case "P":
                claim.PlanNum    = SubCur1.PlanNum;
                claim.InsSubNum  = PatPlans.GetInsSubNum(PatPlanList, 1);
                claim.PatRelat   = PatPlans.GetRelat(PatPlanList, 1);
                claim.ClaimType  = "P";
                claim.PlanNum2   = SubCur2.PlanNum;                    //might be 0 if no sec ins
                claim.InsSubNum2 = PatPlans.GetInsSubNum(PatPlanList, 2);
                claim.PatRelat2  = PatPlans.GetRelat(PatPlanList, 2);
                break;

            case "S":
                claim.PlanNum    = SubCur1.PlanNum;
                claim.InsSubNum  = PatPlans.GetInsSubNum(PatPlanList, 2);
                claim.PatRelat   = PatPlans.GetRelat(PatPlanList, 2);
                claim.ClaimType  = "S";
                claim.PlanNum2   = SubCur2.PlanNum;
                claim.InsSubNum2 = PatPlans.GetInsSubNum(PatPlanList, 1);
                claim.PatRelat2  = PatPlans.GetRelat(PatPlanList, 1);
                break;

            case "W":
                claim.PlanNum     = SubCur1.PlanNum;
                claim.InsSubNum   = PatPlans.GetInsSubNum(PatPlanList, 2);
                claim.PatRelat    = PatPlans.GetRelat(PatPlanList, 2);
                claim.ClaimType   = "P";
                claim.ClaimStatus = "W";
                claim.PlanNum2    = SubCur2.PlanNum;
                claim.InsSubNum2  = PatPlans.GetInsSubNum(PatPlanList, 1);
                claim.PatRelat2   = PatPlans.GetRelat(PatPlanList, 1);
                break;

            case "Med":
                claim.PlanNum    = SubCur1.PlanNum;
                claim.InsSubNum  = PatPlans.GetInsSubNum(PatPlanList, 1);
                claim.PatRelat   = PatPlans.GetRelat(PatPlanList, 1);
                claim.ClaimType  = "Other";
                claim.PlanNum2   = SubCur2.PlanNum;                    //might be 0 if no other ins
                claim.InsSubNum2 = PatPlans.GetInsSubNum(PatPlanList, 2);
                claim.PatRelat2  = PatPlans.GetRelat(PatPlanList, 2);
                break;
            }
            claim.ProvTreat     = procsForClaim[0].ProvNum;
            claim.IsProsthesis  = "I";
            claim.ProvBill      = Providers.GetBillingProvNum(claim.ProvTreat, claim.ClinicNum);
            claim.EmployRelated = YN.No;
            //attach procedures
            Procedure ProcCur;

            for (int i = 0; i < claimProcs.Length; i++)
            {
                ProcCur = procsForClaim[i];
                claimProcs[i].ClaimNum = claim.ClaimNum;
                claimProcs[i].Status   = ClaimProcStatus.NotReceived;            //status for claims unsent or sent.
                //writeoff handled in ClaimL.CalculateAndUpdate()
                claimProcs[i].CodeSent = ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProcCode;
                if (claimProcs[i].CodeSent.Length > 5 && claimProcs[i].CodeSent.Substring(0, 1) == "D")
                {
                    claimProcs[i].CodeSent = claimProcs[i].CodeSent.Substring(0, 5);
                }
                if (calculateLineNumber)
                {
                    claimProcs[i].LineNumber = (byte)(i + 1);
                }
                ClaimProcs.Update(claimProcs[i]);
            }
            ClaimProcList = ClaimProcs.Refresh(pat.PatNum);
            Claims.CalculateAndUpdate(procsForPat, InsPlanList, claim, PatPlanList, benefitList, pat, SubList);
            return(claim);
        }
Ejemplo n.º 13
0
        private void FillProcedure()
        {
            if (PaySplitCur.ProcNum == 0)
            {
                textProcDate2.Text       = "";
                textProcProv.Text        = "";
                textProcTooth.Text       = "";
                textProcDescription.Text = "";
                ProcFee               = 0;
                textProcFee.Text      = "";
                ProcInsPaid           = 0;
                textProcInsPaid.Text  = "";
                ProcInsEst            = 0;
                textProcInsEst.Text   = "";
                ProcAdj               = 0;
                textProcAdj.Text      = "";
                ProcPrevPaid          = 0;
                textProcPrevPaid.Text = "";
                ProcPaidHere          = 0;
                textProcPaidHere.Text = "";
                labelProcRemain.Text  = "";
                //butAttach.Enabled=true;
                //butDetach.Enabled=false;
                //ComputeProcTotals();
                return;
            }
            Procedure ProcCur = Procedures.GetOneProc(PaySplitCur.ProcNum, false);

            ClaimProc[]  ClaimProcList  = ClaimProcs.Refresh(ProcCur.PatNum);
            Adjustment[] AdjustmentList = Adjustments.Refresh(ProcCur.PatNum);
            PaySplit[]   PaySplitList   = PaySplits.Refresh(ProcCur.PatNum);
            textProcDate.Text        = ProcCur.ProcDate.ToShortDateString();
            textProcDate2.Text       = ProcCur.ProcDate.ToShortDateString();
            textProcProv.Text        = Providers.GetAbbr(ProcCur.ProvNum);
            textProcTooth.Text       = Tooth.ToInternat(ProcCur.ToothNum);
            textProcDescription.Text = ProcedureCodes.GetProcCode(ProcCur.CodeNum).Descript;
            ProcFee     = ProcCur.ProcFee;
            ProcInsPaid = -ClaimProcs.ProcInsPay(ClaimProcList, ProcCur.ProcNum);
            ProcInsEst  = -ClaimProcs.ProcEstNotReceived(ClaimProcList, ProcCur.ProcNum);
            ProcAdj     = Adjustments.GetTotForProc(ProcCur.ProcNum, AdjustmentList);
            //next line will still work even if IsNew
            ProcPrevPaid     = -PaySplits.GetTotForProc(ProcCur.ProcNum, PaySplitList, PaySplitCur.SplitNum);
            textProcFee.Text = ProcFee.ToString("F");
            if (ProcInsPaid == 0)
            {
                textProcInsPaid.Text = "";
            }
            else
            {
                textProcInsPaid.Text = ProcInsPaid.ToString("F");
            }
            if (ProcInsEst == 0)
            {
                textProcInsEst.Text = "";
            }
            else
            {
                textProcInsEst.Text = ProcInsEst.ToString("F");
            }
            if (ProcAdj == 0)
            {
                textProcAdj.Text = "";
            }
            else
            {
                textProcAdj.Text = ProcAdj.ToString("F");
            }
            if (ProcPrevPaid == 0)
            {
                textProcPrevPaid.Text = "";
            }
            else
            {
                textProcPrevPaid.Text = ProcPrevPaid.ToString("F");
            }
            ComputeProcTotals();
            //butAttach.Enabled=false;
            //butDetach.Enabled=true;
        }
Ejemplo n.º 14
0
        private void SetTextBoxes()
        {
            List <PayPlanEdit.PayPlanEntry> listSelectedEntries = new List <PayPlanEdit.PayPlanEntry>();

            for (int i = 0; i < gridMain.SelectedIndices.Count(); i++)          //fill the list with all the selected items in the grid.
            {
                listSelectedEntries.Add((PayPlanEdit.PayPlanEntry)(gridMain.ListGridRows[gridMain.SelectedIndices[i]].Tag));
            }
            bool isUpdateButton = false;          //keep track of the state of the button, if it is add or update.

            if (listSelectedEntries.Count == 0)   //if there are no entries selected
            //button should say Add, textboxes should be editable. No attached procedure.
            {
                butAddOrUpdate.Text = Lan.g(this, "Add");
                textAmt.Text        = "";
                textDate.Text       = "";
                textCode.Text       = Lan.g(this, "None");
                textNote.Text       = "";
                textAmt.ReadOnly    = false;
                textDate.ReadOnly   = false;
                textNote.ReadOnly   = false;
            }
            else if (listSelectedEntries.Count == 1)                             //if there is one entry selected
            {
                PayPlanEdit.PayPlanEntry selectedEntry = listSelectedEntries[0]; //all textboxes should be editable
                textAmt.ReadOnly  = false;
                textDate.ReadOnly = false;
                textNote.ReadOnly = false;
                if (selectedEntry.IsChargeOrd)                  //if it's a PayPlanCharge
                //button should say Update, text boxes should fill with info from that charge.
                {
                    butAddOrUpdate.Text = Lan.g(this, "Update");
                    isUpdateButton      = true;
                    textAmt.Text        = selectedEntry.AmtStr;
                    textNote.Text       = selectedEntry.NoteStr;
                    if (selectedEntry.ProcStatOrd == ProcStat.TP && selectedEntry.ProcNumOrd != 0)                 //if tp, grey out the date textbox. it should always be maxvalue.
                    //tp and procnum==0 means that it's the unattached row, in which case we don't want to make the text boxes ready-only.
                    {
                        textDate.ReadOnly = true;
                        textDate.Text     = "";
                    }
                    else
                    {
                        textDate.Text = selectedEntry.CredDateStr;
                    }
                    if (selectedEntry.Proc == null)                    //selected charge could be unattached.
                    {
                        textCode.Text = Lan.g(this, "Unattached");
                    }
                    else
                    {
                        textCode.Text = ProcedureCodes.GetStringProcCode(selectedEntry.Proc.CodeNum);
                    }
                }
                else                  // selected line item is a procedure (or the "Unattached" entry)
                                      //button should say "Add", text boxes should fill with info from that procedure (or "unattached").
                {
                    butAddOrUpdate.Text = Lan.g(this, "Add");
                    if (selectedEntry.Proc == null)
                    {
                        textCode.Text = Lan.g(this, "Unattached");
                        textAmt.Text  = "0.00";
                        textNote.Text = "";
                        textDate.Text = DateTimeOD.Today.ToShortDateString();
                    }
                    else                       //if it is a procedure (and not the "unattached" row)
                    {
                        List <PayPlanEdit.PayPlanEntry> listEntriesForProc = _listPayPlanEntries
                                                                             .Where(x => x.ProcNumOrd == selectedEntry.ProcNumOrd)
                                                                             .Where(x => x.IsChargeOrd == true).ToList();
                        if (listEntriesForProc.Count == 0)          //if there are no other charges attached to the procedure
                        {
                            textAmt.Text = selectedEntry.RemBefStr; //set textAmt to the value in RemBefore
                        }
                        else                                        //if there are other charges attached, fill the amount textbox with the minimum value in the RemAftr column.
                        {
                            textAmt.Text = listEntriesForProc.Min(x => PIn.Double(x.RemAftStr)).ToString("f");
                        }
                        textDate.Text = DateTimeOD.Today.ToShortDateString();
                        textNote.Text = ProcedureCodes.GetStringProcCode(selectedEntry.Proc.CodeNum) + ": " + Procedures.GetDescription(selectedEntry.Proc);
                        textCode.Text = ProcedureCodes.GetStringProcCode(selectedEntry.Proc.CodeNum);
                    }
                }
            }
            else if (listSelectedEntries.Count > 1)            //if they selected multiple line items
            //change the button to say "add"
            //blank out and make read-only all text boxes.
            {
                butAddOrUpdate.Text = Lan.g(this, "Add");
                textAmt.Text        = "";
                textDate.Text       = "";
                textNote.Text       = "";
                textCode.Text       = Lan.g(this, "Multiple");
                textAmt.ReadOnly    = true;
                textDate.ReadOnly   = true;
                textNote.ReadOnly   = true;
            }
            if (listSelectedEntries.Any(x => Security.IsGlobalDateLock(Permissions.PayPlanEdit, x.DateOrd, true)))
            {
                if (isUpdateButton)
                {
                    butAddOrUpdate.Enabled = false;                  //only disallow them from updating a tx credit, adding a new one is okay.
                }
                else
                {
                    butAddOrUpdate.Enabled = true;
                }
                butDelete.Enabled = false;
            }
            else
            {
                butAddOrUpdate.Enabled = true;
                butDelete.Enabled      = true;
            }
        }
Ejemplo n.º 15
0
 public void Procedures_IsSameProcedureArea_SameToothNumEmptySurf()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("4", "4", "", "", "", "M"));
 }
Ejemplo n.º 16
0
 public void Procedures_IsSameProcedureArea_EmptyProcCurToothRange()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("", "", "2,4,7", "", "", ""));
 }
Ejemplo n.º 17
0
 public void Procedures_IsSameProcedureArea_SameToothNumSameSurf()
 {
     Assert.IsTrue(Procedures.IsSameProcedureArea("9", "9", "", "", "L", "L"));
 }
Ejemplo n.º 18
0
 public void Procedures_IsSameProcedureArea_PartialMatchToothRanges()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("", "", "7,16,22", "2", "", ""));
 }
Ejemplo n.º 19
0
 public void Procedures_IsSameProcedureArea_SameToothNumEmptySurfs()
 {
     Assert.IsTrue(Procedures.IsSameProcedureArea("14", "14", "", "", "", ""));
 }
Ejemplo n.º 20
0
 public void Procedures_IsSameProcedureArea_ToothRangeMatchingTails()
 {
     Assert.IsTrue(Procedures.IsSameProcedureArea("", "", "7,3", "15,7,3", "", ""));
 }
Ejemplo n.º 21
0
        private void FillGrid()
        {
            if (textDateTo.errorProvider1.GetError(textDateTo) != "" || textDateFrom.errorProvider1.GetError(textDateFrom) != "")               //Test To and From dates
            {
                MsgBox.Show(this, "Please enter valid To and From dates.");
                return;
            }
            DateFrom = PIn.Date(textDateFrom.Text);
            DateTo   = PIn.Date(textDateTo.Text);
            if (DateTo < DateFrom)
            {
                MsgBox.Show(this, "Date To cannot be before Date From.");
                return;
            }
//todo: checkbox
            RefAttachList = RefAttaches.RefreshForReferralProcTrack(DateFrom, DateTo, checkComplete.Checked);
            Table         = Procedures.GetReferred(DateFrom, DateTo, checkComplete.Checked);
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn(Lan.g(this, "Patient"), 125);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Referred To"), 125);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Description"), 125);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Note"), 125);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Date Referred"), 86);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Date Done"), 86);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Status"), 84);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow  row;
            DateTime date;

            for (int i = 0; i < Table.Rows.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(Patients.GetPat(PIn.Long(Table.Rows[i]["PatNum"].ToString())).GetNameLF());
                row.Cells.Add(Table.Rows[i]["LName"].ToString() + ", " + Table.Rows[i]["FName"].ToString() + " " + Table.Rows[i]["MName"].ToString());
                row.Cells.Add(ProcedureCodes.GetLaymanTerm(PIn.Long(Table.Rows[i]["CodeNum"].ToString())));
                row.Cells.Add(Table.Rows[i]["Note"].ToString());
                date = PIn.Date(Table.Rows[i]["RefDate"].ToString());
                if (date.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(date.ToShortDateString());
                }
                date = PIn.Date(Table.Rows[i]["DateProcComplete"].ToString());
                if (date.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(date.ToShortDateString());
                }
                ReferralToStatus refStatus = (ReferralToStatus)PIn.Int(Table.Rows[i]["RefToStatus"].ToString());
                if (refStatus == ReferralToStatus.None)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(refStatus.ToString());
                }
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Ejemplo n.º 22
0
 public void Procedures_IsSameProcedureArea_ToothRangeMatchingElementsOutOfOrder()
 {
     Assert.IsTrue(Procedures.IsSameProcedureArea("", "", "15,7,3,4", "7,15", "", ""));
 }
Ejemplo n.º 23
0
 public void RemoveProcedure(Procedure procedure)
 {
     if (Procedures.Contains(procedure)) Procedures.Remove(procedure);
 }
Ejemplo n.º 24
0
 public void Procedures_IsSameProcedureArea_OneToothRangeBlank()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("", "", "1,4", "", "", ""));
 }
Ejemplo n.º 25
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected abstract void registerEditionSpecificProcedures(org.neo4j.kernel.impl.proc.Procedures procedures) throws org.neo4j.internal.kernel.api.exceptions.KernelException;
        protected internal abstract void RegisterEditionSpecificProcedures(Procedures procedures);
Ejemplo n.º 26
0
 public void Procedures_IsSameProcedureArea_InvalidToothRangeEntry()
 {
     Assert.IsFalse(Procedures.IsSameProcedureArea("", "", "1,,5,", "", "", ""));
 }
Ejemplo n.º 27
0
 public abstract void CreateSecurityModule(PlatformModule platformModule, Procedures procedures);
Ejemplo n.º 28
0
 public void Procedures_IsSameProcedureArea_InvalidEntryWithMatch()
 {
     Assert.IsTrue(Procedures.IsSameProcedureArea("", "", "1,,4", "4", "", ""));
 }
        private void createReport(Object theReportSettings)
        {
            Procedures    pProc       = new Procedures();
            DataSet       dsTopPanels = new DataSet();
            StringBuilder sb          = new StringBuilder();

            FastReport.Report theReport = new FastReport.Report();
            Procedures        procs     = new Procedures();

            int    nProdMonth   = Convert.ToInt32(THarmonyPASGlobal.ProdMonthAsString(reportSettings.Prodmonth));
            string strSectionID = procs.ExtractBeforeColon(reportSettings.SectionID);
            int    nSection     = 1;

            if (pProc.ExtractBeforeColon(reportSettings.SectionID) != "1")
            {
                nSection = 4;
            }

            #region Database Call

            DateTime?dtStart = null;
            DateTime?dtEnd   = null;

            #region Get Start & End Date

            if (!dtStart.HasValue && !dtEnd.HasValue)
            {
                MWDataManager.clsDataAccess _dbMan1 = new MWDataManager.clsDataAccess();
                _dbMan1.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
                //_dbMan.ConnectionString = ConfigurationManager.AppSettings["SQLConnectionStr"];
                _dbMan1.SqlStatement       = "select MIN(BeginDate) as 'StartDate', MAX(EndDate) as 'EndDate' from SECCAL where Prodmonth = '" + THarmonyPASGlobal.ProdMonthAsString(reportSettings.Prodmonth) + "'";
                _dbMan1.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                _dbMan1.queryReturnType    = MWDataManager.ReturnType.DataTable;
                _dbMan1.ExecuteInstruction();

                if (_dbMan1.ResultsDataTable.Rows.Count != 0)
                {
                    dtStart = Convert.ToDateTime(_dbMan1.ResultsDataTable.Rows[0]["StartDate"]);
                    dtEnd   = Convert.ToDateTime(_dbMan1.ResultsDataTable.Rows[0]["EndDate"]);
                }
            }

            #endregion

            DateTime dtCurrent = dtStart.Value;
            MWDataManager.clsDataAccess _dbMan = new MWDataManager.clsDataAccess();
            _dbMan.ConnectionString = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            SqlConnection pConn = new SqlConnection(_dbMan.ConnectionString);
            SqlCommand    pCmd  = new SqlCommand();
            pCmd.CommandType = CommandType.Text;
            pCmd.Connection  = pConn;

            #region Top Panels

            sb.AppendLine();
            sb.AppendLine("-- Top Panels");
            sb.AppendLine(string.Format("exec Report_TopPanels '{0}', '{1}', {2}", nProdMonth, strSectionID, nSection));

            #endregion


            pCmd.CommandText = sb.ToString();

            pConn.Open();
            SqlDataAdapter pAdap = new SqlDataAdapter(pCmd);
            pAdap.Fill(dsTopPanels);
            pConn.Close();

            if (dsTopPanels.Tables.Count == 0)
            {
                MessageBox.Show("No Top Panels found for selected search criteria. Please try again.", "No Data Found", MessageBoxButtons.OK, MessageBoxIcon.Information);
                // return;
                theReport.Prepare();
                theReport.Refresh();
                ActiveReport.SetReport = theReport;
                ActiveReport.isDone    = true;
                return;
            }
            else
            {
                if (dsTopPanels.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("No Top Panels found for selected search criteria. Please try again.", "No Data Found", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    // return;
                    theReport.Prepare();
                    theReport.Refresh();
                    ActiveReport.SetReport = theReport;
                    ActiveReport.isDone    = true;
                    return;
                }
            }

            dsTopPanels.Tables[0].TableName = "TopPanels";

            #endregion

            #region Totals

            DataTable tblTotals = new DataTable("Totals");


            tblTotals.Columns.Add("MonthlyPlanningSQM");
            tblTotals.Columns.Add("MonthlyPlanningCMGT");
            tblTotals.Columns.Add("MonthlyPlanningGT");
            tblTotals.Columns.Add("MonthlyPlanningKGs");
            tblTotals.Columns.Add("ProgressGradeActualCMGT");
            tblTotals.Columns.Add("ProgressGradeActualGT");
            tblTotals.Columns.Add("ProgressGradeVarCMGT");
            tblTotals.Columns.Add("ProgressGradeVarGT");
            tblTotals.Columns.Add("ProgressivePlannedSQM");
            tblTotals.Columns.Add("ProgressiveActualSQM");
            tblTotals.Columns.Add("ProgressiveVarSQM");
            tblTotals.Columns.Add("ProgressivePlannedKG");
            tblTotals.Columns.Add("ProgressiveActualKG");
            tblTotals.Columns.Add("ProgressiveVarKG");
            tblTotals.Columns.Add("GradePerformance");
            tblTotals.Columns.Add("SQMPerformance");
            tblTotals.Columns.Add("KGPerformance");


            decimal fMonthlyPlanningSQM      = 0.0m;
            decimal fMonthlyPlanningCMGT     = 0.0m;
            decimal fMonthlyPlanningGT       = 0.0m;
            decimal fMonthlyPlanningKGs      = 0.0m;
            decimal fProgressGradeActualCMGT = 0.0m;
            decimal fProgressGradeActualGT   = 0.0m;
            decimal fProgressGradeVarCMGT    = 0.0m;
            decimal fProgressGradeVarGT      = 0.0m;
            decimal fProgressivePlannedSQM   = 0.0m;
            decimal fProgressiveActualSQM    = 0.0m;
            decimal fProgressiveVarSQM       = 0.0m;
            decimal fProgressivePlannedKG    = 0.0m;
            decimal fProgressiveActualKG     = 0.0m;
            decimal fProgressiveVarKG        = 0.0m;

            decimal fMonthlyPlanningSQMSUM      = 0.0m;
            decimal fMonthlyPlanningCMGTSUM     = 0.0m;
            decimal fMonthlyPlanningGTSUM       = 0.0m;
            decimal fMonthlyPlanningKGsSUM      = 0.0m;
            decimal fProgressGradeActualCMGTSUM = 0.0m;
            decimal fProgressGradeActualGTSUM   = 0.0m;
            decimal fProgressGradeVarCMGTSUM    = 0.0m;
            decimal fProgressGradeVarGTSUM      = 0.0m;
            decimal fProgressivePlannedSQMSUM   = 0.0m;
            decimal fProgressiveActualSQMSUM    = 0.0m;
            decimal fProgressiveVarSQMSUM       = 0.0m;
            decimal fProgressivePlannedKGSUM    = 0.0m;
            decimal fProgressiveActualKGSUM     = 0.0m;
            decimal fProgressiveVarKGSUM        = 0.0m;

            foreach (DataRow dr in dsTopPanels.Tables["TopPanels"].Rows)
            {
                #region Sum

                if (dr["MonthlyPlanningSQM"] != DBNull.Value)
                {
                    fMonthlyPlanningSQMSUM += Convert.ToDecimal(dr["MonthlyPlanningSQM"]);
                }

                if (dr["MonthlyPlanningCMGT"] != DBNull.Value)
                {
                    fMonthlyPlanningCMGTSUM += Convert.ToDecimal(dr["MonthlyPlanningCMGT"]);
                }
                if (dr["MonthlyPlanningGT"] != DBNull.Value)
                {
                    fMonthlyPlanningGTSUM += Convert.ToDecimal(dr["MonthlyPlanningGT"]);
                }

                if (dr["MonthlyPlanningKGs"] != DBNull.Value)
                {
                    fMonthlyPlanningKGsSUM += Convert.ToDecimal(dr["MonthlyPlanningKGs"]);
                }

                if (dr["ProgressGradeActualCMGT"] != DBNull.Value)
                {
                    fProgressGradeActualCMGTSUM += Convert.ToDecimal(dr["ProgressGradeActualCMGT"]);
                }
                if (dr["ProgressGradeActualGT"] != DBNull.Value)
                {
                    fProgressGradeActualGTSUM += Convert.ToDecimal(dr["ProgressGradeActualGT"]);
                }
                if (dr["ProgressGradeVarCMGT"] != DBNull.Value)
                {
                    fProgressGradeVarCMGTSUM += Convert.ToDecimal(dr["ProgressGradeVarCMGT"]);
                }
                if (dr["ProgressGradeVarGT"] != DBNull.Value)
                {
                    fProgressGradeVarGTSUM += Convert.ToDecimal(dr["ProgressGradeVarGT"]);
                }

                if (dr["ProgressivePlannedSQM"] != DBNull.Value)
                {
                    fProgressivePlannedSQMSUM += Convert.ToDecimal(dr["ProgressivePlannedSQM"]);
                }
                if (dr["ProgressiveActualSQM"] != DBNull.Value)
                {
                    fProgressiveActualSQMSUM += Convert.ToDecimal(dr["ProgressiveActualSQM"]);
                }
                if (dr["ProgressiveVarSQM"] != DBNull.Value)
                {
                    fProgressiveVarSQMSUM += Convert.ToDecimal(dr["ProgressiveVarSQM"]);
                }

                if (dr["ProgressivePlannedKG"] != DBNull.Value)
                {
                    fProgressivePlannedKGSUM += Convert.ToDecimal(dr["ProgressivePlannedKG"]);
                }
                if (dr["ProgressiveActualKG"] != DBNull.Value)
                {
                    fProgressiveActualKGSUM += Convert.ToDecimal(dr["ProgressiveActualKG"]);
                }
                if (dr["ProgressiveVarKG"] != DBNull.Value)
                {
                    fProgressiveVarKGSUM += Convert.ToDecimal(dr["ProgressiveVarKG"]);
                }

                #endregion

                if (dr["MonthlyPlanningSQM"] != DBNull.Value)
                {
                    fMonthlyPlanningSQM += Convert.ToDecimal(dr["MonthlyPlanningSQM"]);
                }

                if (dr["MonthlyPlanningCMGT"] != DBNull.Value && dr["ProgressivePlannedSQM"] != DBNull.Value)
                {
                    fMonthlyPlanningCMGT += Convert.ToDecimal(dr["MonthlyPlanningCMGT"]) * Convert.ToDecimal(dr["ProgressivePlannedSQM"]);
                }


                if (dr["MonthlyPlanningGT"] != DBNull.Value && dr["ProgressivePlannedSQM"] != DBNull.Value)
                {
                    fMonthlyPlanningGT += Convert.ToDecimal(dr["MonthlyPlanningGT"]) * Convert.ToDecimal(dr["ProgressivePlannedSQM"]);
                }

                if (dr["MonthlyPlanningKGs"] != DBNull.Value)
                {
                    fMonthlyPlanningKGs += Convert.ToDecimal(dr["MonthlyPlanningKGs"]);
                }

                if (dr["ProgressGradeActualGT"] != DBNull.Value &&
                    dr["ProgressiveActualSQM"] != DBNull.Value)
                {
                    fProgressGradeActualGT += Convert.ToDecimal(dr["ProgressGradeActualGT"]) * Convert.ToDecimal(dr["ProgressiveActualSQM"]);
                }
                //fProgressGradeVarCMGT += Convert.ToDecimal(dr["ProgressGradeVarCMGT"]);
                //fProgressGradeVarGT += Convert.ToDecimal(dr["ProgressGradeVarGT"]);

                if (dr["ProgressivePlannedSQM"] != DBNull.Value)
                {
                    fProgressivePlannedSQM += Convert.ToDecimal(dr["ProgressivePlannedSQM"]);
                }
                if (dr["ProgressiveActualSQM"] != DBNull.Value)
                {
                    fProgressiveActualSQM += Convert.ToDecimal(dr["ProgressiveActualSQM"]);
                }
                if (dr["ProgressiveVarSQM"] != DBNull.Value)
                {
                    fProgressiveVarSQM += Convert.ToDecimal(dr["ProgressiveVarSQM"]);
                }

                if (dr["ProgressivePlannedKG"] != DBNull.Value)
                {
                    fProgressivePlannedKG += Convert.ToDecimal(dr["ProgressivePlannedKG"]);
                }
                if (dr["ProgressiveActualKG"] != DBNull.Value)
                {
                    fProgressiveActualKG += Convert.ToDecimal(dr["ProgressiveActualKG"]);
                }
                if (dr["ProgressiveVarKG"] != DBNull.Value)
                {
                    fProgressiveVarKG += Convert.ToDecimal(dr["ProgressiveVarKG"]);
                }
            }


            if (fProgressivePlannedSQMSUM != 0)
            {
                fMonthlyPlanningCMGT = fMonthlyPlanningCMGT / fProgressivePlannedSQMSUM;
            }
            if (fProgressivePlannedSQMSUM != 0)
            {
                fMonthlyPlanningGT = fMonthlyPlanningGT / fProgressivePlannedSQMSUM;
            }

            if (fProgressiveActualSQMSUM != 0)
            {
                fProgressGradeActualCMGT = fProgressiveActualKGSUM / fProgressiveActualSQMSUM / 0.0278m * 1000;
            }
            if (fProgressiveActualSQMSUM != 0)
            {
                fProgressGradeActualGT = fProgressGradeActualGT / fProgressiveActualSQMSUM;
            }
            if (fProgressGradeActualCMGT != 0)
            {
                fProgressGradeVarCMGT = fMonthlyPlanningCMGT - fProgressGradeActualCMGT;
            }
            if (fProgressGradeActualGT != 0)
            {
                fProgressGradeVarGT = fMonthlyPlanningGT - fProgressGradeActualGT;
            }

            DataRow drTotals = tblTotals.NewRow();

            drTotals["MonthlyPlanningSQM"]      = DisplayFmt.CustomDecimal(fMonthlyPlanningSQM, 0);
            drTotals["MonthlyPlanningCMGT"]     = DisplayFmt.CustomDecimal(fMonthlyPlanningCMGT, 0);
            drTotals["MonthlyPlanningGT"]       = DisplayFmt.CustomDecimal(fMonthlyPlanningGT, 2);
            drTotals["MonthlyPlanningKGs"]      = DisplayFmt.CustomDecimal(fMonthlyPlanningKGs, 3);
            drTotals["ProgressGradeActualCMGT"] = DisplayFmt.CustomDecimal(fProgressGradeActualCMGT, 0);
            drTotals["ProgressGradeActualGT"]   = DisplayFmt.CustomDecimal(fProgressGradeActualGT, 2);
            drTotals["ProgressGradeVarCMGT"]    = DisplayFmt.CustomDecimal(fProgressGradeVarCMGT, 0);
            drTotals["ProgressGradeVarGT"]      = DisplayFmt.CustomDecimal(fProgressGradeVarGT, 2);
            drTotals["ProgressivePlannedSQM"]   = DisplayFmt.CustomDecimal(fProgressivePlannedSQM, 0);
            drTotals["ProgressiveActualSQM"]    = DisplayFmt.CustomDecimal(fProgressiveActualSQM, 0);
            drTotals["ProgressiveVarSQM"]       = DisplayFmt.CustomDecimal(fProgressiveVarSQM, 0);
            drTotals["ProgressivePlannedKG"]    = DisplayFmt.CustomDecimal(fProgressivePlannedKG, 3);
            drTotals["ProgressiveActualKG"]     = DisplayFmt.CustomDecimal(fProgressiveActualKG, 3);
            drTotals["ProgressiveVarKG"]        = DisplayFmt.CustomDecimal(fProgressiveVarKG, 3);

            drTotals["GradePerformance"] = 0.0m;
            drTotals["SQMPerformance"]   = 0.0m;
            drTotals["KGPerformance"]    = 0.0m;

            if (fMonthlyPlanningCMGT != 0)
            {
                drTotals["GradePerformance"] = DisplayFmt.PercSmall_WithSign(fProgressGradeActualCMGT / fMonthlyPlanningCMGT);
            }
            if (fProgressivePlannedSQM != 0)
            {
                drTotals["SQMPerformance"] = DisplayFmt.PercSmall_WithSign(fProgressiveActualSQM / fProgressivePlannedSQM);
            }
            if (fProgressivePlannedKG != 0)
            {
                drTotals["KGPerformance"] = DisplayFmt.PercSmall_WithSign(fProgressiveActualKG / fProgressivePlannedKG);
            }

            tblTotals.Rows.Add(drTotals);
            tblTotals.AcceptChanges();



            dsTopPanels.Tables.Add(tblTotals);

            #endregion


            #region Custom Data

            DataTable tblCustom = new DataTable("Custom");
            tblCustom.Columns.Add("Banner");
            tblCustom.Columns.Add("Month");
            tblCustom.Columns.Add("Shaft");
            tblCustom.Columns.Add("Section");

            DateTime dtMonth = new DateTime(Convert.ToInt32(THarmonyPASGlobal.ProdMonthAsString(reportSettings.Prodmonth).Substring(0, 4)),
                                            Convert.ToInt32(THarmonyPASGlobal.ProdMonthAsString(reportSettings.Prodmonth).Substring(4, 2)), 1);
            SysSettings aa = new SysSettings();
            aa.systemDBTag = theSystemDBTag;
            aa.connection  = UserCurrentInfo.Connection;
            aa.GetSysSettings();
            DataRow drCustom = tblCustom.NewRow();
            drCustom["Banner"]  = "PERFORMANCE OF TOP PANELS";
            drCustom["Month"]   = dtMonth.ToString("MMM-yy");
            drCustom["Shaft"]   = SysSettings.Banner;
            drCustom["Section"] = reportSettings.SectionID;
            tblCustom.Rows.Add(drCustom);
            tblCustom.AcceptChanges();

            theReport.RegisterData(tblCustom, "CustomData");

            #endregion

            theReport.RegisterData(dsTopPanels);

            theReport.Load(TGlobalItems.ReportsFolder + "\\TopPanelsReport.frx");


            //if (MessageBox.Show("Design?", "Design?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
            //    theReport.Design();

            theReport.Prepare();
            theReport.Refresh();
            ActiveReport.SetReport = theReport;
            ActiveReport.isDone    = true;
            //theReport.Design();
        }
Ejemplo n.º 30
0
 /// <summary>
 /// 是否存在流程
 /// </summary>
 /// <param name="type">流程类</param>
 /// <returns>是否存在</returns>
 public bool IsExistProcedure(Type type)
 {
     return(Procedures.ContainsKey(type));
 }