Ignore:
Timestamp:
Mar 20, 2011, 3:22:11 AM (13 years ago)
Author:
Sam Habiel
Message:

CalendarGrid:

  • Support for Autoscrolling corrected.
  • A little optimization: Grid is only drawn once now when starting, not twice (don't know why original code did that).

CGAppointment:

  • Added member Patient (new Class)

CGDocument:

  • OnOpenDocument now accepts input of DateTime to decide where to open document.
  • SlotsAvailable algorithm now includes code for scaling according to timescale and code to merge Blocks if they are adjacent.

CGDocumentManager:

  • Fix bug having to do with canceling log-in after first retry. BMX lib threw an exception which was not caught.

CGView: Many changes:

  • SlotsAvailable signature changed in CGDocument. All references to it had to be changed.
  • Opening a node in the tvSchedules by clicking on the plus sign did not select it. Code changes to make it select it.
  • UpdateStatusBar now uses a string builder; and shows a more comprehensive message on the availability in the Status Bar.
  • Focus issues on various controls.
  • Support for printing a slip after an appointment is made automatically has been added.

CustomPrinting:

  • now includes a method to print a single appointment slip

DAppointPage:

  • Checkbox to decide whether to print appt slip added.
  • New readonly property to get the appointment that has been made (of type CGAppointment).

DApptSearch:

  • StartDate and EndDate now autoadjust based on each other.
  • lblMessage added to show user message if no appointments are found.
File:
1 edited

Legend:

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

    r1097 r1106  
    5353        private ColumnHeader colDOW;
    5454        private ColumnHeader colID;
     55        private Label lblMessage;
    5556     
    5657        private System.ComponentModel.IContainer components;
     
    312313            this.colSlots = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    313314            this.colAccessType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     315            this.lblMessage = new System.Windows.Forms.Label();
    314316            this.panel1.SuspendLayout();
    315317            this.pnlDescription.SuspendLayout();
     
    323325            // panel1
    324326            //
     327            this.panel1.Controls.Add(this.lblMessage);
    325328            this.panel1.Controls.Add(this.cmdSearch);
    326329            this.panel1.Controls.Add(this.cmdCancel);
     
    334337            // cmdSearch
    335338            //
    336             this.cmdSearch.Location = new System.Drawing.Point(536, 8);
     339            this.cmdSearch.Location = new System.Drawing.Point(33, 6);
    337340            this.cmdSearch.Name = "cmdSearch";
    338341            this.cmdSearch.Size = new System.Drawing.Size(72, 24);
     
    344347            //
    345348            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    346             this.cmdCancel.Location = new System.Drawing.Point(616, 8);
     349            this.cmdCancel.Location = new System.Drawing.Point(828, 8);
    347350            this.cmdCancel.Name = "cmdCancel";
    348351            this.cmdCancel.Size = new System.Drawing.Size(64, 24);
     
    353356            //
    354357            this.btnAccept.DialogResult = System.Windows.Forms.DialogResult.OK;
    355             this.btnAccept.Location = new System.Drawing.Point(128, 8);
     358            this.btnAccept.Location = new System.Drawing.Point(135, 8);
    356359            this.btnAccept.Name = "btnAccept";
    357360            this.btnAccept.Size = new System.Drawing.Size(176, 24);
     
    436439            this.dtEnd.Size = new System.Drawing.Size(200, 20);
    437440            this.dtEnd.TabIndex = 65;
     441            this.dtEnd.ValueChanged += new System.EventHandler(this.dtEnd_ValueChanged);
    438442            //
    439443            // dtStart
     
    443447            this.dtStart.Size = new System.Drawing.Size(200, 20);
    444448            this.dtStart.TabIndex = 64;
     449            this.dtStart.ValueChanged += new System.EventHandler(this.dtStart_ValueChanged);
    445450            //
    446451            // label3
     
    672677            this.colAccessType.Width = 101;
    673678            //
     679            // lblMessage
     680            //
     681            this.lblMessage.AutoSize = true;
     682            this.lblMessage.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     683            this.lblMessage.ForeColor = System.Drawing.Color.Red;
     684            this.lblMessage.Location = new System.Drawing.Point(337, 16);
     685            this.lblMessage.Name = "lblMessage";
     686            this.lblMessage.Size = new System.Drawing.Size(0, 16);
     687            this.lblMessage.TabIndex = 3;
     688            //
    674689            // DApptSearch
    675690            //
     
    685700            this.Text = "Find Clinic Availability";
    686701            this.panel1.ResumeLayout(false);
     702            this.panel1.PerformLayout();
    687703            this.pnlDescription.ResumeLayout(false);
    688704            this.grpDescription.ResumeLayout(false);
     
    703719                        //Tell user we are processing
    704720            this.Cursor = Cursors.WaitCursor;
    705            
     721            this.lblMessage.Text = String.Empty;
     722
    706723            //Get the control data into local vars
    707724                        UpdateDialogData(false);
     
    879896            lstResults.Items.Clear(); //empty it from old data
    880897
    881             //if (items.Length == 0) lstResults.Items.Add(new ListViewItem(new string[] { "", "", "", "" , "", "No Slots found", "", "" })); // no results
    882898            if (items.Length > 0) lstResults.Items.AddRange(items); // add new data
     899            else this.lblMessage.Text = "No available Appointment Slots Found!";
    883900
    884901            lstResults.EndUpdate(); // ok done adding items, draw now.
     
    904921                }
    905922
    906                 private void grdResult_DoubleClick(object sender, System.EventArgs e)
    907                 {
    908                         /*
    909             if (lstResults.DataSource == null)
    910                                 return;
    911 
    912                         DataGridViewCell dgCell;
    913                         dgCell = this.grdResult.CurrentCell;
    914             this.m_sSelectedResource = grdResult.SelectedRows[0].Cells[2].ToString();
    915             this.m_sSelectedDate = (DateTime)grdResult.SelectedRows[0].Cells[0].Value;
    916                         this.DialogResult = DialogResult.OK;
    917                         this.Close();
    918              */
    919                 }
    920 
    921                 private void grdResult_CurrentCellChanged(object sender, System.EventArgs e)
    922                 {
    923                         /*
    924             DataGridViewCell dgCell;
    925             dgCell = this.grdResult.CurrentCell;
    926              */
    927         }
    928 
    929         /// <summary>
    930         /// BAAAAAAAAAAAAAAAAAD. Use a shared method instead.
    931         /// </summary>
    932         /// <param name="sender"></param>
    933         /// <param name="e"></param>
     923
    934924        private void lstResults_DoubleClick(object sender, EventArgs e)
    935925        {
    936             btnAccept_Click(sender, e);
     926            ProcessChoice(sender, e);
    937927        }
    938928
    939929        private void btnAccept_Click(object sender, EventArgs e)
     930        {
     931            ProcessChoice(sender, e);
     932        }
     933
     934        /// <summary>
     935        /// Shared method to process a user's choice
     936        /// </summary>
     937        /// <param name="s">sender</param>
     938        /// <param name="e">EventArgs</param>
     939        private void ProcessChoice(object s, EventArgs e)
    940940        {
    941941            if (lstResults.SelectedIndices.Count == 0)
    942942            {
    943943                this.DialogResult = DialogResult.None;
     944                lblMessage.Text = "No Appointment Slot selected!";
    944945                return;
    945946            }
     
    952953        }
    953954
     955        /// <summary>
     956        /// Adjust start date based on end date.
     957        /// </summary>
     958        /// <param name="sender"></param>
     959        /// <param name="e"></param>
     960        private void dtStart_ValueChanged(object sender, EventArgs e)
     961        {
     962            if (dtEnd.Value < dtStart.Value) dtEnd.Value = dtStart.Value;
     963        }
     964
     965        /// <summary>
     966        /// Adjust end date based on start date.
     967        /// </summary>
     968        /// <param name="sender"></param>
     969        /// <param name="e"></param>
     970        private void dtEnd_ValueChanged(object sender, EventArgs e)
     971        {
     972            if (dtStart.Value > dtEnd.Value) dtStart.Value = dtEnd.Value;
     973        }
     974
    954975        #endregion  Event Handlers
    955976
    956977        #region Properties
    957 
    958978       
    959979        /// <summary>
     
    966986
    967987                #endregion Properties
     988
     989
    968990    }
    969991}
Note: See TracChangeset for help on using the changeset viewer.