Beispiel #1
0
    private void loadRoutine()
    {
        try
        {
            STD_RoutineTime routineTime = new STD_RoutineTime();
            routineTime.RoomID = Request.QueryString["RoomID"] == null ? 0 : int.Parse(Request.QueryString["RoomID"]);
            routineTime.RoutineID = Request.QueryString["RoutineID"] == null ? 0 : int.Parse(Request.QueryString["RoutineID"]);
            routineTime.ClassID = Request.QueryString["ClassID"] == null ? 0 : int.Parse(Request.QueryString["ClassID"]);
            routineTime.SubjectID = Request.QueryString["SubjectID"] == null ? 0 : int.Parse(Request.QueryString["SubjectID"]);
            routineTime.EmployeeID = Request.QueryString["EmployeeID"] == null ? "" : Request.QueryString["EmployeeID"];
            string StudentID = Request.QueryString["StudentID"] == null ? "" : Request.QueryString["StudentID"];
            lblRoutineDisplay.Text= STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID);
            lblRoutineDisplay.Text = lblRoutineDisplay.Text.Replace("id='tblRoutineDisplay'", "border='1'");
            lblRoutineDisplay.Text = lblRoutineDisplay.Text.Replace("id='tblRoutineDisplayTeacher'", "border='1'");

            if (Request.QueryString["Archive"] != null)
            {
                STD_Archive sTD_Archive = new STD_Archive();

                sTD_Archive.Archive = lblRoutineDisplay.Text;
                sTD_Archive.AddedDate = DateTime.Now;
                int resutl = STD_ArchiveManager.InsertSTD_Archive(sTD_Archive);
            }
        }
        catch (Exception ex)
        { }
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        STD_RoutineTime routineTime = new STD_RoutineTime();
        routineTime.RoomID = 0;
        routineTime.RoutineID = ddlCampus.SelectedValue == "0" ? 0 : int.Parse(ddlRoutineID.SelectedValue);
        routineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
        routineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
        routineTime.EmployeeID = ddlEmployeeID.SelectedValue == "0" ? "" : ddlEmployeeID.SelectedValue;
        //string StudentID = "";

        Response.Redirect("~/Class/RoutineDisplay.aspx?RoutineID=" + routineTime.RoutineID.ToString() + "&ClassID=" + routineTime.ClassID.ToString() + "&SubjectID=" + routineTime.SubjectID.ToString() + "&EmployeeID=" + routineTime.EmployeeID);
        //if (Session["tblRoutineTemplate"] != null)
        //{

        //    Response.Redirect("~/Class/Class_Display_Routine.aspx");
        //    Session["tblRoutineTemplate"] = null;
        //}
        //else
        //{
        //    StringBuilder sb = new StringBuilder();
        //    sb.Append("alert('No Record Found')");
        //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", sb.ToString(), true);

        //}
    }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();
         sTD_RoutineTime.RoutineTimeID = int.Parse(Request.QueryString["ID"].ToString());
         sTD_RoutineTime.RoutineTimeName = txtRoutineTimeName.Text;
         sTD_RoutineTime.RoomID = int.Parse(ddlRoomID.SelectedValue);
         sTD_RoutineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
         sTD_RoutineTime.EmployeeID = ddlEmployeeID.SelectedValue;
         sTD_RoutineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
         //sTD_RoutineTime.ClassDayID = int.Parse(ddlClassDayID.SelectedValue);
         //sTD_RoutineTime.ClassTimeID = int.Parse(ddlClassTimeID.SelectedValue);
         sTD_RoutineTime.RoutineID = int.Parse(ddlRoutineID.SelectedValue);
         sTD_RoutineTime.AddedBy = Profile.card_id;
         sTD_RoutineTime.AddedDate = DateTime.Now;
         sTD_RoutineTime.UpdatedBy = Profile.card_id;
         sTD_RoutineTime.UpdateDate = DateTime.Now;
         bool resutl = STD_RoutineTimeManager.UpdateSTD_RoutineTime(sTD_RoutineTime);
         Response.Redirect("AdminDisplaySTD_RoutineTime.aspx");
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string[] ids = ddlClassSubjectEmployeeID.SelectedValue.Split(',');

        STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime ();
        //	sTD_RoutineTime.RoutineTimeID=  int.Parse(ddlRoutineTimeID.SelectedValue);
        sTD_RoutineTime.RoutineTimeName = ddlClassSubjectEmployeeID.SelectedItem.Text + " - " + ddlRoomID.SelectedItem.Text;
        sTD_RoutineTime.RoomID=  int.Parse(ddlRoomID.SelectedValue);
        sTD_RoutineTime.SubjectID=  int.Parse(ids[1]);
        sTD_RoutineTime.EmployeeID=  ids[2];
        sTD_RoutineTime.ClassID = int.Parse(ids[0]);
        sTD_RoutineTime.ClassDayID=  int.Parse(ddlClassDayID.SelectedValue);
        sTD_RoutineTime.ClassTimeID=  int.Parse(ddlClassTimeID.SelectedValue);
        sTD_RoutineTime.RoutineID=  int.Parse(ddlRoutineID.SelectedValue);
        sTD_RoutineTime.AddedBy=  Profile.card_id;
        sTD_RoutineTime.AddedDate=  DateTime.Now;
        sTD_RoutineTime.UpdatedBy=  Profile.card_id;
        sTD_RoutineTime.UpdateDate=  DateTime.Now;

        /*
         we have to have the checking
         * DayID - TimeID - Room --------No RoutineTimeID
         * DayID - TimeID - Teacher -----No RoutineTimeID
         * DayID - TimeID - ClassID -----No RoutineTimeID
         */

        int resutl =STD_RoutineTimeManager.InsertSTD_RoutineTime(sTD_RoutineTime);
        Response.Redirect("AdminDisplaySTD_RoutineTime.aspx");
    }
    protected void btnPrintnArchive_Click(object sender, EventArgs e)
    {
        STD_RoutineTime routineTime = new STD_RoutineTime();
        routineTime.RoomID = 0;
        routineTime.RoutineID = ddlCampus.SelectedValue == "0" ? 0 : int.Parse(ddlRoutineID.SelectedValue);
        routineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
        routineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
        routineTime.EmployeeID = ddlEmployeeID.SelectedValue == "0" ? "" : ddlEmployeeID.SelectedValue;
        //string StudentID = "";

        Response.Redirect("~/Class/RoutineDisplay.aspx?Archive=1&RoutineID=" + routineTime.RoutineID.ToString() + "&ClassID=" + routineTime.ClassID.ToString() + "&SubjectID=" + routineTime.SubjectID.ToString() + "&EmployeeID=" + routineTime.EmployeeID);
    }
