Exemple #1
0
        public ActionResult CreateSchedule(ScheduleViewModel model)
        {
            var identity = User.Identity.GetUserIdentity();

            //Get all mentees assigned to mentor
            var mentees = _mentee.GetMentees(identity.UserId);

            //Pass it to a view bag
            ViewBag.UserId = new SelectList(mentees, "UserId", "User.Name", model.Mentee.UserId);

            if (ModelState.IsValid)
            {
                try
                {
                    var schedule = new ScheduleModel
                    {
                        Date    = model.Date,
                        Time    = model.Time,
                        Details = model.Details,
                        Mentee  = new MenteeModel
                        {
                            UserId = model.Mentee.UserId,
                        },
                    };

                    _schedule.CreateSchedule(schedule, model.Mentee.UserId);
                    return(RedirectToAction("schedules"));
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("not saved", ex.Message);
                }
            }
            return(View());
        }
Exemple #2
0
    void Start()
    {
        var t = ScheduleManager.CreateSchedule(1, () =>
        {
            Debug.Log("SSS");
        });

        t.Start();
        // i = 0;
        // StartCoroutine(Thread1());
        // var tempGameObject = new GameObject("zmj");
        // UnityEngine.Object.DontDestroyOnLoad(tempGameObject);
        // var gameobjct = GameObject.Find("zmj");
        // gameobjct.SetActive(false);
    }