Пример #1
0
 // GET: Event/Details/5
 public ActionResult Details(int id)
 {
     Session["eventid"] = id;
     o_event            = new CEvents();
     o_event.LoadById(id);
     return(View(o_event));
 }
Пример #2
0
        /// <summary>
        /// 建構式,傳入事件系統編號
        /// </summary>
        /// <param name="EventID"></param>
        public FreeEventCommand(CEvents evtsFree)
        {
            if (evtsFree == null)
                throw new NullReferenceException("事件列表不得為null");

            this.evtsFree = evtsFree;
        }
Пример #3
0
    /**
     * Read and deserialize a json file
     **/
    public void ReadNewsJson()
    {
        law.ResetState();
        if (newsNumber == dirs.Length)
        {
            Debug.Log("Trigger end game");
        }

        if (newsNumber < dirs.Length)
        {
            string path = dirs[newsNumber];
            Debug.Log(path);
            TextAsset txts       = Resources.Load(path) as TextAsset;
            string    jsonString = txts.text;
            Debug.Log(jsonString);
            cEvents = JsonConvert.DeserializeObject <CEvents>(jsonString);
            Debug.Log(cEvents.Event);
            newsNumber++;
        }
        else
        {
            isOutOfNews = true;
        }
        //Update Bill Law Title
        law.UpdateBillTitle();
        Debug.Log("current new number: " + newsNumber);
    }
        protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            DateTime date = Calendar1.SelectedDate;
            //ToDo: Write a CEvent Function that takes the selected date and checks for an event.
            // If no event is found, make a new one.
            CEvents todaysEvent = new CEvents();

            eventID = todaysEvent.GetEventID(date, siteID);
        }
        public ActionResult AddGuest()
        {
            GuestEvent ge     = new GuestEvent();
            CGuest     guest  = new CGuest();
            CEvents    events = new CEvents();

            ge.Guest  = guest;
            ge.Events = events;

            return(View());
        }
Пример #6
0
 public ActionResult Close(int id, CEvents o_event)
 {
     try
     {
         o_event.CloseEvent();
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message;
         return(View());
     }
 }
Пример #7
0
 public ActionResult Close(int id)
 {
     if (Session["employee"] == null)
     {
         return(RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url }));
     }
     else
     {
         o_event = new CEvents();
         o_event.LoadById(id);
         return(View(o_event));
     }
 }
Пример #8
0
 public ActionResult Create(CEvents t_event)
 {
     try
     {
         // TODO: Add insert logic here
         t_event.Insert();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #9
0
        // GET: Event/Edit/5
        public ActionResult Edit(int id)
        {
            if (Session["employee"] == null)
            {
                return(RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url }));
            }
            else
            {
                EventsSites eSite = new EventsSites();
                eSite.AllSites = new CSiteList();
                eSite.AllSites.Load();

                CEvents e = new CEvents();
                e.LoadById(id);
                eSite.NewEvent = e;

                return(View(eSite));
            }
        }