Beispiel #6
0
    public static String getRoutineText(STD_RoutineTime routineTime, string StudentID)
    {
        try
        {
            DataSet dsRoutineTime = STD_RoutineTimeManager.STD_SearchRoutineTime(routineTime, StudentID);

            DataSet dsClassTime = STD_ClassTimeManager.GetAllSTD_ClassTimes();
            DataSet dsClassDay = STD_ClassDayManager.GetAllSTD_ClassDaies();
            int width = 200;
            int widthDay = 50;
            string routine = "<table border='1' style='width:" + ((dsClassTime.Tables[0].Rows.Count * width) + widthDay).ToString() + "px'>";

            for (int row = 0; row < dsClassDay.Tables[0].Rows.Count; row++)
            {
                if (row == 0)
                {
                    routine += "<tr ><td></td>";
                    for (int col = 0; col < dsClassTime.Tables[0].Rows.Count; col++)
                    {
                        routine += "<td>";
                        routine += dsClassTime.Tables[0].Rows[col]["ClassTimeName"].ToString();
                        routine += "</td>";

                    }
                    routine += "</tr>";
                }

                routine += "<tr>";
                for (int col = 0; col < dsClassTime.Tables[0].Rows.Count; col++)
                {
                    if (col == 0)
                    {
                        routine += "<td style='min-width:" + widthDay + "px'>";
                        routine += dsClassDay.Tables[0].Rows[row]["ClassDayName"].ToString();
                        routine += "</td>";
                    }

                    routine += "<td style='min-width:" + width + "px;'>";
                    routine += GetClassName(routineTime,dsRoutineTime, dsClassTime.Tables[0].Rows[col]["ClassTimeID"].ToString(), dsClassDay.Tables[0].Rows[row]["ClassDayID"].ToString());
                    routine += "</td>";
                }
                routine += "</tr>";
            }
            routine += "</table>";

            return routine;

        }
        catch (Exception ex)
        {
            return "";
        }
    }
Beispiel #7
0
    public static string GetClassName(STD_RoutineTime routineTime, DataSet dsRoutineTime, string ClassTimeID, string ClassDayID)
    {
        string className = "";
        foreach (DataRow dr in dsRoutineTime.Tables[0].Rows)
        {
            if (dr["ClassTimeID"].ToString() == ClassTimeID && dr["ClassDayID"].ToString() == ClassDayID)
            {
                //if (className != "") className += "</br>";

                //className += "Subject( " + dr["SubjectName"].ToString() + " ) Class( " + dr["ClassName"].ToString() + " ) Teacher( " + dr["EmployeeName"].ToString() + " )";
                className += "<div style='border:1px solid black;'>(" + dr["ClassName"].ToString() + ") (" + dr["SubjectName"].ToString() + ") (" + dr["EmployeeSortName"].ToString() + ")  (" + dr["RoomName"].ToString() + ")" ;
                className += "<a  href='Class_Display_RoutineTime_ByValues.aspx?IsDelete=1&CampusID=" + dr["CampusID"].ToString() + "&RoutineID=" + routineTime.RoutineID.ToString() + "&ClassID=" + routineTime.ClassID.ToString() + "&SubjectID=" + routineTime.SubjectID.ToString() + "&EmployeeID=" + routineTime.EmployeeID.ToString() + "&RoutineTimeID=" + dr["RoutineTimeID"].ToString() + "' style='display:none;'><img src='../App_Themes/CoffeyGreen/images/icon-delete.png' /></a></div>";
                //className +="<img src='../App_Themes/CoffeyGreen/images/icon-delete.png' />";
            }
        }
        return className;
    }
Beispiel #8
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     string[] ids = ddlClassSubjectEmployeeID.SelectedValue.Split(',');
     STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime ();
     sTD_RoutineTime.RoutineTimeID=  int.Parse(Request.QueryString["ID"].ToString());
     sTD_RoutineTime.RoutineTimeName=  ddlClassSubjectEmployeeID.SelectedItem.Text + " - " + ddlRoomID.SelectedItem.Text;
     sTD_RoutineTime.RoomID=  int.Parse(ddlRoomID.SelectedValue);
     sTD_RoutineTime.SubjectID = int.Parse(ids[1]);
     sTD_RoutineTime.EmployeeID = ids[2];
     sTD_RoutineTime.ClassID = int.Parse(ids[0]);
     sTD_RoutineTime.ClassDayID=  int.Parse(ddlClassDayID.SelectedValue);
     sTD_RoutineTime.ClassTimeID=  int.Parse(ddlClassTimeID.SelectedValue);
     sTD_RoutineTime.RoutineID=  int.Parse(ddlRoutineID.SelectedValue);
     sTD_RoutineTime.AddedBy=  Profile.card_id;
     sTD_RoutineTime.AddedDate=  DateTime.Now;
     sTD_RoutineTime.UpdatedBy=  Profile.card_id;
     sTD_RoutineTime.UpdateDate=  DateTime.Now;
     bool  resutl =STD_RoutineTimeManager.UpdateSTD_RoutineTime(sTD_RoutineTime);
     Response.Redirect("AdminDisplaySTD_RoutineTime.aspx");
 }
