Exemple #1
0
        public ActionResult Indexbackdate(Transaction_indetailVM poViewModel)
        {
            //Set ViewModel
            Transaction_indetailVM oViewModel = poViewModel;

            //Retreave Data requirement
            YeardetailVM    oDatayear    = oDSYear.getData_byPeriod(oDSSysinfo.getData().SYSDATE);
            StudentdetailVM oDatastudent = oDSStudent.getData(poViewModel.STUDENT_ID);

            //Mapp data properti
            oViewModel.InjectFrom(oDatastudent);
            oViewModel.InjectFromStudentVM(oDatastudent);
            oViewModel.InjectFromYearVM(oDatayear);
            oViewModel.InjectReceipt();
            oViewModel.setSYSDATE();

            if ((oViewModel.TRN_DT >= oViewModel.YEAR_FROM) && (oViewModel.TRN_DT <= oViewModel.YEAR_TO))
            {
                Session[hlpConfig.SessionInfo.getTransaction_methodID()] = hlpConfig.SessionInfo.getTransaction_methodbackdate();
                Session[hlpConfig.SessionInfo.getTransaction_inID()]     = oViewModel;
                Session[hlpConfig.SessionInfo.sSESSIONID_ISBACKDATE]     = "YES";
                return(RedirectToAction("Create"));
            } //End if ((oViewModel.TRN_DT >= oViewModel.YEAR_FROM) && (oViewModel.TRN_DT <= oViewModel.YEAR_TO))

            return(View(oViewModel));
        }
Exemple #2
0
        public ActionResult Edit(YeardetailVM poViewModel)
        {
            ViewBag.AC_MENU_ID = valMENU.PENGATURAN_TAHUNAJARAN_EDIT;

            oVAL = new Year_Validation(poViewModel);
            oVAL.Validate_Edit();

            //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.Update(poViewModel);
                if (oCRUD.isERR)
                {
                    TempData["ERRMSG"] = oCRUD.ERRMSG;
                    return(RedirectToAction("ErrorSYS", "Error"));
                } //End if (!oCRUD.isERR) {

                TempData["CRUDSavedOrDelete"] = valFLAG.FLAG_TRUE;
                return(RedirectToAction("Details", new { id = oCRUD.ID }));
            }
            return(View(poViewModel));
        }
        } //End Method

        protected Boolean _setData_year(int?id)
        {
            //Get data tahun
            this.oData_year      = this.oDSYear.getData(id);
            this.oData.YEAR_ID   = this.oData_year.ID;
            this.oData.YEAR_DESC = this.oData_year.YEAR_DESC;
            this.oData.YEAR_FROM = this.oData_year.YEAR_FROM;
            this.oData.YEAR_TO   = this.oData_year.YEAR_TO;

            this.oData.CACHE_YEAR_DESC = this.oData_year.YEAR_DESC;
            this.oData.CACHE_YEAR_FROM = this.oData_year.YEAR_FROM;
            this.oData.CACHE_YEAR_TO   = this.oData_year.YEAR_TO;

            return(true);
        } //End Method