コード例 #1
0
        public ActionResult Create(LHStudentVM poViewModel)
        {
            oVAL = new LHStudent_Validation(poViewModel);
            oVAL.Validate_Create();

            //Add Error if exists
            for (int i = 0; i < oVAL.aValidationMSG.Count; i++)
            {
                ModelState.AddModelError(oVAL.aValidationMSG[i].VAL_ERRID, oVAL.aValidationMSG[i].VAL_ERRMSG);
            } //End for (int i = 0; i < oVAL.aValidationMSG.Count; i++)

            if (ModelState.IsValid)
            {
                oCRUD.Create(poViewModel);
                if (oCRUD.isERR)
                {
                    TempData["ERRMSG"] = oCRUD.ERRMSG;
                    return(RedirectToAction("ErrorSYS", "Error"));
                } //End if (!oCRUD.isERR) {

                TempData["CRUDSavedOrDelete"] = valFLAG.FLAG_TRUE;
                poViewModel.DETAIL.ID         = oCRUD.ID;

                TempData["poViewModel"] = Session["poViewModel"];
                Session.Remove("poViewModel");

                return(RedirectToAction("Index"));
            } //End if (ModelState.IsValid)

            prepareLookup();
            poViewModel.DETAIL_USER    = oDSUser.getData(hlpConfig.SessionInfo.getAppUserId());
            poViewModel.DETAIL_STUDENT = oDSStudent.getData_lookup(poViewModel.FILTER_ID);
            return(View(poViewModel));
        }
コード例 #2
0
        public ActionResult Index(LHStudentVM poViewModel)
        {
            oVAL = new LHStudent_Validation(poViewModel);
            oVAL.Validate_Filter();

            ViewBag.isOutstanding = false;

            //Add Error if exists
            for (int i = 0; i < oVAL.aValidationMSG.Count; i++)
            {
                ModelState.AddModelError(oVAL.aValidationMSG[i].VAL_ERRID, oVAL.aValidationMSG[i].VAL_ERRMSG);
            } //End for (int i = 0; i < oVAL.aValidationMSG.Count; i++)

            if (ModelState.IsValid)
            {
                poViewModel.LISTITEM_STUDENT = oDSStudent.getDatalist_lhstudent(poViewModel);
            }                                                                                                         //End if (ModelState.IsValid)

            prepareLookup();
            prepareLookupFilter();
            poViewModel.DETAIL_USER = oDSUser.getData(hlpConfig.SessionInfo.getAppUserId());
            if (poViewModel.FILTER_ACTION_TYPE != null)
            {
                if (poViewModel.FILTER_ACTION_TYPE == 3)
                {
                    ViewBag.isOutstanding = true;
                    //var oData = oDSStudent.getDatalist_outstandinglhs(poViewModel.FILTER_DATE, poViewModel.FILTER_CLASSTYPE_ID, poViewModel.FILTER_CLASSROOM_ID);
                    poViewModel.LISTITEM_STUDENT = oDSStudent.getDatalist_outstandinglhs(poViewModel.FILTER_DATE, poViewModel.FILTER_CLASSTYPE_ID, poViewModel.FILTER_CLASSROOM_ID);
                    //return View("Indexoutstandingstudent", poViewModel);
                }
                else
                {
                    poViewModel.DETAIL_STUDENT = oDSStudent.getData_lookup(poViewModel.FILTER_ID);
                    poViewModel.DETAIL         = oDS.getData_create(poViewModel);
                    //#arn Session["poViewModel"] = poViewModel;

                    if (poViewModel.DETAIL.ID == null)
                    {
                        ViewBag.CRUD_type = hlpFlags_CRUDOption.CREATE; return(View("Create", poViewModel));
                    }

                    if (poViewModel.DETAIL.ID != null)
                    {
                        ViewBag.CRUD_type = hlpFlags_CRUDOption.UPDATE; return(View("Edit", poViewModel));
                    }
                }
            } //End if (poViewModel.FILTER_ACTION_TYPE !=null)

            return(View(poViewModel));
        }
