コード例 #1
0
ファイル: EditWords.cs プロジェクト: symbless/FindingsEditor
        private void EditWords_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Validate(); //Without this code, new data will disappear.
            DataTable dt2 = dt.GetChanges();

            if (dt2 != null)
            {
                //int d;  //For TryParse.
                //foreach (DataRow dr in dt2.Rows)
                //{
                //    if (string.IsNullOrWhiteSpace(dr[0].ToString()) == true)
                //    {
                //        MessageBox.Show("[" + FindingsEditor.Properties.Resources.Number + "]" + FindingsEditor.Properties.Resources.BlankNotAllowed, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); //●●●移植時要変更
                //        e.Cancel = true;
                //        return;
                //    }

                //    if (checkDuplicate(dr[0].ToString()) == Duplication.Duplicated)
                //    {
                //        e.Cancel = true;
                //        return;
                //    }
                //    else if (checkDuplicate(dr[0].ToString()) == Duplication.Error)
                //    {
                //        e.Cancel = true;
                //        return;
                //    }

                //    if (string.IsNullOrWhiteSpace(dr[1].ToString()) == true)
                //    {
                //        MessageBox.Show("[" + FindingsEditor.Properties.Resources.ObjectName + "]" + FindingsEditor.Properties.Resources.BlankNotAllowed, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); //●●●移植時要変更
                //        e.Cancel = true;
                //        return;
                //    }
                //}
                saveDataTable();
                CLocalDB.delWords();
                CLocalDB.getWords();
            }
        }
コード例 #2
0
 public MainForm()
 {
     InitializeComponent();
     initLogin();
     CLocalDB.WriteToLocalDB();  //Write necessary data to DB.localDB
 }