예제 #1
0
 public string GetYearLevelFromAndTo(int yearMin, int yearMax)
 {
     using (Maintenance _maintain = new Maintenance())
     {
         var    txtMin = _maintain.GetYearLevel().Where(x => x.Active == true && x.Count == yearMin).FirstOrDefault().YearLevel;
         string txtMax = _maintain.GetYearLevel().Where(x => x.Active == true && x.Count == yearMax).FirstOrDefault().YearLevel;
         return(txtMin + " to " + txtMax);
     }
 }
 void LoadYearLevel()
 {
     cmbYearLevel.Items.Clear();
     using (Maintenance _maintain = new Maintenance())
     {
         _maintain.GetYearLevel().OrderBy(o => o.YearLevel).ToList().ForEach(x =>
         {
             cmbYearLevel.Items.Add(x.YearLevel);
         });
     }
 }
예제 #3
0
 void dgYearLevel_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     using (Maintenance _maintain = new Maintenance())
     {
         var value = _maintain.GetYearLevel().Where(x => x.ID == Convert.ToInt64(dgYearLevel.SelectedRows[0].Cells[0].Value)).FirstOrDefault();
         if (value != null)
         {
             txtYearLevel.Text = value.YearLevel;
             cbActive.Checked  = value.Active.Value;
             txtCount.Value    = value.Count.Value;
             btnDelete         = SystemProperties.BtnProperties(btnDelete, true, Imagename.Delete.ToString(), Imagename._delete.ToString());
             btnEdit           = SystemProperties.BtnProperties(btnEdit, true, Imagename.Edit.ToString(), Imagename._edit.ToString());
         }
     }
 }
예제 #4
0
 void LoadYearLevel()
 {
     cmbMin.Items.Clear();
     cmbMax.Items.Clear();
     using (Maintenance _maintain = new Maintenance())
     {
         _maintain.GetYearLevel().OrderBy(x => x.Count).ToList().ForEach(y =>
         {
             cmbMin.Items.Add(y.Count);
             cmbMax.Items.Add(y.Count);
             cmbMin.SelectedIndex = 0;
             cmbMax.SelectedIndex = 0;
         });
     }
 }
예제 #5
0
        void LoadYearLevel()
        {
            dgYearLevel.Rows.Clear();
            int i = 1;

            using (Maintenance _maintain = new Maintenance())
            {
                _maintain.GetYearLevel().OrderBy(y => y.YearLevel).ToList().ForEach(x =>
                {
                    dgYearLevel.Rows.Add(x.ID, i, x.YearLevel, x.Count, x.Active);
                    i++;
                });
            }
            ObjEnable(false);
            dgYearLevel.Enabled = true;
        }
 void LoadCourseYealvl(bool Course)
 {
     cmbSearch.Items.Clear();
     using (Maintenance maintain = new Maintenance())
     {
         if (Course)
         {
             maintain.GetCourse().Where(x => x.Active == true).OrderBy(o => o.Course).ToList().ForEach(y =>
             {
                 cmbSearch.Items.Add(y.CourseCode);
             });
         }
         else
         {
             maintain.GetYearLevel().Where(x => x.Active == true).OrderBy(o => o.YearLevel).ToList().ForEach(y =>
             {
                 cmbSearch.Items.Add(y.YearLevel);
             });
         }
     }
 }