Beispiel #9
0
    public String getRoutineText(int classID,int SubjectID)
    {
        try
        {

            STD_RoutineTime routineTime = new STD_RoutineTime();
            routineTime.RoomID = 0;
            routineTime.ClassID = classID;
            routineTime.SubjectID = SubjectID;
            routineTime.EmployeeID = "";
            string StudentID = "";
            DataSet dsRoutineTimeByClassnSubject = STD_RoutineTimeManager.STD_SearchRoutineTime(routineTime, StudentID);

            routineTime = new STD_RoutineTime();
            routineTime.RoomID = 0;
            routineTime.ClassID = 0;
            routineTime.SubjectID = 0;
            routineTime.EmployeeID = "";
            StudentID = hfStudentID.Value == "0" ? "" : hfStudentID.Value;
            DataSet dsRoutineTimeByStudent = STD_RoutineTimeManager.STD_SearchRoutineTime(routineTime, StudentID);

            DataSet dsClassTime = STD_ClassTimeManager.GetAllSTD_ClassTimes();
            DataSet dsClassDay = STD_ClassDayManager.GetAllSTD_ClassDaies();
            int width = 120;
            int widthDay = 70;
            string routine = "<table id='tblRoutineDisplay'  style='font-size:10px;width:" + ((dsClassTime.Tables[0].Rows.Count * width) + widthDay).ToString() + "px'>";
            string classTimeGroupID = dsClassTime.Tables[0].Rows[0]["ClassTimeGroupID"].ToString();
            for (int row = 0; row < dsClassTime.Tables[0].Rows.Count; row++)
            {
                if (classTimeGroupID != dsClassTime.Tables[0].Rows[row]["ClassTimeGroupID"].ToString())
                {
                    routine += "<tr><td colspan='" + (dsClassDay.Tables[0].Rows.Count + 1) + "'>&nbsp;</br></br></br></td></tr>";
                    //routine += "<tr><td colspan='" + (dsClassDay.Tables[0].Rows.Count + 1) + "'>&nbsp;</td></tr>";
                    classTimeGroupID = dsClassTime.Tables[0].Rows[row]["ClassTimeGroupID"].ToString();
                }

                if (row == 0)
                {
                    routine += "<tr style='border-top:1px solid Black;'><td></td>";

                    for (int col = 0; col < dsClassDay.Tables[0].Rows.Count; col++)
                    {
                        routine += "<td>";
                        routine += dsClassDay.Tables[0].Rows[col]["ClassDayName"].ToString();
                        routine += "</td>";
                    }

                    routine += "</tr>";
                }

                routine += "<tr>";
                for (int col = 0; col < dsClassDay.Tables[0].Rows.Count; col++)
                {
                    if (col == 0)
                    {
                        routine += "<td style='min-width:" + widthDay + "px'>";
                        routine += dsClassTime.Tables[0].Rows[row]["ClassTimeName"].ToString();
                        routine += "</td>";
                    }

                    routine += "<td style='min-width:" + width + "px;'>";
                    routine += GetClassName(dsRoutineTimeByClassnSubject, dsRoutineTimeByStudent, dsClassTime.Tables[0].Rows[row]["ClassTimeID"].ToString(), dsClassDay.Tables[0].Rows[col]["ClassDayID"].ToString());
                    routine += "</td>";
                }
                routine += "</tr>";
            }
            routine += "</table>";

            routine += STD_RoutineTimeManager.GetTeacherName(dsRoutineTimeByClassnSubject);

            return routine;

        }
        catch (Exception ex)
        {
            return "";
        }
    }
Beispiel #10
0
    protected void btnVarify_OnClick(object sender, EventArgs e)
    {
        hfSubjects.Value = "-";
        txtStudentCode.Text = txtStudentCode.Text.Trim();
        ddlClassID.SelectedIndex = 0;
        ddlClassID_SelectedIndexChanged(this, new EventArgs());
        STD_Student student = new STD_Student();
        student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text);
        txtAccARegistrationNo.Text = student.RegistrationNo;

        if (student.RegistrationNo != "")
        {
            txtAccARegistrationNo.Enabled = false;
            btnSaveRegistrationNo.Visible = false;
        }

        if (student == null)
        {
            lblMessage.Text = "<br/>There is no Student with this student Id";
            return;
        }
        else
        {
            lblMessage.Text = "!!! Valid ID  !!!";
            hfStudentID.Value = student.StudentID;
            StudentCodeVarification(student);

            //load routine for that student;
            STD_RoutineTime routineTime = new STD_RoutineTime();
            routineTime.RoomID = Request.QueryString["RoomID"] == null ? 0 : int.Parse(Request.QueryString["RoomID"]);
            routineTime.RoutineID = Request.QueryString["RoutineID"] == null ? 0 : int.Parse(Request.QueryString["RoutineID"]);
            routineTime.ClassID = Request.QueryString["ClassID"] == null ? 0 : int.Parse(Request.QueryString["ClassID"]);
            routineTime.SubjectID = Request.QueryString["SubjectID"] == null ? 0 : int.Parse(Request.QueryString["SubjectID"]);
            routineTime.EmployeeID = Request.QueryString["EmployeeID"] == null ? "" : Request.QueryString["EmployeeID"];
            string StudentID = hfStudentID.Value;
            lblVerifyRoutine.Text = STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID);
            lblVerifyRoutine.Text = lblVerifyRoutine.Text.Replace("id='tblRoutineDisplay'", "border='1'");
            lblVerifyRoutine.Text = lblVerifyRoutine.Text.Replace("id='tblRoutineDisplayTeacher'", "border='1'");
            //lblVerifyRoutine.Text = //getRoutineText(0,0);
        }

        loadHistory(student);
    }
