Пример #1
0
        private void setUserTopicSheet(Workbook book, List <MeetupUserTopic> list)
        {
            Worksheet      sheet = book.Worksheets.Add("Meetup User Topics");
            WorksheetTable table = sheet.Table;

            WorksheetRow hRow = table.Rows.Add();

            hRow.Cells.Add("user id");
            hRow.Cells.Add("topic id");

            foreach (MeetupUserTopic user_topic in list)
            {
                WorksheetRow row = table.Rows.Add();

                row.Cells.Add(Helper.toString(user_topic.userid));
                row.Cells.Add(Helper.toString(user_topic.topicid));
            }
        }
Пример #2
0
        private void setTopicSheet(Workbook book, List <MeetupTopic> list)
        {
            Worksheet      sheet = book.Worksheets.Add("Meetup Topics");
            WorksheetTable table = sheet.Table;

            WorksheetRow hRow = table.Rows.Add();

            hRow.Cells.Add("id");
            hRow.Cells.Add("name");
            hRow.Cells.Add("urlkey");

            foreach (MeetupTopic topic in list)
            {
                WorksheetRow row = table.Rows.Add();

                row.Cells.Add(Helper.toString(topic.id));
                row.Cells.Add(Helper.toString(topic.name));
                row.Cells.Add(Helper.toString(topic.urlkey));
            }
        }
Пример #3
0
        // This seems to not be used.
        #region Commented out
        //private bool IntersectsWith(int rowXFirst, int columnXFirst, int rowXLast, int columnXLast, int rowYFirst, int columnYFirst, int rowYLast, int columnYLast)
        //{
        //    Rectangle rectX = GetRectangleFromCoordinates(rowXFirst, columnXFirst, rowXLast, columnXLast);
        //    Rectangle rectY = GetRectangleFromCoordinates(rowYFirst, columnYFirst, rowYLast, columnYLast);

        //    return rectX.IntersectsWith(rectY);
        //}
        #endregion // Commented out

        #endregion //Private Methods

        #region OnDispose

        protected override void OnDispose()
        {
            this.selectedTable = null;
            this.selection     = null;
            this.SpreadSheet   = null;
        }
Пример #4
0
 private void OnTableAddedEvent(WorksheetTable table)
 {
     this.SelectedTable = table;
 }
Пример #5
0
        private void setUserSheet(Workbook book, List <MeetupUser> list)
        {
            List <MeetupTopic>     topic_list      = new List <MeetupTopic>();
            List <MeetupUserTopic> user_topic_list = new List <MeetupUserTopic>();

            Worksheet      sheet = book.Worksheets.Add("Meetup User");
            WorksheetTable table = sheet.Table;

            WorksheetRow hRow = table.Rows.Add();

            hRow.Cells.Add("id");
            hRow.Cells.Add("name");
            hRow.Cells.Add("bio");
            hRow.Cells.Add("birthday");
            hRow.Cells.Add("country");
            hRow.Cells.Add("city");
            hRow.Cells.Add("state");
            hRow.Cells.Add("facebook_connection");
            hRow.Cells.Add("gender");
            hRow.Cells.Add("hometown");
            hRow.Cells.Add("joined");
            hRow.Cells.Add("lang");
            hRow.Cells.Add("lat");
            hRow.Cells.Add("lon");
            hRow.Cells.Add("link");
            hRow.Cells.Add("membership_count");
            hRow.Cells.Add("messagable");
            hRow.Cells.Add("messaging_pref");
            hRow.Cells.Add("photo_id");
            hRow.Cells.Add("highres_link");
            hRow.Cells.Add("photo_link");
            hRow.Cells.Add("thumb_link");
            hRow.Cells.Add("status");
            hRow.Cells.Add("visited");
            hRow.Cells.Add("reachable");

            foreach (MeetupUser item in list)
            {
                WorksheetRow row = table.Rows.Add();

                row.Cells.Add(Helper.toString(item.id));
                row.Cells.Add(Helper.toString(item.name));
                row.Cells.Add(Helper.toString(item.bio));
                string birthday = "";
                if (item.birthday != null)
                {
                    if (item.birthday.day > 0)
                    {
                        birthday += item.birthday.day;
                    }
                    if (item.birthday.month > 0)
                    {
                        if (birthday != "")
                        {
                            birthday += "/";
                        }
                        birthday += item.birthday.month;
                    }
                    if (item.birthday.year > 0)
                    {
                        if (birthday != "")
                        {
                            birthday += "/";
                        }
                        birthday += item.birthday.year;
                    }
                }
                row.Cells.Add(Helper.toString(birthday));
                row.Cells.Add(Helper.toString(item.country));
                row.Cells.Add(Helper.toString(item.city));
                row.Cells.Add(Helper.toString(item.state));
                if (item.facebook_connection != null)
                {
                    row.Cells.Add(Helper.toString(item.facebook_connection.status));
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(Helper.toString(item.gender));
                row.Cells.Add(Helper.toString(item.hometown));
                row.Cells.Add(Helper.toDate(item.joined));
                row.Cells.Add(Helper.toString(item.lang));
                row.Cells.Add(Helper.toString(item.lat));
                row.Cells.Add(Helper.toString(item.lon));
                row.Cells.Add(Helper.toString(item.link));
                row.Cells.Add(Helper.toString(item.membership_count));
                row.Cells.Add(Helper.toString(item.messagable));
                row.Cells.Add(Helper.toString(item.messaging_pref));
                if (item.photo != null)
                {
                    row.Cells.Add(Helper.toString(item.photo.photo_id));
                    row.Cells.Add(Helper.toString(item.photo.highres_link));
                    row.Cells.Add(Helper.toString(item.photo.photo_link));
                    row.Cells.Add(Helper.toString(item.photo.thumb_link));
                }
                else
                {
                    row.Cells.Add("");
                    row.Cells.Add("");
                    row.Cells.Add("");
                    row.Cells.Add("");
                }
                row.Cells.Add(Helper.toString(item.status));
                row.Cells.Add(Helper.toDate(item.visited));
                row.Cells.Add(Helper.toString(item.reachable));

                foreach (MeetupTopic topic in item.topics)
                {
                    if (!topic_list.Any(t => t.id == topic.id))
                    {
                        topic_list.Add(topic);
                    }
                    user_topic_list.Add(new MeetupUserTopic()
                    {
                        userid  = item.id,
                        topicid = topic.id
                    });
                }
            }

            setTopicSheet(book, topic_list);
            setUserTopicSheet(book, user_topic_list);
        }