Ejemplo n.º 1
0
        public ActionResult AddEventSchedule(AdminHomeVM vm)
        {
            InsertDAL insert = new InsertDAL();
            //vm.NewEventSchedule.PerWeekdayDuration = NodaTime.Period.FromMinutes(vm.NewEventSchedule.PerWeekdayDuration.Minutes);
            //vm.NewEventSchedule.PerWeekendDuration = NodaTime.Period.FromMinutes(vm.NewEventSchedule.PerWeekendDuration.Minutes);

            EventSchedule newEventSchedule = new EventSchedule(
                vm.NewEventSchedule.Event,
                (int)vm.NewEventSchedule.IntWeekdayDuration,
                (int)vm.NewEventSchedule.IntWeekendDuration,
                vm.NewEventSchedule.StrMondayStart,
                vm.NewEventSchedule.StrTuesdayStart,
                vm.NewEventSchedule.StrWednesdayStart,
                vm.NewEventSchedule.StrThursdayStart,
                vm.NewEventSchedule.StrFridayStart,
                vm.NewEventSchedule.StrSaturdayStart,
                vm.NewEventSchedule.StrSundayStart);

            insert.OpenConnection();

            insert.InsertEventSchedule(newEventSchedule);

            insert.CloseConnection();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 static DB()
 {
     ActiveEvents        = new ActiveEvents();
     ActiveGiveaways     = new ActiveGiveaways();
     BackgroundInventory = new BackgroundInventory();
     Cooldowns           = new Cooldowns();
     Events             = new Database.Events();
     EventLogs          = new EventLogs();
     EventSchedule      = new EventSchedule();
     GiveawayLogs       = new GiveawayLogs();
     Giveaways          = new Giveaways();
     Inventory          = new Inventory();
     LeagueData         = new LeagueData();
     Mappings           = new Mappings();
     ModerationLogs     = new ModerationLogs();
     PendingUsers       = new PendingUsers();
     ProfileBackgrounds = new ProfileBackgrounds();
     Rewards            = new Rewards();
     RoleInventory      = new RoleInventory();
     Roles        = new Roles();
     Settings     = new Settings();
     Statistics   = new Statistics();
     Streamers    = new Streamers();
     SystemTimers = new SystemTimers();
     TempRoles    = new TempRoles();
     Toxicity     = new Toxicity();
     Users        = new Users();
 }
Ejemplo n.º 3
0
        public void Equality_TwoSameEvents_NotEqual()
        {
            EventSchedule eventSchedule1 = CreateSampleEvent();
            EventSchedule eventSchedule2 = CreateSampleEvent();

            Assert.AreNotEqual(eventSchedule1, eventSchedule2);
        }
Ejemplo n.º 4
0
        protected async Task Add(CommandContext ctx, string eventName = null)
        {
            var evt = new EventSchedule();

            var(success, msg) = await EditEventPropertiesAsync(ctx, evt, eventName).ConfigureAwait(false);

            if (success)
            {
                using (var db = new BotDb())
                {
                    await db.EventSchedule.AddAsync(evt).ConfigureAwait(false);

                    await db.SaveChangesAsync().ConfigureAwait(false);
                }
                await ctx.ReactWithAsync(Config.Reactions.Success).ConfigureAwait(false);

                if (LimitedToSpamChannel.IsSpamChannel(ctx.Channel))
                {
                    await msg.UpdateOrCreateMessageAsync(ctx.Channel, embed : FormatEvent(evt).WithTitle("Created new event schedule entry #" + evt.Id)).ConfigureAwait(false);
                }
                else
                {
                    await msg.UpdateOrCreateMessageAsync(ctx.Channel, "Added a new schedule entry").ConfigureAwait(false);
                }
            }
            else
            {
                await msg.UpdateOrCreateMessageAsync(ctx.Channel, "Event creation aborted").ConfigureAwait(false);
            }
        }
Ejemplo n.º 5
0
        public EventScheduleWidget(EventSchedule eventSchedule, string dateFormat, string timeFormat)
            : this(eventSchedule)
        {
            var eventScheduleService = HostContainer.GetInstance <IEventScheduleService>();

            TimeFrame = eventScheduleService.GetEventScheduleTimeFrame(TimeStart, TimeEnd, dateFormat, timeFormat);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MsasSink"/> class.
 /// </summary>
 public MediaSink()
 {
     Trace.TraceInformation("MsasSink() Start");
     Trace.Indent();
     try
     {
         Trace.TraceInformation("Build version {0}", VersionInfo);
         m_portNumber = GetPortNumber(BASE_PORT);
         m_keyboardHook = new KeyboardHook();
         m_socketServer = new TcpSocketServer();
         m_eventSchedule = new EventSchedule();
     }
     catch (EventScheduleException ex)
     {
         //  This will happen if the user has not set up the EPG but it is not fatal
         Trace.TraceError(ex.ToString());
     }
     catch (Exception ex)
     {
         Trace.TraceError(ex.ToString());
         throw;
     }
     finally
     {
         Trace.Unindent();
         Trace.TraceInformation("MsasSink() End");
     }
 }
Ejemplo n.º 7
0
        public void ToString_StandardEvent_OutputEventName()
        {
            EventSchedule eventSchedule = CreateSampleEvent();

            Assert.AreEqual(
                $"{nameof(Classroom)}.{nameof(EventSchedule)}", eventSchedule.ToString());
        }
Ejemplo n.º 8
0
    protected override void PageSwitchSetting(bool bActive, bool bBack)
    {
        base.PageSwitchSetting(bActive, bBack);

        //--------------------------------
        // 以下は有効になったタイミングでの処理なので、
        // フェードアウト指示の場合にはスルー
        //--------------------------------
        if (bActive == false)
        {
            return;
        }

        //--------------------------------
        // 戻り処理の場合は再構築スルー
        //--------------------------------
        if (bBack == true)
        {
            return;
        }

        //ページ初期化処理
        if (m_EventSchedule == null)
        {
            m_EventSchedule = GetComponentInChildren <EventSchedule>();
            m_EventSchedule.SetPositionAjustStatusBar(new Vector2(0, -6), new Vector2(-20, -351));
        }
        // シーンの最後に呼び出す
        m_EventSchedule.PostSceneStart();
    }
Ejemplo n.º 9
0
        public ActionResult ListEventSchedule()
        {
            var context = new ApplicationDbContext();
            List <vwEventSchedule> list = new List <vwEventSchedule>();

            var sender = context.Users.Where(x => x.UserName == User.Identity.Name).FirstOrDefault();

            List <FlowMain>      flist       = context.FlowMainList.Where(x => x.defId == "EventSchedule" && x.flowStatus != 99).OrderByDescending(x => x.billDate).ToList <FlowMain>();
            List <string>        billNoList  = (from item in flist select item.id).ToList <string>();
            List <EventSchedule> formObjList = ctx.eventScheduleList.Where(x => billNoList.Contains(x.flowId)).ToList <EventSchedule>();

            foreach (FlowMain fitem in flist)
            {
                EventSchedule   formObj = formObjList.Where(x => x.flowId == fitem.id).FirstOrDefault();
                vwEventSchedule item    = new vwEventSchedule
                {
                    id        = formObj.id,
                    flowId    = formObj.flowId,
                    billNo    = fitem.billNo,
                    user      = ctx.getUserByWorkNo(fitem.senderNo),
                    billDate  = fitem.billDate,
                    eventType = formObj.eventType
                };
                list.Add(item);
            }
            return(View(list));
        }
Ejemplo n.º 10
0
        public bool InsertEventSchedule(EventSchedule eventSchedule)
        {
            conn.TypeMapper.UseNodaTime();

            // define a query
            string query = "INSERT INTO public.\"eventSchedule\"(" +
                           "\"tmeMondayStart\", \"tmeTuesdayStart\", \"tmeWednesdayStart\"," +
                           " \"tmeThursdayStart\", \"tmeFridayStart\", \"tmeSaturdayStart\"," +
                           " \"tmeSundayStart\", \"durWeekdayDuration\", \"durWeekendDuration\"," +
                           " \"intEventID\")" +
                           " VALUES(@tmeMondayStart, @tmeTuesdayStart, @tmeWednesdayStart, @tmeThursdayStart, @tmeFridayStart, @tmeSaturdayStart, @tmeSundayStart, @durWeekdayDuration, @durWeekendDuration, @intEventID);";
            NpgsqlCommand cmd = new NpgsqlCommand(query, conn);

            cmd.Parameters.AddWithValue("tmeMondayStart", eventSchedule.TmeMondayStart);
            cmd.Parameters.AddWithValue("tmeTuesdayStart", eventSchedule.TmeTuesdayStart);;
            cmd.Parameters.AddWithValue("tmeWednesdayStart", eventSchedule.TmeWednesdayStart);
            cmd.Parameters.AddWithValue("tmeThursdayStart", eventSchedule.TmeThursdayStart);
            cmd.Parameters.AddWithValue("tmeFridayStart", eventSchedule.TmeFridayStart);
            cmd.Parameters.AddWithValue("tmeSaturdayStart", eventSchedule.TmeSaturdayStart);
            cmd.Parameters.AddWithValue("tmeSundayStart", eventSchedule.TmeSundayStart);
            cmd.Parameters.AddWithValue("durWeekdayDuration", eventSchedule.PerWeekdayDuration);
            cmd.Parameters.AddWithValue("durWeekendDuration", eventSchedule.PerWeekendDuration);
            cmd.Parameters.AddWithValue("intEventID", eventSchedule.Event.IntEventID);

            int result = cmd.ExecuteNonQuery();

            if (result == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 11
0
 public static bool IsComplete(this EventSchedule evt)
 {
     return(evt.Start > 0 &&
            evt.End > evt.Start &&
            evt.Year > 0 &&
            !string.IsNullOrEmpty(evt.Name));
 }
        public async Task <IHttpActionResult> PutEventSchedule(int id, EventSchedule eventSchedule)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != eventSchedule.eventScheduleID)
            {
                return(BadRequest());
            }

            db.Entry(eventSchedule).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EventScheduleExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MsasSink"/> class.
 /// </summary>
 public MediaSink()
 {
     Trace.TraceInformation("MsasSink() Start");
     Trace.Indent();
     try
     {
         Trace.TraceInformation("Build version {0}", VersionInfo);
         m_portNumber    = GetPortNumber(BASE_PORT);
         m_keyboardHook  = new KeyboardHook();
         m_socketServer  = new TcpSocketServer();
         m_eventSchedule = new EventSchedule();
     }
     catch (EventScheduleException ex)
     {
         //  This will happen if the user has not set up the EPG but it is not fatal
         Trace.TraceError(ex.ToString());
     }
     catch (Exception ex)
     {
         Trace.TraceError(ex.ToString());
         throw;
     }
     finally
     {
         Trace.Unindent();
         Trace.TraceInformation("MsasSink() End");
     }
 }
Ejemplo n.º 14
0
        public static void AddNewEventSchedule(EventSchedule eventSchedule)
        {
            using (MyCirclesEntityModel db = new MyCirclesEntityModel())
            {
                db.EventSchedules.Add(eventSchedule);

                db.SaveChanges();
            }
        }
        // get all the event scheduleData function << planning to reuse the code if can
        private void getEventScheduleData(int eventId)
        {
            EventSchedule        retrieveEventSchedule = new EventSchedule();
            List <EventSchedule> scheduleList          = new List <EventSchedule>();

            scheduleList = retrieveEventSchedule.getAllEventActivity(eventId);

            //System.Diagnostics.Debug.WriteLine(scheduleList);
            rpEventSchedule.DataSource = scheduleList;
        }
Ejemplo n.º 16
0
        public Schedule(List <RehearsalPart> allRehearsalParts, Event @event)
        {
            UnscheduledRehearsalParts = allRehearsalParts.OrderBy(x => x.IntPriority).ToList();
            GetDAL get = new GetDAL();

            get.OpenConnection();
            EventSchedule = get.GetEventScheduleByEvent(@event.IntEventID);

            CreateSchedule(DateTime.Now.AddDays(1), @event.DtmDate, get);
        }
        public async Task <IHttpActionResult> GetEventSchedule(int id)
        {
            EventSchedule eventSchedule = await db.EventSchedules.FindAsync(id);

            if (eventSchedule == null)
            {
                return(NotFound());
            }

            return(Ok(eventSchedule));
        }
Ejemplo n.º 18
0
        // GET api/Task/5
        public EventSchedule GetTask(int id)
        {
            EventSchedule task = db.EventSchedules.Single(p => p.Id == id);

            if (task == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(task);
        }
Ejemplo n.º 19
0
 public void AddVolunteerJob(int personNeededs, EventSchedule localRetreatSchedule, string flag)
 {
     if (personNeededs > 0)
     {
         EventVolunteerJob localRetreatVolunteerJob = new EventVolunteerJob();
         localRetreatVolunteerJob.VolunteerJobTypeID = _entities.VolunteerJobTypes.Single(a => a.Name.StartsWith(flag)).ID;
         localRetreatVolunteerJob.PersonsNeeded      = personNeededs;
         localRetreatVolunteerJob.PersonsTaked       = 0;
         localRetreatSchedule.EventVolunteerJobs.Add(localRetreatVolunteerJob);
     }
 }
Ejemplo n.º 20
0
 private static void RemoveScheduledEvent(Event e)
 {
     using (var service = new EventScheduleService())
     {
         EventSchedule es = service.GetWhere(EventScheduleService.EventCodeCol == e.Code).FirstOrDefault();
         if (es != null)
         {
             service.Delete(es.Code);
         }
     }
 }
Ejemplo n.º 21
0
        public IHttpActionResult GetEventSchedule(int id)
        {
            EventSchedule eventSchedule = db.EventSchedules.Find(id);

            if (eventSchedule == null)
            {
                return(NotFound());
            }

            return(Ok(eventSchedule));
        }
Ejemplo n.º 22
0
        public IHttpActionResult PostEventSchedule(EventSchedule eventSchedule)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EventSchedules.Add(eventSchedule);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = eventSchedule.Id }, eventSchedule));
        }
