Example #1
0
        private void FillGrid()
        {
            //We don't refresh ListSupplyAll here because we are frequently using FillGrid with a search filter.
            filterListSupply();
            ListSupply.Sort(sortSupplyListByCategoryOrderThenItemOrder);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Category"), 130);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Catalog #"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Supplier"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Description"), 240);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Price"), 60, HorizontalAlignment.Right);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "StockQty"), 60, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "IsHidden"), 40, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListSupply.Count; i++)
            {
                row = new ODGridRow();
                if (i == 0 || ListSupply[i].Category != ListSupply[i - 1].Category)
                {
                    row.Cells.Add(DefC.GetName(DefCat.SupplyCats, ListSupply[i].Category));
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(ListSupply[i].CatalogNumber);
                row.Cells.Add(Suppliers.GetName(ListSupplier, ListSupply[i].SupplierNum));
                row.Cells.Add(ListSupply[i].Descript);
                if (ListSupply[i].Price == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListSupply[i].Price.ToString("n"));
                }
                if (ListSupply[i].LevelDesired == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListSupply[i].LevelDesired.ToString());
                }
                if (ListSupply[i].IsHidden)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Tag = ListSupply[i].SupplyNum;
                //row.Cells.Add(listSupply[i].ItemOrder.ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            for (int i = 0; i < ListSupply.Count; i++)
            {
                if (SelectedGridItems.Contains(ListSupply[i].SupplyNum))
                {
                    gridMain.SetSelected(i, true);
                }
            }
        }
Example #2
0
        ///<summary>Draws all the blockouts for the entire period.</summary>
        public static void DrawBlockouts(Graphics g, DateTime startTime, DateTime stopTime, int colsPerPage, int pageColumn, int fontSize, bool isPrinting)
        {
            Schedule[] schedForType = Schedules.GetForType(SchedListPeriod, ScheduleType.Blockout, 0);
            SolidBrush blockBrush;
            Pen        blockOutlinePen = new Pen(Color.Black, 1);
            Pen        penOutline;
            Font       blockFont = new Font("Arial", fontSize);
            string     blockText;
            RectangleF rect;

            for (int i = 0; i < schedForType.Length; i++)
            {
                blockBrush = new SolidBrush(DefC.GetColor(DefCat.BlockoutTypes, schedForType[i].BlockoutType));
                penOutline = new Pen(DefC.GetColor(DefCat.BlockoutTypes, schedForType[i].BlockoutType), 2);
                blockText  = DefC.GetName(DefCat.BlockoutTypes, schedForType[i].BlockoutType) + "\r\n" + schedForType[i].Note;
                for (int o = 0; o < schedForType[i].Ops.Count; o++)
                {
                    int startHour = startTime.Hour;
                    if (isPrinting)                     //Filtering logic for printing.
                    {
                        int stopHour = stopTime.Hour;
                        if (stopHour == 0)
                        {
                            stopHour = 24;
                        }
                        if (schedForType[i].StartTime.Hours >= stopHour)
                        {
                            continue;                            //Blockout starts after the current time frame.
                        }
                        if (schedForType[i].StopTime.Hours <= stopHour)
                        {
                            stopHour = schedForType[i].StopTime.Hours;
                        }
                        if (GetIndexOp(schedForType[i].Ops[o]) >= (colsPerPage * pageColumn + colsPerPage) ||
                            GetIndexOp(schedForType[i].Ops[o]) < colsPerPage * pageColumn)
                        {
                            continue;                            //Blockout not on current page.
                        }
                    }
                    if (IsWeeklyView)
                    {
                        if (GetIndexOp(schedForType[i].Ops[o]) == -1)
                        {
                            continue;                            //don't display if op not visible
                        }
                        //this is a workaround because we start on Monday:
                        int dayofweek = (int)schedForType[i].SchedDate.DayOfWeek - 1;
                        if (dayofweek == -1)
                        {
                            dayofweek = 6;
                        }
                        rect = new RectangleF(
                            TimeWidth + 1 + (dayofweek) * ColDayWidth
                            + ColAptWidth * (GetIndexOp(schedForType[i].Ops[o], VisOps) - (colsPerPage * pageColumn))
                            , (schedForType[i].StartTime.Hours - startHour) * LineH * RowsPerHr
                            + schedForType[i].StartTime.Minutes * LineH / MinPerRow
                            , ColAptWidth - 1
                            , (schedForType[i].StopTime - schedForType[i].StartTime).Hours * LineH * RowsPerHr
                            + (schedForType[i].StopTime - schedForType[i].StartTime).Minutes * LineH / MinPerRow);
                    }
                    else
                    {
                        if (GetIndexOp(schedForType[i].Ops[o]) == -1)
                        {
                            continue;                            //don't display if op not visible
                        }
                        rect = new RectangleF(
                            TimeWidth + ProvWidth * ProvCount
                            + ColWidth * (GetIndexOp(schedForType[i].Ops[o], VisOps) - (colsPerPage * pageColumn))
                            + ProvWidth * 2                         //so they don't overlap prov bars
                            , (schedForType[i].StartTime.Hours - startHour) * LineH * RowsPerHr
                            + schedForType[i].StartTime.Minutes * LineH / MinPerRow
                            , ColWidth - 1 - ProvWidth * 2
                            , (schedForType[i].StopTime - schedForType[i].StartTime).Hours * LineH * RowsPerHr
                            + (schedForType[i].StopTime - schedForType[i].StartTime).Minutes * LineH / MinPerRow);
                    }
                    //paint either solid block or outline
                    if (PrefC.GetBool(PrefName.SolidBlockouts))
                    {
                        g.FillRectangle(blockBrush, rect);
                        g.DrawLine(blockOutlinePen, rect.X, rect.Y + 1, rect.Right - 1, rect.Y + 1);
                    }
                    else
                    {
                        g.DrawRectangle(penOutline, rect.X + 1, rect.Y + 2, rect.Width - 2, rect.Height - 3);
                    }
                    g.DrawString(blockText, blockFont, new SolidBrush(DefC.Short[(int)DefCat.AppointmentColors][4].ItemColor), rect);
                }
                blockBrush.Dispose();
                penOutline.Dispose();
            }
            blockOutlinePen.Dispose();
        }
