示例#1
0
        private void ListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBoxItem item = ListBox.SelectedItem as ListBoxItem;

            Home.Background = new SolidColorBrush(Colors.Transparent);
            MyFrame.BackStack.Clear();
            MyFrame.Navigate(typeof(HomePage), this, new SuppressNavigationTransitionInfo());
            if (Home.IsSelected)
            {
                HomeEvent?.Invoke();
            }

            else if (Today.IsSelected)
            {
                TodayEvent?.Invoke();
            }

            else if (Upcoming.IsSelected)
            {
                UpcomingEvent?.Invoke();
            }
            else if (Delayed.IsSelected)
            {
                DelayedEvent?.Invoke();
            }
            else if (AssignedToOthers.IsSelected)
            {
                AssignedToOthersEvent?.Invoke();
            }
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            DateTime      dt    = new DateTime();
            string        s     = DateTime.Now.ToString();
            UpcomingEvent xaxxc = new UpcomingEvent();

            xaxxc.Projectname = this.textBox3.Text;
            xaxxc.ProjectID   = this.textBox5.Text;

            xaxxc.Projectarea = this.textBox2.Text;

            xaxxc.ProposedDate = Convert.ToDateTime(this.textBox1.Text);



            //bList.Add(bd);

            AeMployeeRepisotary depkRepof = new AeMployeeRepisotary();

            if (depkRepof.Updatex(xaxxc))
            {
                MessageBox.Show("Update Success", "Update");

                AeMployeeRepisotary ZxRee = new AeMployeeRepisotary();

                List <UpcomingEvent> bList = ZxRee.GetAllUpcomingList();
                this.UpcomingProjectGridView2.DataSource = bList;
            }
            else
            {
                MessageBox.Show("Can Not Update", "Update Error");
            }
        }