Ejemplo n.º 23
0
 public ScheduleCmd()
 {
     try
     {
         m_eventSchedule = new EventSchedule();
     }
     catch (EventScheduleException ex)
     {
         m_exception = ex.Message;
         Trace.TraceError(ex.ToString());
     }
 }
        public async Task <IHttpActionResult> PostEventSchedule(EventSchedule eventSchedule)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EventSchedules.Add(eventSchedule);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = eventSchedule.eventScheduleID }, eventSchedule));
        }
Ejemplo n.º 25
0
 public ScheduleCmd()
 {
     try
     {
         m_eventSchedule = new EventSchedule();
     }
     catch (EventScheduleException ex)
     {
         m_exception = ex.Message;
         Trace.TraceError(ex.ToString());
     }
 }
Ejemplo n.º 26
0
 public LduEventTaskInstanceInfoViewModel()
 {
     this.EventSchduleId = Wj1090Module.Services.MenuIdAssgin.EventSchduleNavTaskWj1090LduEventScheduleViewId;
     this.EventSchduleInstanceDescription = "No Description";
     this.EventSchduleInstanceId          = -1;
     this.EventSchduleInstanceName        = "Not Set";
     this.EventSchduleViewId         = Wj1090Module.Services.ViewIdAssign.Wj1090LduEventScheduleViewId;
     this.EventSchduleInstanceDetail = "No Detail";
     EventSchedule            = new EventSchedule();
     this.CreateTime          = DateTime.Now.Ticks;
     this.CreateUserName      = UserInfo.UserLoginInfo.UserName;
     this.NextExcuteTime      = 0;
     this.AlreadyExcutedTimes = 0;
 }
