private void LoadScheduleDetail() { int BelowVal = 5; panelMon.Controls.Clear(); panelTue.Controls.Clear(); panelWed.Controls.Clear(); panelThu.Controls.Clear(); panelFri.Controls.Clear(); //panelSat.Controls.Clear(); panelSun.Controls.Clear(); int nMon, nTue, nWed, nThu, nFri, nSat, nSun; nMon = 2; nTue = 2; nWed = 2; nThu = 2; nFri = 2; nSat = 2; nSun = 2; int nDay = 0; this.SuspendLayout(); panelSun.SuspendLayout(); panelMon.SuspendLayout(); panelTue.SuspendLayout(); panelWed.SuspendLayout(); panelThu.SuspendLayout(); panelFri.SuspendLayout(); //panelSat.SuspendLayout(); DataView dvClass = new DataView(_dtClassSchedule); // if (cmbBranch.EditValue.ToString() != "") //dvClass.RowFilter = "dtDate='" + dtDate.Text + "'"; foreach (DataRowView dr in dvClass) { if (dr["strBranchCode"].ToString() == "BJ") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nMon); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } this.panelSun.Controls.Add(this.classComponent1); nMon = nMon + 50; panelSun.Height = nMon; if (nMon > nDay) { nDay = nMon; } } else if (dr["strBranchCode"].ToString() == "PM") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nTue); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); // this.classComponent1.lblLastFourWeekAttendance.Visible = false; // this.classComponent1.lblLastThreeWeekAttendance.Visible = false; // this.classComponent1.lblLastTwoWeekAttendance.Visible = false; // this.classComponent1.lblLastWeekAttendance.Visible = false; this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } this.panelMon.Controls.Add(this.classComponent1); nTue = nTue + 50; panelMon.Height = nTue; if (nTue > nDay) { nDay = nTue; } } else if (dr["strBranchCode"].ToString() == "WL") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nWed); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } this.panelTue.Controls.Add(this.classComponent1); nWed = nWed + 50; panelTue.Height = nWed; if (nWed > nDay) { nDay = nWed; } } else if (dr["strBranchCode"].ToString() == "HM") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nThu); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } this.panelWed.Controls.Add(this.classComponent1); nThu = nThu + 50; panelWed.Height = nThu; if (nThu > nDay) { nDay = nThu; } } else if (dr["strBranchCode"].ToString() == "JP") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nFri); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } this.panelThu.Controls.Add(this.classComponent1); nFri = nFri + 50; panelThu.Height = nFri; if (nFri > nDay) { nDay = nFri; } } else if (dr["strBranchCode"].ToString() == "EP") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nSat); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } this.panelFri.Controls.Add(this.classComponent1); nSat = nSat + 50; panelFri.Height = nSat; if (nSat > nDay) { nDay = nSat; } } else if (dr["nDay"].ToString() == "7") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nSun); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}", Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text = dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"])) <= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor = System.Drawing.Color.Red; } //this.panelSat.Controls.Add(this.classComponent1); nSun = nSun + 50; //panelSat.Height = nSun; if (nSun > nDay) { nDay = nSun; } } } this.ResumeLayout(); panelSun.ResumeLayout(); panelMon.ResumeLayout(); panelTue.ResumeLayout(); panelWed.ResumeLayout(); panelThu.ResumeLayout(); panelFri.ResumeLayout(); //panelSat.ResumeLayout(); groupControl1.Height = nDay + 200; }
private void LoadScheduleDetail() { int BelowVal=5; panelMon.Controls.Clear(); panelTue.Controls.Clear(); panelWed.Controls.Clear(); panelThu.Controls.Clear(); panelFri.Controls.Clear(); //panelSat.Controls.Clear(); panelSun.Controls.Clear(); int nMon,nTue,nWed,nThu,nFri,nSat,nSun; nMon = 2; nTue = 2; nWed = 2; nThu = 2; nFri = 2; nSat = 2; nSun = 2; int nDay = 0; this.SuspendLayout(); panelSun.SuspendLayout(); panelMon.SuspendLayout(); panelTue.SuspendLayout(); panelWed.SuspendLayout(); panelThu.SuspendLayout(); panelFri.SuspendLayout(); //panelSat.SuspendLayout(); DataView dvClass = new DataView(_dtClassSchedule); // if (cmbBranch.EditValue.ToString() != "") //dvClass.RowFilter = "dtDate='" + dtDate.Text + "'"; foreach(DataRowView dr in dvClass) { if (dr["strBranchCode"].ToString()=="BJ") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nMon); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } this.panelSun.Controls.Add(this.classComponent1); nMon = nMon + 50; panelSun.Height = nMon; if (nMon > nDay) nDay = nMon; } else if (dr["strBranchCode"].ToString()=="PM") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nTue); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); // this.classComponent1.lblLastFourWeekAttendance.Visible = false; // this.classComponent1.lblLastThreeWeekAttendance.Visible = false; // this.classComponent1.lblLastTwoWeekAttendance.Visible = false; // this.classComponent1.lblLastWeekAttendance.Visible = false; this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } this.panelMon.Controls.Add(this.classComponent1); nTue = nTue + 50; panelMon.Height = nTue; if (nTue > nDay) nDay = nTue; } else if (dr["strBranchCode"].ToString()=="WL") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nWed); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } this.panelTue.Controls.Add(this.classComponent1); nWed = nWed + 50; panelTue.Height = nWed; if (nWed > nDay) nDay = nWed; } else if (dr["strBranchCode"].ToString()=="HM") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nThu); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } this.panelWed.Controls.Add(this.classComponent1); nThu = nThu + 50; panelWed.Height = nThu; if (nThu > nDay) nDay = nThu; } else if (dr["strBranchCode"].ToString()=="JP") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nFri); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } this.panelThu.Controls.Add(this.classComponent1); nFri = nFri + 50; panelThu.Height = nFri; if (nFri > nDay) nDay = nFri; } else if (dr["strBranchCode"].ToString()=="EP") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nSat); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } this.panelFri.Controls.Add(this.classComponent1); nSat = nSat + 50; panelFri.Height = nSat; if (nSat > nDay) nDay = nSat; } else if (dr["nDay"].ToString()=="7") { this.classComponent1 = new ACMS.Control.DayClassReportComponent(); // // classComponent1 // this.classComponent1.BackColor = System.Drawing.Color.Silver; this.classComponent1.Location = new System.Drawing.Point(2, nSun); this.classComponent1.Name = "classComponent1"; this.classComponent1.Size = new System.Drawing.Size(127, 50); this.classComponent1.TabIndex = 0; this.classComponent1.Click += new System.EventHandler(this._Click); //this.classComponent1.lblClassId.Text = dr["nClassInstanceID"].ToString(); this.classComponent1.lblClassTime.Text = string.Format("{0:hh:mm:tt}",Convert.ToDateTime(dr["dtStartTime"])); this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString(); this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString(); this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString(); this.classComponent1.lblnDay.Text = dr["nDay"].ToString(); this.classComponent1.lblnClassSchedule.Text=dr["nClassScheduleID"].ToString(); if ((ACMS.Convert.ToInt32(dr["ThisWeekNo"]))<= BelowVal) { this.classComponent1.lblTodayAttendance.BackColor=System.Drawing.Color.Red; } //this.panelSat.Controls.Add(this.classComponent1); nSun = nSun + 50; //panelSat.Height = nSun; if (nSun > nDay) nDay = nSun; } } this.ResumeLayout(); panelSun.ResumeLayout(); panelMon.ResumeLayout(); panelTue.ResumeLayout(); panelWed.ResumeLayout(); panelThu.ResumeLayout(); panelFri.ResumeLayout(); //panelSat.ResumeLayout(); groupControl1.Height = nDay + 200; }