Beispiel #1
0
        public void LoadCurriculums()
        {
            ICurriculumService currService = new CurriculumService();
            string message = String.Empty;
            try
            {
                var currs = currService.GetAllCurriculums();
                currList = new List<Curriculum>(currs);
                gvCurriculum.DataSource = currs;
                gvCurriculum.Refresh();

                if (gvCurriculum.RowCount != 0)
                    gvCurriculum.Rows[0].IsSelected = true;
            }
            catch (Exception ex)
            {
                message = "Error Loading Curriculum List";
                MessageBox.Show(ex.ToString());
            }

        }
Beispiel #2
0
        private void Save()
        {
            
            string message = String.Empty;
            Curriculum c = new Curriculum();

            ICurriculumService curriculumService = new CurriculumService();

            var curri = curriculumService.GetAllCurriculums();

            curr = new List<Curriculum>(curri);

            if (chkCurrent.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                c.CurrentCurr = true;
            }

            c.CurriculumCode = txtCurrCode.Text;
            c.CurriculumSubjects = currSub1;
            c.Description = txtDescription.Text;

            String cCode = txtCurrCode.Text.Trim();
            if (Op.Equals("new"))
            {
                foreach (Curriculum cu in curr)
                {
                    String currcode = cu.CurriculumCode;
                    if (cCode.Equals(currcode))
                    {
                        MessageBox.Show("Curriculum already exist!");
                        break;
                    }
                    else
                    {


                        if (Op.Equals("new"))
                        {
                            ret = cs.CreateCurriculum(ref c, ref message);
                            c.CurriculumSubjects = null;
                            Log("C", "Curriculums", c);
                            if (ret)
                            {
                                foreach (CurriculumSubject cs in currSub1)
                                    Log("C", "CurriculumSubjects", cs);

                                MessageBox.Show(this, message, "Add Successful");
                                Op = "edit";
                                //Comment this part. The current pocess is not working. 
                                //New process is to add the curriculum then update.
                                //this.txtCurrCode.Enabled = false;
                                //this.Size = new Size(851, 503);
                                //radGroupBox2.Visible = true;
                                this.Close();

                            }
                            else
                                MessageBox.Show(this, message, "Add Failed");
                        }
                    }
                }


               
            }

            else if (Op.Equals("edit"))
            {
                ret = cs.UpdateCurriculum(ref c, ref message);
                c.CurriculumSubjects = null;
                Log("U", "Curriculums", c);
                if (ret)
                {
                    foreach (CurriculumSubject cs in currSub1)
                        Log("C", "CurriculumSubjects", cs);
                    MessageBox.Show(this, message, "Update Successful");
                    this.Close();
                }
                else
                    MessageBox.Show(this, message, "Update Failed");
            }
                  
        }
Beispiel #3
0
 private void cmbGradeLevel_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
 {
     subDetails = new List<SubjectsDetails>();
    
     ICurriculumService ss = new CurriculumService();
    
 }