Esempio n. 1
0
        public DataTable GetProfessorListByDepartment_Term(string tterm, int DepartmentCode)
        {
            ProfPresentDAO ProfDAO = new ProfPresentDAO();
            // گرفتن لیست اساتید براساس ترم و دپارتمان
            DataTable DTProf_Sida = new DataTable();

            DTProf_Sida = ProfDAO.GetProfessorListByDepartment_Term(DepartmentCode, tterm);// Get ProfList By Departmenet And Term
            DataTable DTProfMeetings = ProfDAO.R_TeacherTotalTimeinMeetingsListByClassListAndTerm(DTProf_Sida, tterm);

            return(DTProfMeetings);
        }
Esempio n. 2
0
        //StuPresentDAO StuDAO = new StuPresentDAO();

        public List <string> GetAllDepartment()
        {
            ProfPresentDAO ProfDAO  = new ProfPresentDAO();
            DataTable      DT       = ProfDAO.GetAllDepartment();
            List <string>  TermList = new List <string>();

            for (int i = 0; i < DT.Rows.Count; i++)
            {
                TermList.Add(DT.Rows[i]["Department"].ToString());
            }

            return(TermList);
        }
Esempio n. 3
0
        public DataTable SortedDataTableBothServer(string tterm, string Department)
        {
            ProfPresentDAO ProfDAO = new ProfPresentDAO();
            // گرفتن لیست اساتید براساس ترم و دپارتمان
            DataTable DTProf_Sida = new DataTable();

            DTProf_Sida = ProfDAO.GetProfessorListByDepartment_Term(Department, tterm);// Get ProfList By Departmenet And Term

            // Adobe آماده کردن داده ها (کد استاد و کد درس) جهت ارسال به
            DataTable tvp = new DataTable();//Array List

            tvp.Columns.Add("ProfID", typeof(String));
            tvp.Columns.Add("ClassID", typeof(String));
            DataRow workRow;

            for (int i = 0; i < DTProf_Sida.Rows.Count; i++)
            {
                //Get Data that Need in Adobe for Give Prof Info
                workRow    = tvp.NewRow();
                workRow[0] = "ins" + DTProf_Sida.Rows[i]["code_ostad"].ToString();
                workRow[1] = DTProf_Sida.Rows[i]["did"].ToString();
                tvp.Rows.Add(workRow);
            }

            DataTable DT1 = ProfDAO.GetProfessorTimeByArrayList(tvp);



            //DataTable DT1 = new DataTable();
            //DataTable DT0 = new DataTable();

            ////if (tterm == "93-94-1")
            ////{
            ////    DT1 = GivaAll(Department);
            ////    DT0 = GivaAll_OLD(Department);
            ////    foreach (DataRow dr in DT0.Rows)
            ////        DT1.Rows.Add(dr.ItemArray);
            ////}
            ////else
            ////    DT1 = GivaAll93942(Department);

            DataTable DT11 = new DataTable();

            DT11.Columns.Add("Department", typeof(string));
            DT11.Columns.Add("GroupName", typeof(string));
            DT11.Columns.Add("LOGIN", typeof(string));
            DT11.Columns.Add("TeacherName", typeof(string));
            DT11.Columns.Add("code", typeof(int));
            DT11.Columns.Add("LessonName", typeof(string));
            DT11.Columns.Add("PersianDate", typeof(string));
            DT11.Columns.Add("SumOfTime", typeof(string));
            DT11.Columns.Add("TimeClass", typeof(string));
            DT11.Columns.Add("TimeStart", typeof(string));
            DT11.Columns.Add("TimeEnd", typeof(string));
            DT11.Columns.Add("FirstLogin", typeof(string));
            DT11.Columns.Add("LastLogOut", typeof(string));
            DT11.Columns.Add("Hozoor", typeof(string));
            DT11.Columns.Add("NAME", typeof(string));
            DT11.Columns.Add("tterm", typeof(string));

            for (int i = 0; i < DTProf_Sida.Rows.Count; i++)
            {
                for (int j = 0; j < DT1.Rows.Count; j++)// را یکی میکند Adobe اطلاعات دریافت شده از
                {
                    if (DTProf_Sida.Rows[i]["Code"].ToString() == DT1.Rows[j]["NAME"].ToString())
                    {
                        DataRow row = DT11.NewRow();
                        row["Department"]  = DTProf_Sida.Rows[i]["Department"].ToString();
                        row["GroupName"]   = DTProf_Sida.Rows[i]["namegroup"].ToString();
                        row["LessonName"]  = DTProf_Sida.Rows[i]["namedars"].ToString();
                        row["LOGIN"]       = DT1.Rows[j]["LOGIN"].ToString();
                        row["TeacherName"] = DT1.Rows[j]["TeacherName"].ToString();
                        row["PersianDate"] = DT1.Rows[j]["PersianDate"].ToString();
                        row["SumOfTime"]   = DT1.Rows[j]["SumOfTime"].ToString();
                        row["FirstLogin"]  = DT1.Rows[j]["FirstLogin"].ToString();
                        row["LastLogOut"]  = DT1.Rows[j]["LastLogOut"].ToString();
                        row["code"]        = DTProf_Sida.Rows[i]["did"].ToString();
                        row["TimeClass"]   = DTProf_Sida.Rows[i]["TimeClass"].ToString();
                        row["TimeStart"]   = DTProf_Sida.Rows[i]["saatstart"].ToString();
                        row["TimeEnd"]     = DTProf_Sida.Rows[i]["saatend"].ToString();
                        row["tterm"]       = tterm;
                        int HozorCheck = 0;
                        if (DT1.Rows[j]["SumOfTime"].ToString() != "")
                        {
                            HozorCheck = int.Parse(DT1.Rows[j]["SumOfTime"].ToString());
                        }

                        int TimeClassCheck = 0;
                        if (DTProf_Sida.Rows[i]["TimeClass"].ToString() != "")
                        {
                            TimeClassCheck = int.Parse(DTProf_Sida.Rows[i]["TimeClass"].ToString());
                        }

                        if (HozorCheck > TimeClassCheck)
                        {
                            row["Hozoor"] = "1";
                        }
                        else
                        {
                            row["Hozoor"] = "0";
                        }
                        DT11.Rows.Add(row);
                    }
                }
            }

            DataView dv = DT11.DefaultView;

            dv.Sort = "code";
            DataTable sortedDT = dv.ToTable();

            int testRows1 = sortedDT.Rows.Count;
            int testRows2 = DTProf_Sida.Rows.Count;
            int testRows3 = DT1.Rows.Count;

            return(sortedDT);
        }