Esempio n. 1
0
        public void addLeaveToDB(LeaveApplicationDA leaveObj)
        {
            string query = "";

            try
            {
                query            = XMLreader.readXMLtxt("addLeave", "~/DATA/XML/LeaveXML.xml");
                leaveObj.leaveID = getLeaveId(teacherID).ToString();

                query = query.Replace("@TEACHER_ID", leaveObj.teacherID);
                query = query.Replace("@LEAVE_ID", leaveObj.leaveID.ToString());
                query = query.Replace("@START_DATE", leaveObj.startDate.ToString("yyyy/M/d"));
                query = query.Replace("@END_DATE", leaveObj.endDate.ToString("yyyy/M/d"));
                query = query.Replace("@DURATION", leaveObj.duration.ToString());
                query = query.Replace("@REASON", leaveObj.reason);
                query = query.Replace("@STATUS", leaveObj.status.ToString());
                query = query.Replace("@LEAVE_TYPE_ID", leaveObj.leaveTypeId);
                query = query.Replace("@LEAVE_CATEGORY_ID", leaveObj.leaveCategoryId);
                query = query.Replace("@ABSENT_TIME_PERIOD", leaveObj.absentTimePeriod);

                srv.Modify(query);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        // should be in leave app list
        public string countAvailableAndPendingLeaves(string teacherID)
        {
            string    numOfLeaves = "";
            DataTable dataTable   = new DataTable();

            try
            {
                query     = XMLreader.readXMLtxt("countAvailablePendingLeaves", "~/DATA/XML/LeaveXML.xml");
                query     = query.Replace("@TEACHERID", teacherID);
                dataTable = srv.Search(query);

                for (int i = 0; i < 6; i++)
                {
                    if (dataTable.Rows[0][i].ToString() == "null" || dataTable.Rows[0][i].ToString() == "")
                    {
                        if (i == 0)
                        {
                            numOfLeaves = maxLeaves("maxCas").ToString();
                        }
                        else if (i == 1)
                        {
                            numOfLeaves = numOfLeaves + "," + maxLeaves("maxMedi").ToString();
                        }
                        else
                        {
                            numOfLeaves = numOfLeaves + "," + "0";
                        }
                    }
                    else
                    {
                        if (i == 0)
                        {
                            numOfLeaves = (maxLeaves("maxCas") - Double.Parse(dataTable.Rows[0][i].ToString())).ToString();
                        }
                        else if (i == 1)
                        {
                            numOfLeaves = numOfLeaves + "," + (maxLeaves("maxMedi") - Double.Parse(dataTable.Rows[0][i].ToString())).ToString();
                        }
                        else
                        {
                            numOfLeaves = numOfLeaves + "," + dataTable.Rows[0][i].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(numOfLeaves);
        }
Esempio n. 3
0
        public DataTable absentTeachersWed()
        {
            string query = "";

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

                query = XMLReader.readXMLtxt("absentTeachers", "~/DATA/XML/substituteXML.xml");
                query = query.Replace("@from", "17");
                query = query.Replace("@to", "24");
                query = query.Replace("@a", "21");
                query = query.Replace("@b", "24");
                query = query.Replace("@c", "17");
                query = query.Replace("@d", "20");


                dt = srv.Search(query);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(dt);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
        public DataTable distinctPresntFri()
        {
            string query = "";

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

                query = XMLReader.readXMLtxt("distictpresentTchrs", "~/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");

                dt = srv.Search(query);
            }
            catch (Exception exc)
            {
                throw exc;
            }
            return(dt);
        }
Esempio n. 7
0
        public DataTable distinctPresntMon()
        {
            string query = "";

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

                query = XMLReader.readXMLtxt("distictpresentTchrs", "~/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");


                dt = srv.Search(query);//return the teacher_id of present teachers
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
        // should be in leave app list
        public DataTable loadLeavesToVPrincipal()
        {
            srv       = new smss_web_service_app();
            XMLreader = new readXML();
            DataTable dt;
            string    query;

            try
            {
                query = XMLreader.readXMLtxt("loadRequestedLeavesToVPrincipal", "~/DATA/XML/LeaveXML.xml");
                dt    = srv.Search(query);
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        // should be in leave app list
        public DataTable loadTeacherLeaves(string teacherId)
        {
            srv       = new smss_web_service_app();
            XMLreader = new readXML();
            DataTable dt;
            string    query;

            try
            {
                query = XMLreader.readXMLtxt("loadTeacherRequestedLeaves", "~/DATA/XML/LeaveXML.xml");
                query = query.Replace("@teacherID", teacherId);

                dt = srv.Search(query);
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
        //handle dataflow between database for sending mails
        public DataTable loadReceiverMailAndPassword(userCLZ objUser)
        {
            string query = "";

            try
            {
                srv       = new smss_web_service_app();
                XMLreader = new readXML();
                query     = XMLreader.readXMLtxt("getReceiverMailAndPassword", "~/DATA/XML/homeXML.xml");

                query = query.Replace("@username", objUser.user_name);

                dt = srv.Search(query);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Esempio n. 11
0
        public bool validateLeaveRequestedEarlier(DateTime requestingDate, string teacherId)
        {
            try
            {
                query = XMLreader.readXMLtxt("checkHalfShortLeaveRequestedEarlier", "~/DATA/XML/LeaveXML.xml");
                query = query.Replace("@TEACHER_ID", teacherId);
                query = query.Replace("@REQUESTING_DATE", requestingDate.Date.ToString("yyyy/M/d"));

                leaveTable = srv.Search(query);
                if (leaveTable.Rows.Count == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }