Beispiel #1
0
        public DataTable findTechrTTFri(substituteCLZ obj)
        {
            string query = "";

            try
            {
                srv       = new smss_web_service_app();
                XMLReader = new readXML();
                //query = readXML("presentTchsTT");
                query = XMLReader.readXMLtxt("presentTchsTT", "~/DATA/XML/substituteXML.xml");
                query = query.Replace("@from", "33");
                query = query.Replace("@to", "40");
                query = query.Replace("@a", "33");
                query = query.Replace("@b", "36");
                query = query.Replace("@c", "37");
                query = query.Replace("@d", "40");
                query = query.Replace("@e", obj.present_teacher);
                dt    = srv.Search(query);
            }
            catch (Exception exc)
            {
                throw exc;
            }
            return(dt);
        }
Beispiel #2
0
        public DataTable findTechrTTMon(substituteCLZ obj)
        {
            string query = "";

            try
            {
                srv       = new smss_web_service_app();
                XMLReader = new readXML();

                query = XMLReader.readXMLtxt("presentTchsTT", "~/DATA/XML/substituteXML.xml");
                query = query.Replace("@from", "1");
                query = query.Replace("@to", "8");
                query = query.Replace("@a", "1");
                query = query.Replace("@b", "4");
                query = query.Replace("@c", "5");
                query = query.Replace("@d", "8");
                query = query.Replace("@e", obj.present_teacher);

                dt = srv.Search(query);//return the techer_id,class_id,slot_id,subject_type_name,subject_code and leave_category_id
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Beispiel #3
0
        protected void PresentTeachrBtn_Click(object sender, EventArgs e)
        {
            substituteDA mysub2;
            {
                try
                {
                    DataTable dt2       = new DataTable();
                    string    dayofweek = System.DateTime.Now.DayOfWeek.ToString();
                    if (dayofweek == "Monday")
                    {
                        mysub2 = new substituteDA();
                        dt2    = mysub2.presentTeachersMon();
                        RadGrid2.DataSource = dt2;
                        RadGrid2.DataBind();
                    }


                    if (dayofweek == "Tuesday")
                    {
                        mysub2 = new substituteDA();
                        dt2    = mysub2.presentTeachersTues();
                        RadGrid2.DataSource = dt2;
                        RadGrid2.DataBind();
                    }

                    if (dayofweek == "Wednesday")
                    {
                        mysub2 = new substituteDA();
                        dt2    = mysub2.presentTeachersWed();
                        RadGrid2.DataSource = dt2;
                        RadGrid2.DataBind();
                    }

                    if (dayofweek == "Thursday")
                    {
                        mysub2 = new substituteDA();
                        dt2    = mysub2.presentTeachersThus();
                        RadGrid2.DataSource = dt2;
                        RadGrid2.DataBind();
                    }


                    if (dayofweek == "Friday")//select present teachers from db and they are set to display in the radgrid
                    {
                        mysub2 = new substituteDA();
                        dt2    = mysub2.presentTeachersFri();
                        substituteCLZ obj1 = new substituteCLZ();
                        RadGrid2.DataSource = dt2;
                        RadGrid2.DataBind();
                    }
                }

                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Beispiel #4
0
        protected void FreeslotsofselectedTchrsBtn_Click(object sender, EventArgs e)
        {
            string    dayofweek = System.DateTime.Now.DayOfWeek.ToString();
            DataTable dt2       = new DataTable();

            int[] myArray = new int[7];
            int   key     = 0;

            string presnt_teacher = Present_teher_Dp_dwn.SelectedValue;

            string[] pt    = presnt_teacher.Split(':');
            string   pst_T = pt[0];

            substituteCLZ obj    = new substituteCLZ(pst_T);
            substituteDA  mysub3 = new substituteDA();



            if (dayofweek == "Monday")
            {
                dt2 = mysub3.findTechrTTMon(obj);
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    int no = Convert.ToInt32(dt2.Rows[j][1]);
                    myArray[key] = no;
                    key++;
                }

                int upperlimit = 9;

                int[] b = new int[upperlimit];
                for (int i = 0; i < myArray.Length; i++)
                {
                    b[myArray[i]] = 1;
                }

                for (int k = 1; k < upperlimit; k++)
                {
                    if (b[k] == 0)
                    {
                        ListBox1.Items.Add(k.ToString());
                    }
                }
            }

            if (dayofweek == "Tuesday")
            {
                dt2 = mysub3.findTechrTTTues(obj);
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    int no = Convert.ToInt32(dt2.Rows[j][1]);
                    myArray[key] = no;
                    key++;
                }

                int upperlimit = 17;

                int[] b = new int[upperlimit];
                for (int i = 0; i < myArray.Length; i++)
                {
                    b[myArray[i]] = 1;
                }

                for (int k = 9; k < upperlimit; k++)
                {
                    if (b[k] == 0)
                    {
                        ListBox1.Items.Add(k.ToString());
                    }
                }
            }


            if (dayofweek == "Wednesday")
            {
                dt2 = mysub3.findTechrTTWedn(obj);
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    int no = Convert.ToInt32(dt2.Rows[j][1]);
                    myArray[key] = no;
                    key++;
                }

                int upperlimit = 25;

                int[] b = new int[upperlimit];
                for (int i = 0; i < myArray.Length; i++)
                {
                    b[myArray[i]] = 1;
                }

                for (int k = 17; k < upperlimit; k++)
                {
                    if (b[k] == 0)
                    {
                        ListBox1.Items.Add(k.ToString());
                    }
                }
            }

            if (dayofweek == "Thursday")
            {
                dt2 = mysub3.findTechrTTThurs(obj);
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    int no = Convert.ToInt32(dt2.Rows[j][1]);
                    myArray[key] = no;
                    key++;
                }

                int upperlimit = 33;

                int[] b = new int[upperlimit];
                for (int i = 0; i < myArray.Length; i++)
                {
                    b[myArray[i]] = 1;
                }

                for (int k = 25; k < upperlimit; k++)
                {
                    if (b[k] == 0)
                    {
                        ListBox1.Items.Add(k.ToString());
                    }
                }
            }

            if (dayofweek == "Friday")
            {
                dt2 = mysub3.findTechrTTFri(obj);
                //store all the slots of present teachers' in the myArray[] (today slots)
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    int no = Convert.ToInt32(dt2.Rows[j][1]);
                    myArray[key] = no;
                    key++;
                }

                int upperlimit = 41;

                int[] b = new int[upperlimit];
                for (int i = 0; i < myArray.Length; i++)
                {
                    b[myArray[i]] = 1;
                }

                for (int k = 33; k < upperlimit; k++)
                {
                    if (b[k] == 0)
                    {
                        ListBox1.Items.Add(k.ToString());
                    }
                }
            }
        }