Example #3
0
        /// <summary> Empties listSupply and adds to it all elements that contain items in the search field. Matches on all columns simultaneously.</summary>
        private void filterListSupply()
        {
            ListSupply.Clear();
            ListSupplyAll.Sort(sortSupplyListByCategoryOrderThenItemOrder);
            long supplier = 0;

            if (SelectedSupplierNum != 0)           //Use supplier num if it is provided, usually when IsSelectMode is also true
            {
                supplier = SelectedSupplierNum;
            }
            else if (comboSupplier.SelectedIndex < 1)             //this includes selecting All or not having anything selected.
            {
                supplier = 0;
            }
            else
            {
                supplier = ListSupplier[comboSupplier.SelectedIndex - 1].SupplierNum;            //SelectedIndex-1 because All is added before all the other items in the list.
            }
            foreach (Supply supply in ListSupplyAll)
            {
                if (!checkShowHidden.Checked && supply.IsHidden)
                {
                    continue;                    //skip hidden supplies if show hidden is not checked
                }
                if (supplier != 0 && supply.SupplierNum != supplier)
                {
                    continue;                    //skip supplies that do not match selected supplier
                }
                if (textFind.Text == "")         //Start filtering based on findText
                {
                    ListSupply.Add(supply);
                    continue;
                }
                else if (supply.CatalogNumber.ToString().ToUpper().Contains(textFind.Text.ToUpper()))                 //Check each field to see if it matches the search text field. If it does then add it and move on.
                {
                    ListSupply.Add(supply);
                    continue;
                }
                else if (DefC.GetName(DefCat.SupplyCats, supply.Category).ToUpper().Contains(textFind.Text.ToUpper()))
                {
                    ListSupply.Add(supply);
                    continue;
                }
                else if (supply.Descript.ToString().ToUpper().Contains(textFind.Text.ToUpper()))
                {
                    ListSupply.Add(supply);
                    continue;
                }
                //else if(supply.ItemOrder.ToString().Contains(textFind.Text)) {
                //  listSupply.Add(supply);
                //  continue;
                //}
                else if (supply.LevelDesired.ToString().Contains(textFind.Text))
                {
                    ListSupply.Add(supply);
                    continue;
                }
                else if (supply.Price.ToString().ToUpper().Contains(textFind.Text.ToUpper()))
                {
                    ListSupply.Add(supply);
                    continue;
                }
                else if (supply.SupplierNum.ToString().Contains(textFind.Text))
                {
                    ListSupply.Add(supply);
                    continue;
                }
                //else if(supply.SupplyNum.ToString().Contains(textFind.Text)) {
                //  listSupply.Add(supply);
                //  continue;
                //}
                //end of filter, item not added, move to next supply item.
            }
            return;
        }