Beispiel #11
0
 private void loadRoutine()
 {
     try
     {
         STD_RoutineTime routineTime = new STD_RoutineTime();
         routineTime.RoomID = 0;
         routineTime.ClassID = 0;
         routineTime.SubjectID = 0;
         routineTime.EmployeeID = "";
         string StudentID = hfStudentID.Value == "0" ? "" : hfStudentID.Value;
         lblRoutineDisplayForStudent.Text = STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID);
     }
     catch (Exception ex)
     { }
 }
Beispiel #12
0
 public static STD_RoutineTime GetSTD_ClassDayByClassDayID(int ClassDayID)
 {
     STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     sTD_RoutineTime = sqlSTD_RoutineTimeProvider.GetSTD_RoutineTimeByClassDayID(ClassDayID);
     return sTD_RoutineTime;
 }
 private void loadRoutine()
 {
     STD_RoutineTime routineTime = new STD_RoutineTime();
     routineTime.RoomID = 0;
     routineTime.RoutineID = ddlCampus.SelectedValue == "0" ? 0 : int.Parse(ddlRoutineID.SelectedValue);
     routineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
     routineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
     routineTime.EmployeeID = ddlEmployeeID.SelectedValue == "0" ? "" : ddlEmployeeID.SelectedValue;
     string StudentID = "";
     lblRoutineDisplay.Text = STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID).Replace(" style='display:none;'", "");
 }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            lblMessage.Text= varifyConfict();
            if (lblMessage.Text != "")
                return;

            STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();

            sTD_RoutineTime.RoutineTimeName = "(" + ddlSubjectID.SelectedItem.Text.Split('(')[0] + ")(" + ddlClassID.SelectedItem.Text + ")(" + ddlEmployeeID.SelectedItem.Text + ")(" + ddlRoomID.SelectedItem.Text.Split('(')[0] + ")";
            sTD_RoutineTime.RoomID = int.Parse(ddlRoomID.SelectedValue);
            sTD_RoutineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
            sTD_RoutineTime.EmployeeID = ddlEmployeeID.SelectedValue;
            sTD_RoutineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
            //sTD_RoutineTime.ClassDayID = int.Parse(ddlClassDayID.SelectedValue);
            //sTD_RoutineTime.ClassTimeID = int.Parse(ddlClassTimeID.SelectedValue);
            sTD_RoutineTime.RoutineID = int.Parse(ddlRoutineID.SelectedValue);
            sTD_RoutineTime.AddedBy = Profile.card_id;
            sTD_RoutineTime.AddedDate = DateTime.Now;
            sTD_RoutineTime.UpdatedBy = Profile.card_id;
            sTD_RoutineTime.UpdateDate = DateTime.Now;

            int resutl = 0;
            foreach (GridViewRow row in gvClassDay.Rows)
            {
                Label lblDayID = (Label)row.FindControl("lblDayID");
                HiddenField hfDayID = (HiddenField)row.FindControl("hfDayID");
                DataList dlTime = (DataList)row.FindControl("dlTime");

                foreach (DataListItem iteam in dlTime.Items)
                {
                    HiddenField hfClassTimeID = (HiddenField)iteam.FindControl("hfClassTimeID");
                    CheckBox chkTime = (CheckBox)iteam.FindControl("chkTime");

                    if (chkTime.Checked)
                    {
                        sTD_RoutineTime.ClassTimeID = int.Parse(hfClassTimeID.Value);
                        sTD_RoutineTime.ClassDayID = int.Parse(hfDayID.Value);
                        try
                        {
                           resutl = STD_RoutineTimeManager.InsertSTD_RoutineTime(sTD_RoutineTime);
                        }
                        catch (Exception ex)
                        { }
                    }
                }

                //CheckBoxList chkClassTime = (CheckBoxList)row.FindControl("chkClassTime");

                //string routineTime = "";
                //foreach (ListItem item in chkClassTime.Items)
                //{
                //    routineTime += item.Value + ",";
                //}
                //string[] spTime = routineTime.Split(',');

                //for (int i = 0; i < spTime.Length; i++)
                //{
                //    sTD_RoutineTime.ClassTimeID = Convert.ToInt32(spTime[i]);
                //    sTD_RoutineTime.ClassDayID = Convert.ToInt32(lblDayID.Text);

                //    int resutl = STD_RoutineTimeManager.InsertSTD_RoutineTime(sTD_RoutineTime);

                //    if (resutl == 0)
                //        lblMessage.Text = "Entry already exists for the time";
                //}
            }

            //int resutl = STD_RoutineTimeManager.InsertSTD_RoutineTime(sTD_RoutineTime);

            //if (resutl == 0)
            //    lblMessage.Text = "Entry already exists for the time";
            //else

            loadRoutine();
            btnAdd.Visible = false;
            //btnLoadDaynTime_Click(this, new EventArgs());

            //Response.Redirect("Class_Display_RoutineTime_ByValues.aspx?IsDelete=0&CampusID=" + ddlCampus.SelectedValue + "&RoutineID=" + ddlRoutineID.SelectedValue + "&ClassID=" + ddlClassID.SelectedValue + "&SubjectID=" + ddlSubjectID.SelectedValue + "&EmployeeID=" + ddlEmployeeID.SelectedValue );
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();

            sTD_RoutineTime.RoutineTimeName = txtRoutineTimeName.Text;
            sTD_RoutineTime.RoomID = int.Parse(ddlRoomID.SelectedValue);
            sTD_RoutineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
            sTD_RoutineTime.EmployeeID = ddlEmployeeID.SelectedValue;
            sTD_RoutineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
            //sTD_RoutineTime.ClassDayID = int.Parse(ddlClassDayID.SelectedValue);
            //sTD_RoutineTime.ClassTimeID = int.Parse(ddlClassTimeID.SelectedValue);
            sTD_RoutineTime.RoutineID = int.Parse(ddlRoutineID.SelectedValue);
            sTD_RoutineTime.AddedBy = Profile.card_id;
            sTD_RoutineTime.AddedDate = DateTime.Now;
            sTD_RoutineTime.UpdatedBy = Profile.card_id;
            sTD_RoutineTime.UpdateDate = DateTime.Now;

            foreach (GridView row in gvClassDay.Rows)
            {
                Label lblDayID = (Label)row.FindControl("lblDayID");
                CheckBoxList chkClassTime = (CheckBoxList)row.FindControl("chkClassTime");
                string routineTime = "";
                foreach (ListItem item in chkClassTime.Items)
                {
                    routineTime += item.Value + ",";
                }
                string[] spTime = routineTime.Split(',');

                for (int i = 0; i < spTime.Length; i++)
                {
                    sTD_RoutineTime.ClassTimeID = Convert.ToInt32(spTime[i]);
                    sTD_RoutineTime.ClassDayID = Convert.ToInt32(lblDayID.Text);

                    int resutl = STD_RoutineTimeManager.InsertSTD_RoutineTime(sTD_RoutineTime);

                    if (resutl == 0)
                        lblMessage.Text = "Entry already exists for the time";
                }
            }

            //string routineTime = "";

            //foreach (ListItem item in chkClassTime.Items)
            //{
            //    if (item.Selected)
            //        routineTime += item.Value + ",";
            //}

            //int resutl = STD_RoutineTimeManager.InsertSTD_RoutineTime(sTD_RoutineTime);

            //if (resutl == 0)
            //    lblMessage.Text = "Entry already exists for the time";
            //else
            //    Response.Redirect("AdminDisplaySTD_RoutineTime.aspx");
        }
        catch (Exception ex)
        {
        }
    }
