示例#1
0
        public bool AddEvent(string event_name, string event_details, string event_cost)
        {
            var event_cost_num = Convert.ToInt32(event_cost);

            EventModel eventModel = new EventModel();

            return(eventModel.AddEvent(event_name, event_details, event_cost_num));
        }
示例#2
0
        private void registerNewEvent(string evtGuid)
        {
            var frm = new RegisterNewEventFrm();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var evt = new Event();

            evt.Id          = evtGuid;
            evt.Name        = frm.EventName;
            evt.ProfileName = frm.ProfileName;
            EventModel.AddEvent(evt);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            var evt = EventModel.FindEventByGuid(getEventGuid());

            if (evt == null)
            {
                evt = new Event
                {
                    Id          = getEventGuid(),
                    Name        = tbEventName.Text,
                    ProfileName = GetSelectedProfileName()
                };
                EventModel.AddEvent(evt);
            }
            else
            {
                evt.ProfileName = GetSelectedProfileName();
                evt.Name        = tbEventName.Text;
                EventModel.UpdateEvent(evt);
            }
        }