Ejemplo n.º 27
0
        public IHttpActionResult DeleteEventSchedule(int id)
        {
            EventSchedule eventSchedule = db.EventSchedules.Find(id);

            if (eventSchedule == null)
            {
                return(NotFound());
            }

            db.EventSchedules.Remove(eventSchedule);
            db.SaveChanges();

            return(Ok(eventSchedule));
        }
        public async Task <IHttpActionResult> DeleteEventSchedule(int id)
        {
            EventSchedule eventSchedule = await db.EventSchedules.FindAsync(id);

            if (eventSchedule == null)
            {
                return(NotFound());
            }

            db.EventSchedules.Remove(eventSchedule);
            await db.SaveChangesAsync();

            return(Ok(eventSchedule));
        }
Ejemplo n.º 29
0
        public ActionResult Details(int localRetreatScheduleID)
        {
            EventSchedule localRetreatSchedule = _entities.EventSchedules.Single(a => a.ID == localRetreatScheduleID);

            ViewData["LocalRetreatTitle"] = localRetreatSchedule.Event.Title;

            ViewData["MealName"]       = String.Format("{0:d}", localRetreatSchedule.DateTimeFrom) + ' ' + localRetreatSchedule.EventActivity.Name;
            ViewData["LocalRetreatID"] = localRetreatSchedule.EventID;

            var query3 = from localRetreatMealBookings in _entities.EventMealBookings
                         where localRetreatMealBookings.EventScheduleID == localRetreatScheduleID
                         select localRetreatMealBookings.EventRegistration.MemberInfo.Name;

            return(View(query3));
        }
        protected void submitButt_Click(object sender, EventArgs e)
        {
            EventSchedule addNeweventScheduleData = new EventSchedule();

            addNeweventScheduleData.startTime        = startTimeDLL.Text;
            addNeweventScheduleData.endTime          = endTimeDLL.Text;
            addNeweventScheduleData.startDate        = startDateTB.Text;
            addNeweventScheduleData.endDate          = endDateTB.Text;
            addNeweventScheduleData.eventActivity    = eventNameEventTBSchedule.Text;
            addNeweventScheduleData.eventDescription = eventDescriptionTBEventSchedule.Text;
            addNeweventScheduleData.eventId          = currentEventId;
            addNeweventScheduleData.AddNewEventSchedule();

            refreshGv();
        }