Beispiel #16
0
 public static bool UpdateSTD_RoutineTime(STD_RoutineTime sTD_RoutineTime)
 {
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     return sqlSTD_RoutineTimeProvider.UpdateSTD_RoutineTime(sTD_RoutineTime);
 }
Beispiel #17
0
 public static DataSet STD_SearchRoutineTimeForRoutineCheck(STD_RoutineTime routineTime, string studentID)
 {
     DataSet sTD_RoutineTimes = new DataSet();
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     sTD_RoutineTimes = sqlSTD_RoutineTimeProvider.STD_SearchRoutineTimeForRoutineCheck(routineTime, studentID);
     return sTD_RoutineTimes;
 }
Beispiel #18
0
 public static int InsertSTD_RoutineTime(STD_RoutineTime sTD_RoutineTime)
 {
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     return sqlSTD_RoutineTimeProvider.InsertSTD_RoutineTime(sTD_RoutineTime);
 }
Beispiel #19
0
 public static STD_RoutineTime GetSTD_SubjectBySubjectID(int SubjectID)
 {
     STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     sTD_RoutineTime = sqlSTD_RoutineTimeProvider.GetSTD_RoutineTimeBySubjectID(SubjectID);
     return sTD_RoutineTime;
 }
Beispiel #20
0
 public static STD_RoutineTime GetSTD_RoutineTimeByRoutineTimeID(int RoutineTimeID)
 {
     STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     sTD_RoutineTime = sqlSTD_RoutineTimeProvider.GetSTD_RoutineTimeByRoutineTimeID(RoutineTimeID);
     return sTD_RoutineTime;
 }
Beispiel #21
0
 public static STD_RoutineTime GetSTD_EmployeeByEmployeeID(string EmployeeID)
 {
     STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();
     SqlSTD_RoutineTimeProvider sqlSTD_RoutineTimeProvider = new SqlSTD_RoutineTimeProvider();
     sTD_RoutineTime = sqlSTD_RoutineTimeProvider.GetSTD_RoutineTimeByEmployeeID(EmployeeID);
     return sTD_RoutineTime;
 }
