コード例 #1
0
    private void SetNewSelectedUnits()
    {
        _selectedUnits.Clear();

        foreach (var selectableUnit in FindObjectsOfType <Unit>())
        {
            if (IsWithinSelectionBounds(selectableUnit))
            {
                _selectedUnits.Add(selectableUnit);
            }

            else
            {
                continue;
            }
        }

        UnitsSelected?.Invoke(_selectedUnits);
        _isOnSelecting = false;
    }
コード例 #2
0
        public ActionResult ReportSemester(Units_SubjectsList units, GetStudentNo student, GetUnitAmount uAmount)
        {
            var code        = units.Code.Split(',');
            var programme   = units.Programme_Code.Split(',');
            var stage       = units.Stage.Split(',');
            var description = units.Description.Split(',');
            var semester    = units.Semester.Split(',');
            var amount      = uAmount.unitAmount.Split(',');

            try
            {
                //Get Transaction ID
                string transId = WebServices.PortalService().GetSubmitUnitsNo();

                //Insert into semester registration
                try
                {
                    InsertIntoSemesterReg(transId, programme[0], stage[0], semester[0]);
                }
                catch (Exception e)
                {
                    return(Json(new { INFO = "error", MESSAGE = semester[0] + " is not the current term" }));
                }


                //Insert units (Units selected table)

                var count = 0;
                for (int i = 0; i < code.Length; i++)
                {
                    UnitsSelected selected = new UnitsSelected();
                    selected.Reg_Transacton_ID      = transId;
                    selected.Selected_Unit          = true;
                    selected.Selected_UnitSpecified = true;
                    selected.Code                 = code[i];
                    selected.Programme_Code       = programme[i];
                    selected.Programme_Name       = description[i];
                    selected.Semester             = semester[i];
                    selected.Stage_Code           = stage[i];
                    selected.Student_No           = student.No;
                    selected.Unit_Amount          = decimal.Parse(amount[i]);
                    selected.Unit_AmountSpecified = true;
                    WebServices.UnitsSelectedService().Create(ref selected);
                    count = i;
                }
                try
                {
                    WebServices.StudentMgtService().SubmitUnits(transId);
                }
                catch (Exception e)
                {
                    return(Json(new { INFO = "error", MESSAGE = e.Message }));
                }
                string msg = "Semester Registered Successfully";

                return(Json(msg));
            }
            catch (Exception e)
            {
                return(Json(new { INFO = "info", MESSAGE = e.Message }));
            }
        }
コード例 #3
0
        public ActionResult UnitReg(Units_SubjectsList units, GetStudentNo student, GetUnitAmount uAmount)
        {
            var code        = units.Code.Split(',');
            var programme   = units.Programme_Code.Split(',');
            var stage       = units.Stage.Split(',');
            var description = units.Description.Split(',');
            var semester    = units.Semester.Split(',');
            var amount      = uAmount.unitAmount.Split(',');

            //Add the language select to student units

            //Check if registered,return false; otherwise if registered
            if (GetRegUnits().Where(x => code.Contains(x.Unit)).Any() == true)
            {
                return(Json(new { INFO = "info", MESSAGE = "You have already registered selected units" }));
            }

            try
            {
                //Get Transaction ID
                var    portal  = WebServices.PortalService();
                string transId = portal.GetSubmitUnitsNo();

                //Insert into semester registration
                InsertIntoSemesterReg(transId, programme[0]);

                //Insert units (Units selected table)
                UnitsSelected_Service serv = WebServices.UnitsSelectedService();
                var count = 0;
                for (int i = 0; i < code.Length; i++)
                {
                    UnitsSelected selected = new UnitsSelected();
                    selected.Reg_Transacton_ID      = transId;
                    selected.Selected_Unit          = true;
                    selected.Selected_UnitSpecified = true;
                    selected.Code                 = code[i];
                    selected.Programme_Code       = programme[i];
                    selected.Programme_Name       = description[i];
                    selected.Semester             = semester[i];
                    selected.Stage_Code           = stage[i];
                    selected.Student_No           = student.No;
                    selected.Unit_Amount          = decimal.Parse(amount[i]);
                    selected.Unit_AmountSpecified = true;
                    serv.Create(ref selected);
                    count = i;
                }
                var mgt = WebServices.StudentMgtService();
                mgt.SubmitUnits(transId);
                string msg = "";
                if (count > 0)
                {
                    msg = "Units Registered Successfully";
                }
                else
                {
                    msg = "Unit Registered Successfully";
                }

                return(Json(msg));
            }
            catch (Exception ex)
            {
                return(Json(new { ERROR = "error", MESSAGE = GeneralSetup.ExceptionConsoler, EXCEPTION = ex.Message }));
            }
        }
コード例 #4
0
        public ActionResult Apply(Units_SubjectsList units, ApplyingStudent sNo, AppliedUnitAmount uAmount, GetActionUrl aUrl)
        {
            string msg1 = "", msg2 = "";

            if (!String.IsNullOrEmpty(aUrl.UrlAction) && aUrl.UrlAction == "Supplementary")
            {
                //apply for supplementary
                msg1 = "Supplementary applications has been submitted successfully";
                msg2 = "Supplementary application has been submitted successfully";
            }
            else if (!String.IsNullOrEmpty(aUrl.UrlAction) && aUrl.UrlAction == "Special")
            {
                // apply for  special
                msg1 = "Special applications has been submitted successfully";
                msg2 = "Special application has been submitted successfully";
            }
            else if (!String.IsNullOrEmpty(aUrl.UrlAction) && aUrl.UrlAction == "Retake")
            {
                // Retake
                msg1 = "Retake applications has been submitted successfully";
                msg2 = "Retake application has been submitted successfully";
            }
            else
            {
                return(Json(new { MESSAGE = "There was problem processing your application", ERROR = "error" }));
            }
            //Check if registered,return false; otherwise if registered
            if (GetAppliedUnits(aUrl.UrlAction).Length > 0)
            {
                return(Json("You have already applied for selected units"));
            }

            var code        = units.Code.Split(',');
            var programme   = units.Programme_Code.Split(',');
            var stage       = units.Stage.Split(',');
            var description = units.Description.Split(',');
            var semester    = units.Semester.Split(',');
            var amount      = uAmount.unitAmount.Split(',');

            try
            {
                //Get Transaction ID
                string transId = WebServices.PortalService().GetSubmitUnitsNo();

                //Insert into semester registration
                InsertIntoSemesterReg(transId, programme[0], aUrl.UrlAction);

                //Insert units (Units selected table)
                var count = 0;
                for (int i = 0; i < code.Length; i++)
                {
                    UnitsSelected selected = new UnitsSelected();
                    selected.Reg_Transacton_ID      = transId;
                    selected.Selected_Unit          = true;
                    selected.Selected_UnitSpecified = true;
                    selected.Code                 = code[i];
                    selected.Programme_Code       = programme[i];
                    selected.Programme_Name       = description[i];
                    selected.Semester             = semester[i];
                    selected.Stage_Code           = stage[i];
                    selected.Student_No           = sNo.No;
                    selected.Unit_Amount          = decimal.Parse(amount[i]);
                    selected.Unit_AmountSpecified = true;
                    WebServices.UnitSelectedService().Create(ref selected);
                    count = i;
                }

                WebServices.StudentMgtService().SubmitUnits(transId);

                string msg = "";
                if (count > 0)
                {
                    msg = msg1;
                }
                else
                {
                    msg = msg2;
                }

                return(Json(msg));
            }
            catch (Exception e)
            {
                return(Json(new { MESSAGE = e.Message, ERROR = "error" }));
            }
        }