Example #1
0
        /// <summary>
        /// 保存对类做过的修改
        /// </summary>
        private void SaveChanges()
        {
            try
            {
                CheckValue();
            }
            catch (ArgumentNullException ae)
            {
                MessageBox.Show(ae.Message, "提示", MessageBoxButtons.OK
                                , MessageBoxIcon.Information
                                , MessageBoxDefaultButton.Button1
                                , MessageBoxOptions.DefaultDesktopOnly);
                return;
            }
            catch
            {
                throw;
            }

            GridColumnStyleCollection styleCollection = new GridColumnStyleCollection();

            if (lvColumnStyles.Items.Count > 0)
            {
                foreach (ListViewItem item in lvColumnStyles.Items)
                {
                    styleCollection.Add(new GridColumnStyle(item.Text
                                                            , item.SubItems[1].Text
                                                            , Convert.ToInt32(item.SubItems[2].Text, CultureInfo.CurrentCulture)));
                }
            }
            _wordbook = new SqlWordbook(tBoxName.Text.Trim()
                                        , tBoxQuery.Text.Trim()
                                        , tBoxCodeField.Text.Trim()
                                        , tBoxNameField.Text.Trim()
                                        , styleCollection
                                        , tBoxFilter.Text.Trim());
        }