コード例 #3
0
        public ActionResult Reportlhs()
        {
            //ViewBag.AC_MENU_ID = valMENU.MODULE_INDEX;

            if (hlpConfig.SessionInfo.getAppRoleId() == valFLAG.FLAG_ROLE_P)
            {
                return(RedirectToAction("Indexparent"));
            } //End if (hlpConfig.SessionInfo.getAppRoleId() == valFLAG.FLAG_ROLE_P)

            var oData = new LHStudentVM();

            if (TempData[this.TEMPDATA_RPTLHS] != null)
            {
                oData = (LHStudentVM)TempData[this.TEMPDATA_RPTLHS];
                Session[this.TEMPDATA_RPTLHS] = oData;
                oData.LISTRPT = oDS.getDatalist_report(oData);
            } //End if (TempData[this.TEMPDATA_RPTLHS] != null)

            return(View(oData));
        }
コード例 #4
0
        public ActionResult Indexreport()
        {
            //ViewBag.AC_MENU_ID = valMENU.MODULE_INDEX;

            if (hlpConfig.SessionInfo.getAppRoleId() == valFLAG.FLAG_ROLE_P)
            {
                return(RedirectToAction("Indexparent"));
            } //End if (hlpConfig.SessionInfo.getAppRoleId() == valFLAG.FLAG_ROLE_P)

            var oData = new LHStudentVM();

            oData.FILTER_DATE = DateTime.Now;
            if (TempData[this.TEMPDATA_RPTLHS] != null)
            {
                oData = (LHStudentVM)TempData[this.TEMPDATA_RPTLHS];
            }

            prepareLookupFilter();
            return(View(oData));
        }
コード例 #5
0
        } //End prepareLookupFilter()

        public ActionResult Index()
        {
            //ViewBag.AC_MENU_ID = valMENU.MODULE_INDEX;
            ViewBag.isOutstanding = false;

            if (hlpConfig.SessionInfo.getAppRoleId() == valFLAG.FLAG_ROLE_P)
            {
                return(RedirectToAction("Indexparent"));
            } //End if (hlpConfig.SessionInfo.getAppRoleId() == valFLAG.FLAG_ROLE_P)

            var oData = new LHStudentVM();

            oData.FILTER_DATE = DateTime.Now;
            if (TempData["poViewModel"] != null)
            {
                oData = (LHStudentVM)TempData["poViewModel"];
            }

            prepareLookupFilter();
            return(View(oData));
        }
コード例 #6
0
        public ActionResult Details(int?id = null)
        {
            //ViewBag.AC_MENU_ID = valMENU.MODULE_DETAILS;
            ViewBag.CRUD_type         = hlpFlags_CRUDOption.VIEW;
            ViewBag.CRUDSavedOrDelete = TempData["CRUDSavedOrDelete"];

            LHStudentVM oData = new LHStudentVM();

            if (TempData["poViewModel"] != null)
            {
                ViewBag.poViewModel = TempData["poViewModel"];
                oData        = ViewBag.poViewModel;
                oData.DETAIL = oDS.getData(oData.DETAIL.ID);
            }
            if (oData == null)
            {
                return(HttpNotFound());
            }

            prepareLookup();
            return(View(oData));
        }
コード例 #7
0
        public ActionResult Indexreport(LHStudentVM poViewModel)
        {
            LHStudentVM oViewModel = poViewModel;

            oVAL = new LHStudent_Validation(oViewModel);
            oVAL.Validate_Filter();

            //Add Error if exists
            for (int i = 0; i < oVAL.aValidationMSG.Count; i++)
            {
                ModelState.AddModelError(oVAL.aValidationMSG[i].VAL_ERRID, oVAL.aValidationMSG[i].VAL_ERRMSG);
            } //End for (int i = 0; i < oVAL.aValidationMSG.Count; i++)

            if (ModelState.IsValid)
            {
                TempData[this.TEMPDATA_RPTLHS] = oViewModel;
                return(RedirectToAction("Reportlhs"));
            } //End if (ModelState.IsValid)

            prepareLookup();
            prepareLookupFilter();
            return(View(poViewModel));
        }