示例#3
0
        private void DeleteUser_Click(object sender, EventArgs e)
        {
            DateTime dt = new DateTime();

            UpcomingEvent tasf = new UpcomingEvent();

            tasf.Projectname = this.textBox3.Text;
            tasf.ProjectID   = this.textBox5.Text;

            tasf.Projectarea = this.textBox2.Text;
            String ProjectIdtext = this.textBox5.Text;

            // tasf.ProposedDate = Convert.ToDateTime(this.textBox1.Text);



            //bList.Add(bd);

            AeMployeeRepisotary depkRepof = new AeMployeeRepisotary();

            if (depkRepof.Delete(ProjectIdtext))
            {
                MessageBox.Show("dElete Success", "Update");
                AeMployeeRepisotary accRepo = new AeMployeeRepisotary();

                List <UpcomingEvent> bList = accRepo.GetAllUpcomingList();
                this.UpcomingProjectGridView2.DataSource = bList;
            }
            else
            {
                MessageBox.Show("Can Not dElete", "dElete Error");
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Day,TimeSpan,Location,IsDeleted,TimeDeleted")] UpcomingEvent upcomingEvent)
        {
            if (id != upcomingEvent.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(upcomingEvent);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UpcomingEventExists(upcomingEvent.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(upcomingEvent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            UpcomingEvent card = db.UpcomingEvents.Find(id);

            db.UpcomingEvents.Remove(card);
            db.SaveChanges();
            return(View("EventCards"));
        }
        public async Task <IActionResult> Create([Bind("Id,Title,Day,TimeSpan,Location,IsDeleted,TimeDeleted")] UpcomingEvent upcomingEvent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(upcomingEvent);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(upcomingEvent));
        }
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UpcomingEvent card = db.UpcomingEvents.Find(id);

            if (card == null)
            {
                return(HttpNotFound());
            }
            return(View("EventCards"));
        }
        public ActionResult Edit([Bind(Include = "CardId,CardDate,CardTitle,Expired")] UpcomingEvent card)
        {
            int CardSelected = (from e in db.UpcomingEvents
                                where e.CardId == card.CardId
                                select e.CardId).FirstOrDefault();

            if (ModelState.IsValid)
            {
                db.Entry(card).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("EventCards"));
            }
            return(View(card));
        }
        public ActionResult Edit(int?id)
        {
            int CardSelected = (from e in db.UpcomingEvents
                                where e.CardId == id
                                select e.CardId).FirstOrDefault();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UpcomingEvent card = db.UpcomingEvents.Find(id);

            if (card == null)
            {
                return(HttpNotFound());
            }
            return(View(card));
        }
示例#10
0
        public void ProcessRequest(HttpContext context)
        {
            int projectID = -1;

            if (!string.IsNullOrEmpty(context.Request.QueryString["projectID"]))
            {
                projectID = int.Parse(context.Request.QueryString["projectID"]);
            }
            UpcomingEvent        todayEvent     = new UpcomingEvent();
            List <UpcomingEvent> upcomingEvents = new EventsApplication().GetEventList(DateTime.Now, UserID, projectID, 10);
            int           itemCount             = 0;
            StringBuilder stringBuilder         = new StringBuilder();

            if (upcomingEvents.Count > 0 && upcomingEvents[0].Day == DateTime.Now.Date)
            {
                todayEvent = upcomingEvents[0];
                stringBuilder.AppendFormat("<div class=\"contentTitle cdtitleeventlist\"> {0}</div>", "Today")
                .Append("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"table-advance\">")
                .Append(" <thead><tr><th width=\"110\">Name</th><th>Title</th></tr></thead>")
                .Append("<tbody>");
                for (int i = 0; i < todayEvent.list.Count; i++)
                {
                    itemCount++;
                    SunNet.PMNew.Entity.EventModel.ListView item = todayEvent.list[i];
                    stringBuilder.AppendFormat("<tr {0} class=\"{1}\">", ShowEditEvent(item.ID), i % 2 == 0 ? "" : "whiterow")
                    .AppendFormat("<td width=\"40%\" notAction><img src=\"/images/clock.png\" style=\"vertical-align: middle;\"> {0}</td>", item.Time)
                    .AppendFormat("<td width=\"60%\">{0}</td>", item.Name)
                    .Append("</tr>");
                }
                stringBuilder.Append("</tbody></table>");
            }
            if (itemCount == 0)
            {
                stringBuilder.Append("<div class=\"mainowConbox\" style=\"min-height: 80px;\">")
                .Append("<div class=\"ownothingText\" style=\"color:red\">No scheduled event.</div>")
                .Append("</div>");
            }
            context.Response.Write(stringBuilder.ToString());
            context.Response.End();
        }
示例#11
0
        private void button2_Click(object sender, EventArgs e)
        {
            DateTime      dt = new DateTime();
            string        s  = DateTime.Now.ToString();
            UpcomingEvent bd = new UpcomingEvent();

            bd.Projectname = this.textBox3.Text;
            bd.ProjectID   = this.textBox5.Text;

            bd.Projectarea = this.textBox2.Text;

            bd.ProposedDate = Convert.ToDateTime(this.textBox1.Text);



            //bList.Add(bd);

            AeMployeeRepisotary depkRepo = new AeMployeeRepisotary();

            if (depkRepo.Insert(bd))
            {
                MessageBox.Show("Can  Insert ", "Insert Sucess");

                this.textBox3.Text = "";
                this.textBox2.Text = "";
                this.textBox5.Text = "";
                this.textBox1.Text = "";

                AeMployeeRepisotary accRepo = new AeMployeeRepisotary();

                List <UpcomingEvent> bList = accRepo.GetAllUpcomingList();
                this.UpcomingProjectGridView2.DataSource = bList;
            }
            else
            {
                MessageBox.Show("Can Not Insert ", "Insert Error");
            }
        }
示例#12
0
        public List <UpcomingEvent> GetList(List <EventEntity> eventList, DateTime date, int userId, bool more, int top)
        {
            List <UpcomingEvent> list = new List <UpcomingEvent>();

            if (date.Date == DateTime.Now.Date)
            {
                list.Add(new UpcomingEvent()
                {
                    Day  = date.Date,
                    Date = "Today",
                    list = new List <ListView>()
                });
            }

            int index = 1;

            foreach (EventEntity entity in eventList)
            {
                if (index == top)
                {
                    break;
                }
                index++;
                UpcomingEvent upcomingEvent = list.Find(r => r.Day == entity.FromDay.Date);
                if (upcomingEvent == null)
                {
                    upcomingEvent      = new UpcomingEvent();
                    upcomingEvent.Day  = entity.FromDay.Date;
                    upcomingEvent.Date = string.Format("{0}, {1}",
                                                       upcomingEvent.Day.DayOfWeek.ToString(), upcomingEvent.Day.ToString("MMMM d, yyyy"));
                    upcomingEvent.list = new List <ListView>();
                    upcomingEvent.list.Add(BuilderView(entity, userId));
                    list.Add(upcomingEvent);
                }
                else
                {
                    upcomingEvent.list.Add(BuilderView(entity, userId));
                }
            }
            if (date.Date == DateTime.Now.Date)
            {
                UpcomingEvent upcomingEvent = list.Find(r => r.Day == date.Date);
                if (more)
                {
                    upcomingEvent.MoreDate = eventList[top - 1].FromDay.ToString("MM/dd/yyyy HH:mm");
                }
                else
                {
                    upcomingEvent.MoreDate = "";
                }
            }
            else
            {
                if (more && list.Count > 0)
                {
                    list[0].MoreDate = eventList[top - 1].FromDay.ToString("MM/dd/yyyy HH:mm");
                }
                else
                {
                    if (list.Count > 0)
                    {
                        list[0].MoreDate = "";
                    }
                }
            }
            return(list);
        }