Ejemplo n.º 1
0
        }     //End public LHStudentdetailVM getData(int? id = null)

        public LHStudentdetailVM getData_create(LHStudentVM poViewModel = null)
        {
            LHStudentdetailVM oReturn = this.getData(poViewModel.FILTER_ID, poViewModel.FILTER_DATE);

            if (oReturn == null)
            {
                oReturn                = new LHStudentdetailVM();
                oReturn.BRANCH_ID      = poViewModel.DETAIL_STUDENT.BRANCH_ID;
                oReturn.YEAR_ID        = poViewModel.FILTER_YEAR_ID;
                oReturn.SEMESTER_ID    = poViewModel.FILTER_SEMESTER_ID;
                oReturn.CLASSTYPE_ID   = poViewModel.FILTER_CLASSTYPE_ID;
                oReturn.CLASSTYPE_NAME = poViewModel.FILTER_CLASSTYPE_NAME;
                oReturn.CLASSROOM_ID   = poViewModel.FILTER_CLASSROOM_ID;
                oReturn.CLASSROOM_NAME = poViewModel.FILTER_CLASSROOM_NAME;
                oReturn.SENTRA_ID      = poViewModel.DETAIL_USER.SENTRA_ID;
                oReturn.SENTRA_NAME    = poViewModel.FILTER_SENTRA_NAME;

                oReturn.LH_DT         = poViewModel.FILTER_DATE;
                oReturn.STUDENT_ID    = poViewModel.FILTER_ID;
                oReturn.STUDENT_NAME  = poViewModel.DETAIL_STUDENT.NAME;
                oReturn.EMPLOYEE_ID   = poViewModel.DETAIL_USER.RES_ID;
                oReturn.EMPLOYEE_NAME = poViewModel.DETAIL_USER.DISPLAY_NAME;
            }

            return(oReturn);
        } //End public LHStudentdetailVM getData_create(int? id = null)
Ejemplo n.º 2
0
        } //End public List<LHStudentlistVM> getDatalist()

        public List <LHStudentdetailVM> getDatalist_report(LHStudentVM poViewModel)
        {
            List <LHStudentdetailVM> vReturn = getDatalist_base(null, poViewModel.FILTER_CLASSTYPE_ID, poViewModel.FILTER_CLASSROOM_ID, poViewModel.FILTER_DATE);

            vReturn = vReturn.OrderByDescending(fld => fld.LH_DT).ToList();

            return(vReturn);
        } //End public List<LHStudentlistVM> getDatalist()
Ejemplo n.º 3
0
        }                                                                                      //End public void Create

        public void Update(LHStudentVM poViewModel)
        {
            try
            {
                this.Update(poViewModel.DETAIL);
            }                                                                                //End try
            catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Update" + e.Message; } //End catch
        }                                                                                    //End public void Update
Ejemplo n.º 4
0
        }     //End public List<StudentdetailVM> getDatalist_classmate(int id = null)

        public List <StudentdetailVM> getDatalist_lhstudent(LHStudentVM poViewModel = null)
        {
            List <StudentdetailVM> vReturn;

            using (var db = new DBMAINContext())
            {
                var oQRY = from tb in db.Student_infos
                           where tb.STUDENTSTS_ID != 2 && tb.STUDENTSTS_ID != 3
                           select new StudentdetailVM
                {
                    BRANCH_ID      = tb.BRANCH_ID,
                    BRANCH_DESC    = tb.BRANCH_DESC,
                    YEAR_ID        = tb.YEAR_ID,
                    YEAR_DESC      = tb.YEAR_DESC,
                    SEMESTER_ID    = tb.SEMESTER_ID,
                    CLASSTYPE_ID   = tb.CLASSTYPE_ID,
                    CLASSTYPE_NAME = tb.CLASSTYPE_NAME,
                    CLASSROOM_ID   = tb.CLASSROOM_ID,
                    CLASSROOM_NAME = tb.CLASSROOM_NAME,
                    ID             = tb.ID,
                    NAME           = tb.NAME,
                    NIS            = tb.NIS,
                    STUDENTSTS_ID  = tb.STUDENTSTS_ID
                };
                if (poViewModel != null)
                {
                    if (poViewModel.FILTER_BRANCH_ID != null)
                    {
                        oQRY = oQRY.Where(fld => fld.BRANCH_ID == poViewModel.FILTER_BRANCH_ID);
                    } //End if (poViewModel.YEAR_ID != null)
                    if (poViewModel.FILTER_YEAR_ID != null)
                    {
                        oQRY = oQRY.Where(fld => fld.YEAR_ID == poViewModel.FILTER_YEAR_ID);
                    } //End if (poViewModel.YEAR_ID != null)
                    if (poViewModel.FILTER_SEMESTER_ID != null)
                    {
                        oQRY = oQRY.Where(fld => fld.SEMESTER_ID == poViewModel.FILTER_SEMESTER_ID);
                    } //End if (poViewModel.SEMESTER_ID != null)
                    if (poViewModel.FILTER_CLASSTYPE_ID != null)
                    {
                        oQRY = oQRY.Where(fld => fld.CLASSTYPE_ID == poViewModel.FILTER_CLASSTYPE_ID);
                    } //End if (poViewModel.CLASSTYPE_ID != null)
                    if (poViewModel.FILTER_CLASSROOM_ID != null)
                    {
                        oQRY = oQRY.Where(fld => fld.CLASSROOM_ID == poViewModel.FILTER_CLASSROOM_ID);
                    } //End if (poViewModel.CLASSTYPE_ID != null)
                }     //End if (poViewModel != null)
                vReturn = oQRY.ToList();
            }         //End using (var = new DbContext())
            return(vReturn);
        }             //End public List<Student_ListVM> getDatalist()
Ejemplo n.º 5
0
        } //End public LHStudent_Validation()

        //Constructor 2
        public LHStudent_Validation(LHStudentVM poViewModel)
        {
            oViewModelfilter = poViewModel;
            oViewModel       = poViewModel.DETAIL;
        } //End public LHStudent_Validation()