Example #4
0
        private void FillGrid()
        {
            this.Cursor = Cursors.WaitCursor;
            string order = "";

            switch (comboOrder.SelectedIndex)
            {
            case 0:
                order = "status";
                break;

            case 1:
                order = "alph";
                break;

            case 2:
                order = "date";
                break;
            }
            long provNum = 0;

            if (comboProv.SelectedIndex != 0)
            {
                provNum = ProviderC.ListShort[comboProv.SelectedIndex - 1].ProvNum;
            }
            long siteNum = 0;

            if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0)
            {
                siteNum = SiteC.List[comboSite.SelectedIndex - 1].SiteNum;
            }
            long clinicNum = 0;

            if (comboClinic.SelectedIndex > 0)
            {
                clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum;
            }
            bool showBrokenAppts;

            showBrokenAppts = checkBrokenAppts.Checked;
            ListUn          = Appointments.RefreshUnsched(order, provNum, siteNum, showBrokenAppts, clinicNum);
            int scrollVal = grid.ScrollValue;

            grid.BeginUpdate();
            grid.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableUnsched", "Patient"), 140);

            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Date"), 65);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Status"), 110);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Prov"), 50);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Procedures"), 150);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableUnsched", "Notes"), 200);
            grid.Columns.Add(col);
            grid.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListUn.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(patientNames[ListUn[i].PatNum]);
                if (ListUn[i].AptDateTime.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListUn[i].AptDateTime.ToShortDateString());
                }
                row.Cells.Add(DefC.GetName(DefCat.RecallUnschedStatus, ListUn[i].UnschedStatus));
                row.Cells.Add(Providers.GetAbbr(ListUn[i].ProvNum));
                row.Cells.Add(ListUn[i].ProcDescript);
                row.Cells.Add(ListUn[i].Note);
                grid.Rows.Add(row);
            }
            grid.EndUpdate();
            grid.ScrollValue = scrollVal;
            Cursor           = Cursors.Default;
        }
Example #5
0
        private void FillGrid()
        {
            Cursor = Cursors.WaitCursor;
            string order = "";

            switch (comboOrder.SelectedIndex)
            {
            case 0:
                order = "status";
                break;

            case 1:
                order = "alph";
                break;

            case 2:
                order = "date";
                break;
            }
            long provNum = 0;

            if (comboProv.SelectedIndex != 0)
            {
                provNum = ProviderC.ListShort[comboProv.SelectedIndex - 1].ProvNum;
            }
            long siteNum = 0;

            if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0)
            {
                siteNum = SiteC.List[comboSite.SelectedIndex - 1].SiteNum;
            }
            long clinicNum = 0;

            if (comboClinic.SelectedIndex > 0)
            {
                clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum;
            }
            AptList = Appointments.RefreshPlannedTracker(order, provNum, siteNum, clinicNum);
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Patient"), 140);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Date"), 65);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Status"), 110);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Prov"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Procedures"), 150);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Notes"), 200);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < AptList.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(patientNames[AptList[i].PatNum]);
                if (AptList[i].AptDateTime.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(AptList[i].AptDateTime.ToShortDateString());
                }
                row.Cells.Add(DefC.GetName(DefCat.RecallUnschedStatus, AptList[i].UnschedStatus));
                if (AptList[i].IsHygiene)
                {
                    row.Cells.Add(Providers.GetAbbr(AptList[i].ProvHyg));
                }
                else
                {
                    row.Cells.Add(Providers.GetAbbr(AptList[i].ProvNum));
                }
                row.Cells.Add(AptList[i].ProcDescript);
                row.Cells.Add(AptList[i].Note);

                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            Cursor = Cursors.Default;
        }
