Example #1
0
 private void refreshTableInitData()
 {
     if (!File.Exists(data_file_path))
     {
         return;
     }
     data_profile = DBInitDataProfile.fromXMLFile(data_file_path);
     foreach (DBInitData data in data_profile.data_list)
     {
         int row = dgvData.Rows.Add();
         loadDataForRow(row, data);
     }
 }
Example #2
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            if (table == null)
            {
                ExMessageBox.Show(this, "请选择一个数据表再进行操作!");
                return;
            }
            if (data_profile == null)
            {
                data_profile            = DBInitDataProfile.fromXMLFile(data_file_path);
                data_profile.table_name = table.table_name;
            }
            DBInitData data = new DBInitData(table);

            data_profile.data_list.Add(data);
            data_profile.toXmlFile(root_path);
            int row = dgvData.Rows.Add();

            loadDataForRow(row, data);
        }