public RPClassDetail(string nClassSchedule, string Dy,int nEmployeeID,ACMS.Control.ClassReportComponent Cc) { // // Required for Windows Form Designer support // fClassComponent ="1"; connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"]; connection = new SqlConnection(connectionString); InitializeComponent(); switch(Dy) { case "1": txtDay.EditValue="Sunday";break; case "2": txtDay.EditValue="Monday";break; case "3": txtDay.EditValue="Tuesday";break; case "4": txtDay.EditValue="Wednesday";break; case "5": txtDay.EditValue="Thursday";break; case "6": txtDay.EditValue="Friday";break; case "7": txtDay.EditValue="Saturday";break; } Rcc = Cc; nClassScheduleID=ACMS.Convert.ToInt32(nClassSchedule); modInitForms.fManager.Enabled = false; // // TODO: Add any constructor code after InitializeComponent call // }
public RPClassDetail(string nClassSchedule, string Dy, int nEmployeeID, ACMS.Control.ClassReportComponent Cc) { // // Required for Windows Form Designer support // fClassComponent = "1"; connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"]; connection = new SqlConnection(connectionString); InitializeComponent(); switch (Dy) { case "1": txtDay.EditValue = "Sunday"; break; case "2": txtDay.EditValue = "Monday"; break; case "3": txtDay.EditValue = "Tuesday"; break; case "4": txtDay.EditValue = "Wednesday"; break; case "5": txtDay.EditValue = "Thursday"; break; case "6": txtDay.EditValue = "Friday"; break; case "7": txtDay.EditValue = "Saturday"; break; } Rcc = Cc; nClassScheduleID = ACMS.Convert.ToInt32(nClassSchedule); modInitForms.fManager.Enabled = false; // // TODO: Add any constructor code after InitializeComponent call // }
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 = "strBranchCode='" + cmbBranch.EditValue.ToString() + "'"; foreach(DataRowView dr in dvClass) { if (dr["nDay"].ToString()=="1") { this.classComponent1 = new ACMS.Control.ClassReportComponent(); // // 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.lblLastFourWeekAttendance.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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["nDay"].ToString()=="2") { this.classComponent1 = new ACMS.Control.ClassReportComponent(); // // 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.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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["nDay"].ToString()=="3") { this.classComponent1 = new ACMS.Control.ClassReportComponent(); // // 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.lblLastFourWeekAttendance.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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["nDay"].ToString()=="4") { this.classComponent1 = new ACMS.Control.ClassReportComponent(); // // 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.lblLastFourWeekAttendance.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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["nDay"].ToString()=="5") { this.classComponent1 = new ACMS.Control.ClassReportComponent(); // // 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.lblLastFourWeekAttendance.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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["nDay"].ToString()=="6") { this.classComponent1 = new ACMS.Control.ClassReportComponent(); // // 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.lblLastFourWeekAttendance.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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.ClassReportComponent(); // // 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.lblLastFourWeekAttendance.Text = dr["PastFourWeekNo"].ToString(); this.classComponent1.lblLastThreeWeekAttendance.Text = dr["PastThreeWeekNo"].ToString(); this.classComponent1.lblLastTwoWeekAttendance.Text = dr["PastTwoWeekNo"].ToString(); this.classComponent1.lblLastWeekAttendance.Text = dr["PastOneWeekNo"].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["PastFourWeekNo"]))<= BelowVal) { this.classComponent1.lblLastFourWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastThreeWeekNo"]))<= BelowVal) { this.classComponent1.lblLastThreeWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastTwoWeekNo"]))<= BelowVal) { this.classComponent1.lblLastTwoWeekAttendance.BackColor=System.Drawing.Color.Red; } if ((ACMS.Convert.ToInt32(dr["PastOneWeekNo"]))<= BelowVal) { this.classComponent1.lblLastWeekAttendance.BackColor=System.Drawing.Color.Red; } 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; }