Beispiel #22
0
    public STD_RoutineTime GetSTD_RoutineTimeFromReader(IDataReader reader)
    {
        try
        {
            STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime
                (

                     DataAccessObject.IsNULL<int>(reader["RoutineTimeID"]),
                     DataAccessObject.IsNULL<string>(reader["RoutineTimeName"]),
                     DataAccessObject.IsNULL<int>(reader["RoomID"]),
                     DataAccessObject.IsNULL<int>(reader["SubjectID"]),
                     DataAccessObject.IsNULL<string>(reader["EmployeeID"].ToString()),
                     DataAccessObject.IsNULL<int>(reader["ClassID"]),
                     DataAccessObject.IsNULL<int>(reader["ClassDayID"]),
                     DataAccessObject.IsNULL<int>(reader["ClassTimeID"]),
                     DataAccessObject.IsNULL<int>(reader["RoutineID"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["UpdateDate"])
                );
             return sTD_RoutineTime;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Beispiel #23
0
    private void BindDayIDTimeIDPair()
    {
        string dayIDTimeIDPair = ";";

        STD_RoutineTime routineTime = new STD_RoutineTime();
        routineTime.RoomID = int.Parse(ddlRoomID.SelectedValue);
        routineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
        routineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
        routineTime.EmployeeID = ddlEmployeeID.SelectedValue;

        DataSet dsRoomEmployeeClass = STD_RoutineTimeManager.STD_SearchRoutineTimeForRoutineCheck(routineTime, "");
        foreach (DataRow dr in dsRoomEmployeeClass.Tables[0].Rows)// table[0] == for Room
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }

            }
            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "R" + dr["RoutineTimeID"].ToString());
        }
        lblHaveClassInHour.Text = "0";
        lblTotalNoOfClasses.Text = dsRoomEmployeeClass.Tables[1].Rows.Count.ToString();
        foreach (DataRow dr in dsRoomEmployeeClass.Tables[1].Rows) // table[1] == Employee
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }
            }

            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "T" + dr["RoutineTimeID"].ToString());
            lblHaveClassInHour.Text = (decimal.Parse(lblHaveClassInHour.Text) + decimal.Parse(dr["Duration"].ToString())).ToString();
        }

        lblHaveClassInHour.Text = (decimal.Parse(lblHaveClassInHour.Text) / 60).ToString("0") + " : " + (decimal.Parse(lblHaveClassInHour.Text) % 60).ToString();

        foreach (DataRow dr in dsRoomEmployeeClass.Tables[2].Rows) //table[2] == Class
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }
            }

            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "C" + dr["RoutineTimeID"].ToString());

        }

        //foreach (DataRow dr in dsRoomEmployeeClass.Tables[3].Rows) //table[3] == other Classes and subjects of those student who are also member of other classes
        //{
        //    for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
        //    {
        //        //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
        //        //{
        //        //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
        //        //}
        //        if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
        //        {
        //            dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
        //        }
        //    }

        //    fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
        //    fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "C" + dr["RoutineTimeID"].ToString());

        //}

        //if (dsRoomEmployeeClass.Tables[4].Rows.Count == 0)
        //{
        btnDeleteClassSubject.Visible = false;
        btnDeleteFromSelectedClass.Visible = false;
        btnPassClassSubject.Visible = false;
        //}
        //else
        //{
        //    btnDeleteClassSubject.Visible = true;
        //    btnDeleteFromSelectedClass.Visible = true;
        //    btnPassClassSubject.Visible = true;
        //}

        //gvListOfStudentsWhohaveClassesInOtherThanSelectClass.DataSource = dsRoomEmployeeClass.Tables[4];
        //gvListOfStudentsWhohaveClassesInOtherThanSelectClass.DataBind();
        hfDayIDTimeIDPair.Value = dayIDTimeIDPair;
    }
Beispiel #24
0
 private void showSTD_RoutineTimeData()
 {
     STD_RoutineTime sTD_RoutineTime  = new STD_RoutineTime ();
      	sTD_RoutineTime = STD_RoutineTimeManager.GetSTD_RoutineTimeByRoutineTimeID(Int32.Parse(Request.QueryString["ID"]));
      	//txtRoutineTimeName.Text =sTD_RoutineTime.RoutineTimeName.ToString();
      	ddlRoomID.SelectedValue  =sTD_RoutineTime.RoomID.ToString();
     //ddlSubjectID.SelectedValue  =sTD_RoutineTime.SubjectID.ToString();
     //ddlEmployeeID.SelectedValue  =sTD_RoutineTime.EmployeeID.ToString();
     //ddlClassID.SelectedValue  =sTD_RoutineTime.ClassID.ToString();
      	ddlClassDayID.SelectedValue  =sTD_RoutineTime.ClassDayID.ToString();
      	ddlClassTimeID.SelectedValue  =sTD_RoutineTime.ClassTimeID.ToString();
      	ddlRoutineID.SelectedValue  =sTD_RoutineTime.RoutineID.ToString();
 }
Beispiel #25
0
    public bool UpdateSTD_RoutineTime(STD_RoutineTime sTD_RoutineTime)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateSTD_RoutineTime", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@RoutineTimeID", SqlDbType.Int).Value = sTD_RoutineTime.RoutineTimeID;
            cmd.Parameters.Add("@RoutineTimeName", SqlDbType.NVarChar).Value = sTD_RoutineTime.RoutineTimeName;
            cmd.Parameters.Add("@RoomID", SqlDbType.Int).Value = sTD_RoutineTime.RoomID;
            cmd.Parameters.Add("@SubjectID", SqlDbType.Int).Value = sTD_RoutineTime.SubjectID;
            cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar).Value = sTD_RoutineTime.EmployeeID;
            cmd.Parameters.Add("@ClassID", SqlDbType.Int).Value = sTD_RoutineTime.ClassID;
            cmd.Parameters.Add("@ClassDayID", SqlDbType.Int).Value = sTD_RoutineTime.ClassDayID;
            cmd.Parameters.Add("@ClassTimeID", SqlDbType.Int).Value = sTD_RoutineTime.ClassTimeID;
            cmd.Parameters.Add("@RoutineID", SqlDbType.Int).Value = sTD_RoutineTime.RoutineID;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = sTD_RoutineTime.UpdatedBy;
            cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = sTD_RoutineTime.UpdateDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Beispiel #26
