Ignore:
Timestamp:
Aug 10, 2010, 8:00:01 AM (14 years ago)
Author:
Sam Habiel
Message:
  1. Fix bug of not showing appointments in 7 day view if arabic locale on machine.
  2. Fix printing of routing slip (add clinic and fix appointment time and HRN)
  3. Add RTL support for letters printed in Arabic Locale.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs

    r846 r900  
    659659            DateTime endTime = a.EndTime;
    660660            string resource = a.Resource;
    661             int num = 0;
    662             int num2 = 0;
    663             int num3 = 0;
    664             int num4 = 0;
    665             int num5 = 0;
     661            int originX = 0;
     662            int originY = 0;
     663            int recHeight = 0;
     664            int recWidth = 0;
     665            int columnToPutAppt = 0;
    666666            Rectangle rectangle = new Rectangle();
    667             int totalMinutes = (int) startTime.TimeOfDay.TotalMinutes;
    668             int num7 = (int) endTime.TimeOfDay.TotalMinutes;
     667            int startTotalMinutesoffset = (int) startTime.TimeOfDay.TotalMinutes;
     668            int endTotalMinutesoffset = (int) endTime.TimeOfDay.TotalMinutes;
     669            // if grid has more than one reource
    669670            if (this.m_sResourcesArray.Count > 1)
    670671            {
    671                 num5 = (int) this.m_ColumnInfoTable[resource];
    672                 num5++;
     672                // get zero based index
     673                columnToPutAppt = (int) this.m_ColumnInfoTable[resource];
     674                // increment to 1 based index
     675                columnToPutAppt++;
    673676            }
    674677            else
    675678            {
    676                 num5 = ((int) (startTime.DayOfWeek - this.m_dtStart.DayOfWeek)) + 1;
    677             }
    678             if (num5 < 1)
     679                columnToPutAppt = (startTime - this.m_dtStart).Days + 1;
     680            }
     681            if (columnToPutAppt < 1)
    679682            {
    680683                bRet = false;
    681684                return rectangle;
    682685            }
    683             num = col0Width + (cellWidth * (num5 - 1));
    684             int num8 = totalMinutes + this.m_nTimeScale;
    685             int num9 = (num7 > 0) ? num7 : 0x5a0;
    686             num9 -= totalMinutes;
    687             num2 = (cellHeight * num8) / this.m_nTimeScale;
    688             num3 = (cellHeight * num9) / this.m_nTimeScale;
    689             num4 = cellWidth;
    690             rectangle.X = num;
    691             rectangle.Y = num2;
    692             rectangle.Width = num4;
    693             rectangle.Height = num3;
     686            originX = col0Width + (cellWidth * (columnToPutAppt - 1));
     687            int num8 = startTotalMinutesoffset + this.m_nTimeScale;
     688            int num9 = (endTotalMinutesoffset > 0) ? endTotalMinutesoffset : 0x5a0;
     689            num9 -= startTotalMinutesoffset;
     690            originY = (cellHeight * num8) / this.m_nTimeScale;
     691            recHeight = (cellHeight * num9) / this.m_nTimeScale;
     692            recWidth = cellWidth;
     693            rectangle.X = originX;
     694            rectangle.Y = originY;
     695            rectangle.Width = recWidth;
     696            rectangle.Height = recHeight;
    694697            bRet = true;
    695698            return rectangle;
Note: See TracChangeset for help on using the changeset viewer.