Ejemplo n.º 1
0
        protected void RadToolBar1_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            switch (e.Item.Text)
            {
            case "Save":
                foreach (var v in _classStudentIdList)
                {
                    var cProgramClassStudent = new CProgramClassStudent();
                    var programClassStudent  = cProgramClassStudent.Get(v);
                    if (programClassStudent != null)
                    {
                        programClassStudent.ProgramClassId  = Convert.ToInt32(RadComboBoxProgramClass.SelectedValue);
                        programClassStudent.ProgramCourseId = Convert.ToInt32(RadComboBoxProgramCourse.SelectedValue);

                        programClassStudent.UpdatedId   = CurrentUserId;
                        programClassStudent.UpdatedDate = DateTime.Now;

                        cProgramClassStudent.Update(programClassStudent);
                    }
                }

                RunClientScript("Close();");
                break;
            }
        }
Ejemplo n.º 2
0
        protected void RadGridClassStudent_OnRowDrop(object sender, GridDragDropEventArgs e)
        {
            if (e.DraggedItems.Count != 0)
            {
                foreach (var dataItem in e.DraggedItems)
                {
                    var sid = dataItem.GetDataKeyValue("ProgramClassStudentId").ToString();
                    var cProgramClassStudent = new CProgramClassStudent();
                    var programClassStudent  = cProgramClassStudent.Get(Convert.ToInt32(sid));

                    var cStudent = new CStudent();
                    var student  = cStudent.Get(programClassStudent.StudentId);

                    var cProgramRegistration = new CProgramRegistration();
                    var programRegistration  = cProgramRegistration.Get(programClassStudent.ProgramRegistrationId);
                    if (programRegistration.EndDate < DateTime.Today)
                    {
                        ShowMessage("Move Failed : " + cStudent.GetStudentName(student) + "'s the End Date should not be earlier than today.");
                    }
                    else if (cProgramClassStudent.Delete(programClassStudent))
                    {
                        ShowMessage("Moved successfuly : " + cStudent.GetStudentName(student));
                    }
                }

                refreshGrid();
            }
            else
            {
                ShowMessage("Transfer Failed");
            }
        }
Ejemplo n.º 3
0
        protected void RadGridProgramStudent_OnRowDrop(object sender, GridDragDropEventArgs e)
        {
            if (e.DraggedItems.Count != 0)
            {
                foreach (var dataItem in e.DraggedItems)
                {
                    //string pid = dataItem.GetDataKeyValue("ProgramRegistrationId").ToString();
                    //var preg = new CProgramRegistration(Convert.ToInt32(pid));

                    //preg.IsTransfer = true;
                    //preg.TransferDate = DateTime.Now;
                    //preg.TransferFromId = CurrentUserId;

                    //if (preg.Update())
                    //{
                    var cProgramclassStudent = new CProgramClassStudent();
                    var programClassStudent  = new ProgramClassStudent();
                    programClassStudent.ProgramClassId = Convert.ToInt32(ProgramClassId);
                    if (ProgramCourseId != null)
                    {
                        programClassStudent.ProgramCourseId = Convert.ToInt32(ProgramCourseId);
                    }
                    programClassStudent.StudentId             = Convert.ToInt32(dataItem.GetDataKeyValue("StudentId").ToString());
                    programClassStudent.ProgramRegistrationId = Convert.ToInt32(dataItem.GetDataKeyValue("ProgramRegistrationId").ToString());
                    programClassStudent.CreatedDate           = DateTime.Now;
                    programClassStudent.CreatedId             = CurrentUserId;


                    if (cProgramclassStudent.Add(programClassStudent) > 0)
                    {
                        ShowMessage("Transfer Success");
                    }
                }

                refreshGrid();
            }
            else
            {
                ShowMessage("Transfer Failed");
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var tempSplit = Request["programClassStudentIdList"].Split(',');

            foreach (var v in tempSplit)
            {
                _classStudentIdList.Add(Convert.ToInt32(v));
            }
            var programClassStudent = new CProgramClassStudent().Get(_classStudentIdList[0]);

            CurrentProgramClassId = programClassStudent.ProgramClassId;

            if (!IsPostBack)
            {
                ResetForm();

                var c = new CProgramClass().Get(CurrentProgramClassId);
                if (c != null)
                {
                    var program = new CProgram().Get(c.ProgramId);
                    if (program != null)
                    {
                        if (program.ProgramGroupId != null)
                        {
                            var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId));
                            if (programGroup != null)
                            {
                                RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString();
                                LoadProgramGroup(RadComboBoxFaculty.SelectedValue);
                            }
                            RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString();
                            LoadProgram(RadComboBoxProgramGroup.SelectedValue);
                        }
                        RadComboBoxProgram.SelectedValue = program.ProgramId.ToString();
                        LoadProgramCourse(RadComboBoxProgram.SelectedValue);

                        if (c.ProgramCourseId != null)
                        {
                            var programCourse = new CProgramCourse().Get((int)c.ProgramCourseId);
                            if (programCourse != null)
                            {
                                RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString();
                                LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue);
                            }
                        }

                        if (c.ProgramCourseLevelId != null)
                        {
                            var programCourseLevel = new CProgramCourseLevel().Get((int)c.ProgramCourseLevelId);
                            if (programCourseLevel != null)
                            {
                                RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString();
                                LoadProgramClass(RadComboBoxProgramCourse.SelectedValue, CurrentProgramClassId);
                            }
                        }
                    }
                }
            }

            SearchProgramClassStudent();

            RadComboBoxFaculty.OpenDropDownOnLoad            = false;
            RadComboBoxProgramGroup.OpenDropDownOnLoad       = false;
            RadComboBoxProgram.OpenDropDownOnLoad            = false;
            RadComboBoxProgramCourse.OpenDropDownOnLoad      = false;
            RadComboBoxProgramCourseLevel.OpenDropDownOnLoad = false;
            RadComboBoxProgramClass.OpenDropDownOnLoad       = false;
        }