예제 #1
0
        private void BuildHistory()
        {
            //   string year = "year";
            //   string month = "month";
            //   string str = @"<div class=""accordion-group""><div class=""accordion-heading"">";
            //   string str2 = @"<a class=""accordion-toggle"" data-toggle=""collapse"" data-parent=""#accordionHistory"" href=""#collapse" + year + @""">" + year + " </a>";
            //string str3 = @"</div><div id=""collapse"+year+@""" class=""accordion-body collapse""><div class=""accordion-inner"">";
            //string monthacc= @"<div class=""accordion"" id="""+year+@""">"; // startign the months accordion
            //string str33 = @"<div class=""accordion-group""><div class=""accordion-heading""><a class=""accordion-toggle"" data-toggle=""collapse"" data-parent=""#"+year+@""" href=""#"+year+month+@""" onclick="">";
            //string str4 = month + @"</a></div><div id="""+year + month+@""" class=""accordion-body collapse""><div class=""accordion-inner"">information of the inner item";
            //string endmonth = @"</div></div></div></div>";
            //   string endyear = "</div></div></div>";
            // get months and years
            var           result = MeetingClass.getYearMonth();
            StringBuilder text   = new StringBuilder();

            foreach (var r in result)
            {
                text.Append(@"<div class=""accordion-group""><div class=""accordion-heading"">" +
                            @"<a class=""accordion-toggle"" data-toggle=""collapse"" data-parent=""#accordionHistory"" href=""#collapse" + r.Key + @""">" + r.Key + " </a>" +
                            @"</div><div id=""collapse" + r.Key + @""" class=""accordion-body collapse""><div class=""accordion-inner"">" +
                            @"<div class=""accordion"" id=""" + r.Key + @"""><div class=""accordion-group"">");
                foreach (var t in r.Value)
                {
                    text.Append(@"<div class=""accordion-heading""><a class=""accordion-toggle"" data-toggle=""collapse"" data-parent=""#" + r.Key + @""" href=""#" + r.Key + t.ToString() + @""" onclick=""test(this)"">" +
                                t.ToString() + @"</a></div><div id=""" + r.Key + t.ToString() + @""" class=""accordion-body collapse""><div class=""accordion-inner"">information of the inner item" +
                                @"</div></div>");
                }
                text.Append("</div></div></div></div></div>");
            }
            accordionHistory.InnerHtml = text.ToString();
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ddlType.DataSource     = MeetingClass.getMeetingTypes();
     ddlType.DataTextField  = "Type";
     ddlType.DataValueField = "CatID";
     ddlType.DataBind();
     if (Session["cal"] != null)
     {
         if (Convert.ToBoolean(Session["cal"]))
         {
             cbCal.Checked = true;
         }
     }
     if (Session["meet"] != null)
     {
         if (Convert.ToBoolean(Session["meet"]))
         {
             cbMeet.Checked = true;
         }
     }
     if (Session["app"] != null)
     {
         if (Convert.ToBoolean(Session["app"]))
         {
             cbApp.Checked = true;
         }
     }
 }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = User.Identity.Name;
            // notification
            int    num = Notification.GetTotalNumberOfNotifications(username);
            string msg = "";

            if (num == 0)
            {
                msg = "No new updates available";
            }
            else
            {
                msg = "You have " + num + " new Updates";
            }
            NotDiv.InnerText = string.Format(msg, num);


            // meetings
            var    mnum = MeetingClass.GetNumberOfUpcomingMeetings(username);
            string mstr = "";

            if (mnum == 0)
            {
                mstr = "No meetings to attend this month";
            }
            else
            {
                mstr = "You have " + mnum + " meetings to attend this month";
            }
            meetingDiv.InnerText = mstr;
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                username = User.Identity.Name;
                // get the list of upcoming meetings
                var result = MeetingClass.getUpcomingMeetings(User.Identity.Name);
                BuildTags(result, accordion2);
                var month = MeetingClass.getMonthMeetings(User.Identity.Name);
                BuildTags(month, accordionMonth);

                // get a list of years and months and add tags
                BuildHistory();
            }
        }
예제 #5
0
        public static string getInfo(string href)
        {
            // get the year and month
            int year = Convert.ToInt32(href.Substring(0, 4));
            int y;

            if (href.Length == 6)
            {
                y = 2;
            }
            else
            {
                y = 1;
            }
            int month = Convert.ToInt32(href.Substring(4, y));
            // get from db
            var result = MeetingClass.getHistoryMeetings(username, month, year);

            // send back a text
            System.Web.UI.HtmlControls.HtmlGenericControl div = new System.Web.UI.HtmlControls.HtmlGenericControl();
            BuildTags(result, div);
            return(div.InnerHtml);
        }
예제 #6
0
        public IActionResult Create(MeetingClass mc, string Participants, string ParticiNames, string HostName, string HostEmail)
        {
            WebexHostInfo meetingHost = new WebexHostInfo("!!ADD WEBEX HOST EMAIL!!", "!!ADD WEBEX HOST PW!!", "!ADD WEBEX HOST ID!!", "!!ADD WEBEX COMPANY NAME!!");

            List <string> emails           = new List <string>(Participants.Split(','));
            List <string> names            = new List <string>(ParticiNames.Split(','));
            string        startDateTimeStr = mc.MeetingStartDateTime.ToString("MM/dd/yyyy HH:mm:ss");
            string        endDateTimeStr   = mc.MeetingEndDateTime.ToString("MM/dd/yyyy HH:mm:ss");
            Int64         duration         = (Int64)(mc.MeetingEndDateTime - mc.MeetingStartDateTime).TotalMinutes;

            emails.Add(HostEmail);
            emails.Add("!!ADD BOT EMAIL ACCOUNT!!");
            names.Add(HostName);
            names.Add("bot");

            //emails = emails.Select(s => s.Trim());

            for (int i = 0; i < emails.Count; i++)
            {
                emails[i] = emails[i].Trim();
            }

            for (int i = 0; i < names.Count; i++)
            {
                names[i] = names[i].Trim();
            }

            Microsoft.Graph.EmailAddress delegateEmailAddress = new Microsoft.Graph.EmailAddress();
            delegateEmailAddress.Name    = HostName.Trim();
            delegateEmailAddress.Address = HostEmail.Trim();
            var meetingInfo = MeetingController.CreateWebexMeeting(mc.MeetingSubject, names, emails, mc.MeetingStartDateTime, duration.ToString(), meetingHost, delegateEmailAddress);

            mc.WebExID = meetingInfo.AccessCode;

            /*try
             * {C:\repos\Final_Successful\cs319-2019w1-hsbc\WebMVC\Views\
             *  var attendees = MeetingController.GetAttendeeEmails(access_code, meetingHost);
             *  //MeetingController.SendEmailsToAnyUnregisteredUsers(attendees);
             *  //EmailSender.SendEmailForStartURL(attendees, access_code, mc.MeetingSubject);
             * }
             * catch (Exception ex)
             * {
             *  //Console.WriteLine(ex);
             *  Trace.WriteLine(ex);
             * }
             *
             * try
             * {
             *  // TODO warning this part is hardcoded
             *  //SchedulerController.ScheduleTask(access_code, mc.MeetingStartDate, "Main.exe", @"C:\cs319_main");
             * }
             * catch (Exception ex)
             * {
             *
             * }*/

            //_amc.Add(mc);
            //_amc.SaveChanges();
            ViewBag.message = "The Meeting " + mc.MeetingSubject + " Is Saved Successfully!";
            return(View());
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request["id"] != null)
                {
                    // get info
                    try
                    {
                        string username = User.Identity.Name;
                        int    id       = Convert.ToInt32(Request["id"]);
                        if (MeetingClass.CParticipant.isParticipant(id, username))
                        {
                            var evn = MeetingClass.MeetingInfo.GetMeeting(id);
                            tbID.Value    = id.ToString();
                            tbtitle.Value = evn.Title;
                            tbSDate.Value = evn.Start.ToShortDateString();
                            tbEDate.Value = evn.End.ToShortDateString();
                            tbSTime.Value = evn.Start.ToShortTimeString();
                            tbETime.Value = evn.End.ToShortTimeString();
                            tbDesc.Value  = evn.Desc;
                            ClientScriptManager script = Page.ClientScript;

                            // check if the user is allowed

                            script.RegisterClientScriptBlock(this.GetType(), "test", "<script>setMeetingID(" + id + "); </script>");

                            // fill locations
                            var locations = MeetingClass.CResource.GetAvailableLocations(evn.Start, evn.End);
                            if (locations.Count() == 0)
                            {
                                lbLocation.Items.Add("No Location available for this meeting's time and date");
                            }
                            else
                            {
                                lbLocation.DataSource     = locations;
                                lbLocation.DataValueField = "LocationID";
                                lbLocation.DataTextField  = "LocationName";
                                lbLocation.DataBind();
                            }

                            // get discussions
                            var    result    = DiscussionClass.MeetingDiscussion.GetListMeetingDiscussions(id);
                            string disScript = @"<p><a href=""#"" title=""{0}"" onclick=""ShowDiscussion(this); return false;"">{1}</a></p><p class=""pull-right""><b> Created by:</b> {2}<b> On:</b> {3}<b> Replys: </b>{4}</p><hr />";
                            foreach (var t in result)
                            {
                                DiscussionList.InnerHtml += string.Format(disScript, t.ID, t.Title, t.UserName, t.Date.ToString("MM/dd/yyyy | hh:mm:ss"), t.Replies.ToString());
                            }

                            // Privacy fro Agenda
                            if (AgendaClass.AgendaPrivacyClass.CheckRole(username, id, MeetingRoles.Creator))
                            {
                                divAddAgendaTask.Visible = true;
                            }
                            else
                            {
                                divAddAgendaTask.Visible = false;
                            }
                        }
                        else
                        {
                            Response.Redirect("~/Error.aspx");
                        }
                    }
                    catch
                    {
                    }

                    // get participant
                    //var parti = MeetingClass.Participant.getMeetingParticipant(id);
                    //int index = 1;
                    //foreach (var r in parti)
                    //{
                    //    HtmlTableRow row = new HtmlTableRow();
                    //    HtmlTableCell num = new HtmlTableCell();
                    //    num.InnerText = index.ToString();
                    //    row.Cells.Add(num);
                    //    HtmlTableCell user = new HtmlTableCell();
                    //    user.InnerText = r.UserName;
                    //    row.Cells.Add(user);
                    //    HtmlTableCell role = new HtmlTableCell();
                    //    role.InnerText = r.Role;
                    //    row.Cells.Add(role);
                    //    HtmlTableCell res = new HtmlTableCell();
                    //    res.InnerText = r.Response;
                    //    row.Cells.Add(res);
                    //    HtmlTableCell note = new HtmlTableCell();
                    //    note.InnerText = r.Note;
                    //    row.Cells.Add(note);
                    //    HtmlTableCell close = new HtmlTableCell();
                    //    close.InnerHtml = "<a href='#' onclick='return Delete(this)'><span class='icon-x'></span></a>";
                    //    row.Cells.Add(close);

                    //    // add row to table
                    //    parTable.Rows.Add(row);
                    //    index++;
                    //    btnInvite.Visible = true;
                    //}
                }
                else
                {
                    if (!Roles.ChkAdmin(User.Identity.Name))
                    {
                        Response.Redirect("~/Error.aspx");
                    }
                }
                // fill resources
                SetResources();
                // fill MTypes
                ddlMType.DataSource     = MeetingClass.getMeetingTypes();
                ddlMType.DataTextField  = "Type";
                ddlMType.DataValueField = "CatID";
                ddlMType.DataBind();
                // get all participants
                string[] users = ldap.getListOfUsersTemp().OrderBy(a => a).ToArray();
                lbPart.DataSource = users;
                lbPart.DataBind();
                //for (int o = 0; o < users.Count(); o++ )
                //{

                //    //string str = @"<label class=""checkbox""><input type=""checkbox"" id=""chk"" runat=""server"">";
                //    //str += @"<span class=""metro-checkbox"">" + users[o] + "</span></label>";
                //    //if (o < users.Count()/2)
                //    //{
                //    //    divAttendees1.InnerHtml += str;
                //    //}
                //    //else
                //    //{
                //    //    divAttendees2.InnerHtml += str;
                //    //}
                //}
            }
        }