0
 public DataSet STD_SearchRoutineTimeForRoutineCheck(STD_RoutineTime routineTime, string studentID)
 {
     DataSet ds = new DataSet();
     using (SqlConnection connection = new SqlConnection(this.ConnectionString))
     {
         using (SqlCommand command = new SqlCommand("STD_SearchRoutineTimeForRoutineCheck", connection))
         {
             command.CommandType = CommandType.StoredProcedure;
             command.Parameters.AddWithValue("@ClassID", routineTime.ClassID);
             command.Parameters.AddWithValue("@RoomID", routineTime.RoomID);
             command.Parameters.AddWithValue("@SubjectID", routineTime.SubjectID);
             command.Parameters.AddWithValue("@StudentID", studentID);
             command.Parameters.AddWithValue("@EmployeeID", routineTime.EmployeeID);
             connection.Open();
             SqlDataAdapter myadapter = new SqlDataAdapter(command);
             myadapter.Fill(ds);
             myadapter.Dispose();
             connection.Close();
             return ds;
         }
     }
 }
    private void BindDayIDTimeIDPair()
    {
        string dayIDTimeIDPair = ";";

        STD_RoutineTime routineTime = new STD_RoutineTime();
        routineTime.RoomID = int.Parse(ddlRoomID.SelectedValue);
        routineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
        routineTime.ClassID = int.Parse(ddlClassID.SelectedValue);
        routineTime.EmployeeID = ddlEmployeeID.SelectedValue;

        DataSet dsRoomEmployeeClass= STD_RoutineTimeManager.STD_SearchRoutineTimeForRoutineCheck(routineTime,"");
        foreach (DataRow dr in dsRoomEmployeeClass.Tables[0].Rows)// table[0] == for Room
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }

            }
            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "R" + dr["RoutineTimeID"].ToString());
        }
        lblHaveClassInHour.Text  = "0";
        lblTotalNoOfClasses.Text = dsRoomEmployeeClass.Tables[1].Rows.Count.ToString();
        foreach (DataRow dr in dsRoomEmployeeClass.Tables[1].Rows) // table[1] == Employee
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }
            }

            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "T" + dr["RoutineTimeID"].ToString());
            lblHaveClassInHour.Text = (decimal.Parse(lblHaveClassInHour.Text) + decimal.Parse(dr["Duration"].ToString())).ToString();
        }

        lblHaveClassInHour.Text = (decimal.Parse(lblHaveClassInHour.Text) / 60).ToString("0") + " : " + (decimal.Parse(lblHaveClassInHour.Text) % 60).ToString();

        foreach (DataRow dr in dsRoomEmployeeClass.Tables[2].Rows) //table[2] == Class
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }
            }

            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "C" + dr["RoutineTimeID"].ToString());

        }

        foreach (DataRow dr in dsRoomEmployeeClass.Tables[3].Rows) //table[2] == other Classes
        {
            for (int i = int.Parse(dr["ExtraField1"].ToString()); i <= int.Parse(dr["ExtraField2"].ToString()); i++)
            {
                //if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";"))
                //{
                //    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString() + ";";
                //}
                if (!dayIDTimeIDPair.Contains(";" + dr["ClassDayID"].ToString() + "-" + i.ToString() + ";"))
                {
                    dayIDTimeIDPair += dr["ClassDayID"].ToString() + "-" + i.ToString() + ";";
                }
            }

            fillddlForRoutine(dr["RoutineTimeID"].ToString(), getClassName(dr));
            fillddl(dr["ClassDayID"].ToString() + "-" + dr["ClassTimeID"].ToString(), "C" + dr["RoutineTimeID"].ToString());

        }

        hfDayIDTimeIDPair.Value= dayIDTimeIDPair;
    }
Beispiel #28
0
 protected void ddlClassID_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     //loadClass();
     try
     {
         STD_RoutineTime routineTime = new STD_RoutineTime();
         routineTime.RoomID = 0;
         routineTime.ClassID = int.Parse(ddlClassID.SelectedValue.Split('-')[1]);
         routineTime.SubjectID = int.Parse(ddlSubjectID.SelectedValue);
         routineTime.EmployeeID = "";
         string StudentID = "";
         lblRoutineDisplayForSelectedClassNSubject.Text = STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID);
     }
     catch (Exception ex)
     { }
 }
    private void showSTD_RoutineTimeData()
    {
        try
        {

            STD_RoutineTime sTD_RoutineTime = new STD_RoutineTime();
            sTD_RoutineTime = STD_RoutineTimeManager.GetSTD_RoutineTimeByRoutineTimeID(Int32.Parse(Request.QueryString["ID"]));
            txtRoutineTimeName.Text = sTD_RoutineTime.RoutineTimeName.ToString();
            //RoomIDLoad();
            //SubjectIDLoad();
            //EmployeeIDLoad();
            ddlRoomID.SelectedValue = sTD_RoutineTime.RoomID.ToString();
            ddlClassID.SelectedValue = sTD_RoutineTime.ClassID.ToString();
            ddlClassID_SelectedIndexChanged(this, new EventArgs());

            ddlSubjectID.SelectedValue = sTD_RoutineTime.SubjectID.ToString();
            ddlSubjectID_SelectedIndexChanged(this, new EventArgs());

            ddlEmployeeID.SelectedValue = sTD_RoutineTime.EmployeeID.ToString();

            //ddlClassDayID.SelectedValue = sTD_RoutineTime.ClassDayID.ToString();
            //ddlClassTimeID.SelectedValue = sTD_RoutineTime.ClassTimeID.ToString();
            //ddlRoutineID.SelectedValue = sTD_RoutineTime.RoutineID.ToString();
        }
        catch (Exception ex)
        {
        }
    }
