Ejemplo n.º 1
0
        public void Init(bool isInternalCall)
        {
            try
            {
                if (myHaveInit && !isInternalCall)
                {
                    return;
                }

                int index = myCurrentPageRate * 5;

                myHaveInit = true;

                if (mySpaBooking == null)
                {
                    mySpaBooking = new ACMSLogic.SpaBooking();
                }

                myServiceSessionTable           = mySpaBooking.GetCurrentBranchServiceSession();
                myServiceSessionTable.TableName = "tblServiceSession";


                ACMSDAL.TblEmployee sqlEmployee = new ACMSDAL.TblEmployee();

                myEmployeeTable           = sqlEmployee.GetTherapistForSpaBooking(ACMSLogic.User.BranchCode, dateNavigator1.DateTime.Date, index, index + 5);
                myEmployeeTable.TableName = "tblEmployee";

                myDataSet = new DataSet("DS");
                myDataSet.Tables.Add(myServiceSessionTable);
                myDataSet.Tables.Add(myEmployeeTable);

                DataRelation relation = new DataRelation("ServiceSession_Therapist_Relation",
                                                         myServiceSessionTable.Columns["nServiceEmployeeID"],
                                                         myEmployeeTable.Columns["nEmployeeID"], false);

                myDataSet.Relations.Add(relation);

                schedulerStorage1.Appointments.DataMember           = "tblServiceSession";
                schedulerStorage1.Appointments.DataSource           = myDataSet;
                schedulerStorage1.Appointments.Mappings.Description = "strRemarks";
                schedulerStorage1.Appointments.Mappings.End         = "dtEndTime";
                schedulerStorage1.Appointments.Mappings.ResourceId  = "nServiceEmployeeID";
                schedulerStorage1.Appointments.Mappings.Start       = "dtStartTime";
                schedulerStorage1.Appointments.Mappings.Status      = "nStatusID";
                schedulerStorage1.Appointments.Mappings.Subject     = "strMembershipID";

                schedulerStorage1.Resources.DataMember       = "tblEmployee";
                schedulerStorage1.Resources.DataSource       = myDataSet;
                schedulerStorage1.Resources.Mappings.Caption = "strEmployeeName";
                schedulerStorage1.Resources.Mappings.Id      = "nEmployeeID";

                schedulerControl1.GroupType = DevExpress.XtraScheduler.SchedulerGroupType.Resource;

                if (!isInternalCall)
                {
                    schedulerControl1.Start = DateTime.Today;
                }

                schedulerControl1.DayView.WorkTime =
                    new DevExpress.XtraScheduler.TimeOfDayInterval(TimeSpan.FromHours(9.00), TimeSpan.FromHours(23.00));
                schedulerControl1.DayView.ShowWorkTimeOnly          = true;
                schedulerControl1.DayView.TimeRulers[0].ShowMinutes = true;
                schedulerControl1.DayView.TimeScale = TimeSpan.FromMinutes(15.00);
            }
            catch
            {}
        }