Example #1
0
        public RPClassDetail(string nClassSchedule, string Dy, int nEmployeeID, ACMS.Control.ClassReportComponent2 Cc)
        {
            //
            // Required for Windows Form Designer support
            //
            fClassComponent  = "2";
            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;
            }

            Rcc2             = Cc;
            nClassScheduleID = ACMS.Convert.ToInt32(nClassSchedule);
            modInitForms.fManager.Enabled = false;


            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Example #2
0
        public RPClassDetail(string nClassSchedule, string Dy,int nEmployeeID,ACMS.Control.ClassReportComponent2 Cc)
        {
            //
            // Required for Windows Form Designer support
            //
            fClassComponent ="2";
            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;
            }

            Rcc2 = Cc;
            nClassScheduleID=ACMS.Convert.ToInt32(nClassSchedule);
            modInitForms.fManager.Enabled = false;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
        private void LoadScheduleDetail()
        {
            this.panelMon.Controls.Clear();
            this.panelTue.Controls.Clear();
            this.panelWed.Controls.Clear();
            this.panelThu.Controls.Clear();
            this.panelFri.Controls.Clear();
            this.panelSat.Controls.Clear();
            this.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 (cmbInstructor.EditValue != null && cmbInstructor.EditValue.ToString() != "")
                dvClass.RowFilter = "nInstructorID = " + cmbInstructor.EditValue;

            foreach(DataRowView dr in dvClass)
            {
                if (dr["nDay"].ToString()=="1")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelSun.Controls.Add(this.classComponent1);
                    //
                    // 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 EventHandler(this._Click);
                    this.classComponent1.lblClassId.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text =  dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    nMon = nMon + 50;

                    panelSun.Height = nMon;

                    if (nMon > nDay)
                        nDay = nMon;

                }
                else if (dr["nDay"].ToString()=="2")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelMon.Controls.Add(this.classComponent1);
                    //
                    // 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["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text =  dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    nTue = nTue + 50;

                    panelMon.Height = nTue;
                    if (nTue > nDay)
                        nDay = nTue;

                    //classComponent1.init(_dtClassSchedule);

                }
                else if (dr["nDay"].ToString()=="3")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelTue.Controls.Add(this.classComponent1);
                    //
                    // 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["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text =  dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    nWed = nWed + 50;

                    panelTue.Height = nWed;

                    if (nWed > nDay)
                        nDay = nWed;

                    //classComponent1.init(_dtClassSchedule);

                }
                else if (dr["nDay"].ToString()=="4")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelWed.Controls.Add(this.classComponent1);
                    //
                    // 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["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text = dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    nThu = nThu + 50;

                    panelWed.Height = nThu;

                    if (nThu > nDay)
                        nDay = nThu;

                }
                else if (dr["nDay"].ToString()=="5")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelThu.Controls.Add(this.classComponent1);
                    //
                    // 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["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text =  dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    nFri = nFri + 50;

                    panelThu.Height = nFri;

                    if (nFri > nDay)
                        nDay = nFri;

                }
                else if (dr["nDay"].ToString()=="6")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelFri.Controls.Add(this.classComponent1);
                    //
                    // 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["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text =  dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    nSat = nSat + 50;

                    panelFri.Height = nSat;

                    if (nSat > nDay)
                        nDay = nSat;

                }
                else if (dr["nDay"].ToString()=="7")
                {
                    this.classComponent1 = new ACMS.Control.ClassReportComponent2();
                    this.panelSat.Controls.Add(this.classComponent1);
                    //
                    // 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["strClassCode"].ToString();
                    this.classComponent1.lblClassTime.Text = Convert.ToDateTime(dr["dtStartTime"]).ToShortTimeString();
                    this.classComponent1.lblClassName.Text = dr["strClassCode"].ToString();
                    this.classComponent1.lblClassInstructor.Text = dr["Instructor"].ToString();
                    this.classComponent1.lblBranch.Text = dr["strBranchCode"].ToString();
                    this.classComponent1.lblTodayAttendance.Text =  dr["ThisWeekNo"].ToString();
                    this.classComponent1.lblnDay.Text =  dr["nDay"].ToString();

                    if (dr["Instructor"].ToString() == "")
                        this.classComponent1.BackColor = System.Drawing.Color.Red;

                    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;
        }