Beispiel #30
0
    public static String getRoutineTextDayTop(STD_RoutineTime routineTime, string StudentID)
    {
        try
        {
            DataSet dsRoutineTime = STD_RoutineTimeManager.STD_SearchRoutineTime(routineTime, StudentID);

            DataSet dsClassTime = STD_ClassTimeManager.GetAllSTD_ClassTimes();
            DataSet dsClassDay = STD_ClassDayManager.GetAllSTD_ClassDaies();
            int width = 120;
            int widthDay = 70;
            string routine = "";
            if (dsRoutineTime.Tables[1].Rows.Count > 0)
            {
                if (routineTime.RoutineID != 0)
                {
                    routine += "<br/><b>Campus :</b> " + dsRoutineTime.Tables[1].Rows[0]["CampusName"];
                }

                if (routineTime.RoomID != 0)
                {
                    routine += "<br/><b>Room :</b> " + dsRoutineTime.Tables[1].Rows[0]["RoomName"];
                }

                if (routineTime.ClassID != 0)
                {
                    routine += "<br/><b>Batch :</b> " + dsRoutineTime.Tables[1].Rows[0]["ClassName"];
                }

                if (routineTime.SubjectID != 0)
                {
                    routine += "<br/><b>Subject :</b> " + dsRoutineTime.Tables[1].Rows[0]["SubjectName"];
                }

                if (routineTime.EmployeeID != "")
                {
                    routine += "<br/><b>Teacher :</b> " + dsRoutineTime.Tables[1].Rows[0]["EmployeeName"];
                }
            }

            routine += "<table id='tblRoutineDisplay'  style='font-size:10px;'>";
            //string routine = "<table id='tblRoutineDisplay'  style='font-size:10px;width:" + ((dsClassTime.Tables[0].Rows.Count * width) + widthDay).ToString() + "px'>";
            string classTimeGroupID = dsClassTime.Tables[0].Rows[0]["ClassTimeGroupID"].ToString();
            bool lastSetEmpty = false;

            string daysNameRow = "";
            for (int row = 0; row < dsClassTime.Tables[0].Rows.Count; row++)
            {
                if (classTimeGroupID != dsClassTime.Tables[0].Rows[row]["ClassTimeGroupID"].ToString())
                {
                    if (!lastSetEmpty)
                    {
                        routine = routine.Replace("<tr><td style='color:white;' colspan='" + (dsClassDay.Tables[0].Rows.Count + 1) + "'>&nbsp;</br>" + classTimeGroupID + "</td></tr>", "");
                    }

                    routine += "<tr><td style='color:white;' colspan='" + (dsClassDay.Tables[0].Rows.Count + 1) + "'>&nbsp;</br>" + dsClassTime.Tables[0].Rows[row]["ClassTimeGroupID"].ToString() + "</td></tr>";

                    //routine += "<tr><td colspan='" + (dsClassDay.Tables[0].Rows.Count + 1) + "'>&nbsp;</td></tr>";
                    classTimeGroupID = dsClassTime.Tables[0].Rows[row]["ClassTimeGroupID"].ToString();
                    lastSetEmpty = false;
                }

                if (row == 0)
                {
                    daysNameRow += "<tr><td></td>";

                    for (int col = 0; col < dsClassDay.Tables[0].Rows.Count; col++)
                    {
                        daysNameRow += "<td>";
                        daysNameRow += dsClassDay.Tables[0].Rows[col]["ClassDayName"].ToString();
                        daysNameRow += "</td>";
                    }

                    daysNameRow += "</tr>";
                    routine += daysNameRow;
                }
                string tmp = "";
                bool needtoAdd = false;

                tmp += "<tr>";
                for (int col = 0; col < dsClassDay.Tables[0].Rows.Count; col++)
                {
                    if (col == 0)
                    {
                        //routine += "<td valign='top' style='min-width:" + widthDay + "px'>";
                        tmp += "<td valign='top'>";
                        tmp += dsClassTime.Tables[0].Rows[row]["ClassTimeName"].ToString();
                        tmp += "</td>";
                    }

                    //routine += "<td valign='top' style='min-width:" + width + "px;'>";
                    tmp += "<td valign='top' >";
                    string tmp1 = GetClassName(routineTime, dsRoutineTime, dsClassTime.Tables[0].Rows[row]["ClassTimeID"].ToString(), dsClassDay.Tables[0].Rows[col]["ClassDayID"].ToString());

                    if (tmp1 != "")
                    {
                        tmp += tmp1;
                        needtoAdd = true;

                    }

                    tmp += "</td>";
                }
                tmp += "</tr>";

                if (needtoAdd)
                {
                    routine += tmp;
                    lastSetEmpty = true;
                }
            }

            if (!lastSetEmpty)
            {
                routine = routine.Replace("<tr><td style='color:white;' colspan='" + (dsClassDay.Tables[0].Rows.Count + 1) + "'>&nbsp;</br></br></br>" + classTimeGroupID + "</td></tr>", "");
            }
            routine += daysNameRow;
            routine += "</table>";

            routine += GetTeacherName(dsRoutineTime);
            return routine;

        }
        catch (Exception ex)
        {
            return "";
        }
    }