예제 #1
0
        public static void InsertDivision(IDivision division)
        {
            CheckWorkBook();
            var attributes = DivisionToAttributes(division);

            var id = new KeyValuePair <string, object>("Division_ID", attributes["Division_ID"]);

            if (Excel.IO.ExcelIOAPIs.IsIDOfWorksheet(FilePath, worksheets[2], id))
            {
                var idColumn = new Dictionary <string, object>()
                {
                    { id.Key, id.Value }
                };
                RowUpdate.Update(FilePath, worksheets[2], idColumn, attributes);
                return;
            }

            RowInsert.Insert(FilePath, worksheets[2], attributes);
        }
예제 #2
0
        public static void InsertTag(ITag tag)
        {
            CheckWorkBook();

            var attributes = TagToAttributes(tag);

            var id = new KeyValuePair <string, object>("Tag_ID", attributes["Tag_ID"]);

            if (Excel.IO.ExcelIOAPIs.IsIDOfWorksheet(FilePath, worksheets[5], id))
            {
                var idColumn = new Dictionary <string, object>()
                {
                    { id.Key, id.Value }
                };
                RowUpdate.Update(FilePath, worksheets[5], idColumn, attributes);
                return;
            }

            RowInsert.Insert(FilePath, worksheets[5], attributes);
        }
예제 #3
0
        public static void InsertAuthor(IAuthor author)
        {
            CheckWorkBook();

            var attributes = AuthorToAttributes(author);

            var id = new KeyValuePair <string, object>("Author_ID", attributes["Author_ID"]);

            if (Excel.IO.ExcelIOAPIs.IsIDOfWorksheet(FilePath, worksheets[1], id))
            {
                var idColumn = new Dictionary <string, object>()
                {
                    { id.Key, id.Value }
                };
                RowUpdate.Update(FilePath, worksheets[1], idColumn, attributes);
                return;
            }

            RowInsert.Insert(FilePath, worksheets[1], attributes);
        }
예제 #4
0
        public static void InsertPublicationType(IPublicationType publicationType)
        {
            CheckWorkBook();

            var attributes = PublicationTypeToAttributes(publicationType);

            var id = new KeyValuePair <string, object>("PublicationType_ID", attributes["PublicationType_ID"]);

            if (Excel.IO.ExcelIOAPIs.IsIDOfWorksheet(FilePath, worksheets[3], id))
            {
                var idColumn = new Dictionary <string, object>()
                {
                    { id.Key, id.Value }
                };
                RowUpdate.Update(FilePath, worksheets[3], idColumn, attributes);
                return;
            }

            RowInsert.Insert(FilePath, worksheets[3], attributes);
        }