Ejemplo n.º 31
0
        public EventScheduleManageModel(EventSchedule eventSchedule)
            : this()
        {
            Id = eventSchedule.Id;

            EventId      = eventSchedule.EventId;
            Location     = eventSchedule.Location;
            TimeStart    = eventSchedule.TimeStart;
            StartDay     = eventSchedule.TimeStart;
            StartHour    = eventSchedule.TimeStart;
            TimeEnd      = eventSchedule.TimeEnd;
            EndDay       = eventSchedule.TimeEnd;
            EndHour      = eventSchedule.TimeEnd;
            MaxAttendees = eventSchedule.MaxAttendees;
        }
Ejemplo n.º 32
0
        // PUT api/Task/5
        public HttpResponseMessage PutTask(EventViewModel task)
        {
            if (ModelState.IsValid)
            {
                var eventTaskList = db.EventTaskLists.Include("Property").Include("Crew").FirstOrDefault(e => e.Id == task.OwnerID);
                if (eventTaskList != null)
                {
                    task.Title = eventTaskList.Property.Name + ", " + eventTaskList.Crew.Name;
                }

                var entity = new EventSchedule
                {
                    Id                  = task.TaskID,
                    Title               = task.Title,
                    StartTime           = task.Start,
                    StartTimezone       = task.StartTimezone,
                    EndTime             = task.End,
                    EndTimezone         = task.EndTimezone,
                    Description         = task.Description,
                    RecurrenceRule      = task.RecurrenceRule,
                    RecurrenceException = task.RecurrenceException,
                    RecurrenceID        = task.RecurrenceID,
                    IsAllDay            = task.IsAllDay,
                    EventTaskListId     = task.OwnerID ?? 0
                };

                db.EventSchedules.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound));
                }

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, new[] { task });
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = task.TaskID }));
                return(response);
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }