Esempio n. 1
0
        private void loadSssions()
        {
            try
            {
                if (Session["LGIDforNewSession"] != null)
                {
                    var today = DateTime.Now;

                    id = Convert.ToInt32(Session["LGIDforNewSession"].ToString());

                    SessionRepository Sesrep = new SessionRepository();
                    SessionNumber.Text = Sesrep.CountSessionsByLGID(id);
                    vLessonGroupRepository vLesRep = new vLessonGroupRepository();
                    var lessonGroup = vLesRep.FindByLGID(id);
                    ClassNumber.Text = lessonGroup.Class;
                    LessonName.Text  = lessonGroup.LessonTitle;
                    Grade.Text       = vLesRep.FindByLGID(id).GradeTitle;
                    OzviatRepository ozviatRep = new OzviatRepository();
                    StudentCount.Text     = ozviatRep.StudentCountByLGID(id);
                    gvStudents.DataSource = ozviatRep.FindByLGID(id);
                    gvStudents.DataBind();
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('شما با آدرس اشتباه وارد شده اید ! ');window.location ='http://localhost:4911/Dashboard/Teacher/News.aspx'", true);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 public void loadLessonGroup()
 {
     if (Session["LGIDforStudentsFromClassManagment"] != null)
     {
         string id = Session["LGIDforStudentsFromClassManagment"].ToString();
         Session.Remove("LGIDforStudentsFromClassManagment");
         OzviatRepository rep = new OzviatRepository();
         gvClassStudents.DataSource = rep.FindByLGID(id.ToInt());
         gvClassStudents.DataBind();
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('شما با آدرس اشتباه وارد شده اید ! ');window.location ='http://localhost:4911/Dashboard/Teacher/News.aspx'", true);
     }
 }
Esempio n. 3
0
        private void loadSssions()
        {
            try
            {
                if (Session["SessionIdForSessionDetails"] != null)
                {
                    id = Convert.ToInt32(Session["SessionIdForSessionDetails"].ToString());
                    Session.Remove("SessionIdForSessionDetails");
                    Sessoin session = sr.GetSessionsBySessionID(id);
                    SessionNumber.Text = session.SessionNum.ToString();

                    int?lgid        = db.Sessoins.Where(p => p.SessionID == id).Single().LGID;
                    var lessonGroup = vLesRep.FindByLGID((int)lgid);
                    ClassNumber.Text      = lessonGroup.Class;
                    LessonName.Text       = lessonGroup.LessonTitle;
                    Grade.Text            = lessonGroup.GradeTitle;
                    tbxSessionDate.Text   = session.Date;
                    StudentCount.Text     = ozviatRep.StudentCountByLGID((int)lgid);
                    gvStudents.DataSource = ozviatRep.FindByLGID((int)lgid);
                    gvStudents.DataBind();
                    foreach (GridViewRow row in gvStudents.Rows)
                    {
                        int ozvID = row.Cells[0].Text.ToInt();
                        row.Cells[4].Text = nr.GetNomreBySessionIDandOzviatID(id, ozvID);
                        row.Cells[5].Text = ((bool)(pr.GetPreseceBySessionIDandOzviatID(id, ozvID))).ToString();
                        if (pr.GetPreseceBySessionIDandOzviatID(id, ozvID) == false)
                        {
                            row.Cells[6].Text = ((bool)(pr.GetisMovajjahBySessionIDandOzviatID(id, ozvID))).ToString();
                            row.Cells[7].Text = pr.GetDescriptionBySessionIDandOzviatID(id, ozvID);
                        }
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('شما با آدرس اشتباه وارد شده اید ! ');window.location ='http://localhost:4911/Dashboard/Teacher/News.aspx'", true);
                }
            }
            catch (Exception e)
            {
                string s = e.Message;
                throw;
            }
        }