Example #6
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            long             feeSched = FeeSchedC.ListShort[listFeeSched.SelectedIndex].FeeSchedNum;
            string           catName  = ""; //string to hold current category name
            Fees             fee      = new Fees();
            ReportSimpleGrid report   = new ReportSimpleGrid();

            report.Query = "SELECT procedurecode.ProcCode,fee.Amount,'     ',procedurecode.Descript,"
                           + "procedurecode.AbbrDesc FROM procedurecode,fee "
                           + "WHERE procedurecode.CodeNum=fee.CodeNum AND fee.FeeSched='" + feeSched.ToString()
                           + "' ORDER BY procedurecode.ProcCode";
            FormQuery2          = new FormQuery(report);
            FormQuery2.IsReport = true;
            if (radioCode.Checked == true)
            {
                FormQuery2.SubmitReportQuery();
                report.Title = "Procedure Codes";
                report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle));
                report.SubTitle.Add(FeeScheds.GetDescription(feeSched));
                report.SetColumn(this, 0, "Code", 70);
                report.SetColumn(this, 1, "Fee Amount", 70, HorizontalAlignment.Right);
                report.SetColumn(this, 2, " ", 80);             //otherwise, the amount gets bunched up next to the description.
                report.SetColumn(this, 3, "Description", 200);
                report.SetColumn(this, 4, "Abbr Description", 200);
                FormQuery2.ShowDialog();
                DialogResult = DialogResult.OK;
            }
            else              //categories
            //report.SubmitTemp();//create TableTemp which is not actually used
            {
                ProcedureCode[] ProcList = ProcedureCodes.GetProcList();
                report.TableQ = new DataTable(null);
                for (int i = 0; i < 5; i++)                                  //add columns
                {
                    report.TableQ.Columns.Add(new System.Data.DataColumn()); //blank columns
                }
                report.InitializeColumns();
                DataRow row = report.TableQ.NewRow();//add first row by hand to get value for temp
                row[0]              = DefC.GetName(DefCat.ProcCodeCats, ProcList[0].ProcCat);
                catName             = row[0].ToString();
                row[1]              = ProcList[0].ProcCode;
                row[2]              = ProcList[0].Descript;
                row[3]              = ProcList[0].AbbrDesc;
                row[4]              = ((double)Fees.GetAmount0(ProcList[0].CodeNum, feeSched)).ToString("F");
                report.ColTotal[4] += PIn.Double(row[4].ToString());
                report.TableQ.Rows.Add(row);
                for (int i = 1; i < ProcList.Length; i++)          //loop through data rows
                {
                    row    = report.TableQ.NewRow();               //create new row called 'row' based on structure of TableQ
                    row[0] = DefC.GetName(DefCat.ProcCodeCats, ProcList[i].ProcCat);
                    if (catName == row[0].ToString())
                    {
                        row[0] = "";
                    }
                    else
                    {
                        catName = row[0].ToString();
                    }
                    row[1] = ProcList[i].ProcCode.ToString();
                    row[2] = ProcList[i].Descript;
                    row[3] = ProcList[i].AbbrDesc.ToString();
                    row[4] = ((double)Fees.GetAmount0(ProcList[i].CodeNum, feeSched)).ToString("F");
                    //report.ColTotal[4]+=PIn.PDouble(row[4].ToString());
                    report.TableQ.Rows.Add(row);
                }
                FormQuery2.ResetGrid();                //this is a method in FormQuery2;
                report.Title = "Procedure Codes";
                report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle));
                report.SubTitle.Add(FeeScheds.GetDescription(feeSched));
                report.ColPos[0]     = 20;
                report.ColPos[1]     = 120;
                report.ColPos[2]     = 270;
                report.ColPos[3]     = 470;
                report.ColPos[4]     = 620;
                report.ColPos[5]     = 770;
                report.ColCaption[0] = "Category";
                report.ColCaption[1] = "Code";
                report.ColCaption[2] = "Description";
                report.ColCaption[3] = "Abbr Description";
                report.ColCaption[4] = "Fee Amount";
                report.ColAlign[4]   = HorizontalAlignment.Right;
                FormQuery2.ShowDialog();
                DialogResult = DialogResult.OK;
            }
        }
Example #7
0
        private void FillGrid()
        {
            this.Cursor = Cursors.WaitCursor;

            /*string order="";
             * switch(comboOrder.SelectedIndex) {
             *      case 0:
             *              order="status";
             *              break;
             *      case 1:
             *              order="alph";
             *              break;
             *      case 2:
             *              order="date";
             *              break;
             * }*/
            long provNum = 0;

            if (comboProv.SelectedIndex != 0)
            {
                provNum = ProviderC.ListShort[comboProv.SelectedIndex - 1].ProvNum;
            }
            long siteNum = 0;

            if (!PrefC.GetBool(PrefName.EasyHidePublicHealth) && comboSite.SelectedIndex != 0)
            {
                siteNum = SiteC.List[comboSite.SelectedIndex - 1].SiteNum;
            }
            long clinicNum = 0;

            if (comboClinic.SelectedIndex > 0)
            {
                clinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum;
            }
            ListASAP = Appointments.RefreshASAP(provNum, siteNum, clinicNum);
            int scrollVal = grid.ScrollValue;

            grid.BeginUpdate();
            grid.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableASAP", "Patient"), 140);

            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableASAP", "Date"), 65);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableASAP", "Status"), 110);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableASAP", "Prov"), 50);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableASAP", "Procedures"), 150);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableASAP", "Notes"), 200);
            grid.Columns.Add(col);
            grid.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListASAP.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(patientNames[ListASAP[i].PatNum]);
                if (ListASAP[i].AptDateTime.Year < 1880)                //shouldn't be possible.
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListASAP[i].AptDateTime.ToShortDateString());
                }
                row.Cells.Add(DefC.GetName(DefCat.RecallUnschedStatus, ListASAP[i].UnschedStatus));
                if (ListASAP[i].IsHygiene)
                {
                    row.Cells.Add(Providers.GetAbbr(ListASAP[i].ProvHyg));
                }
                else
                {
                    row.Cells.Add(Providers.GetAbbr(ListASAP[i].ProvNum));
                }
                row.Cells.Add(ListASAP[i].ProcDescript);
                row.Cells.Add(ListASAP[i].Note);
                grid.Rows.Add(row);
            }
            grid.EndUpdate();
            grid.ScrollValue = scrollVal;
            Cursor           = Cursors.Default;
        }