Ejemplo n.º 1
0
        private void buttonChange_Click(object sender, EventArgs e)
        {
            if (listViewMain.SelectedItems.Count == 1)
            {
                ManageItems manageItems = new ManageItems(this);
                AES256      AES         = new AES256();

                if (manageItems.CheckInputData() && MessageBox.Show("정말로 변경하시겠습니까?", "질문", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    string[] arrItems = { textBoxSiteName.Text, textBoxSiteAddress.Text, textBoxID.Text, textBoxMemo.Text, textBoxPassword.Text };
                    arrItems[4] = AES.EncryptString(arrItems[4]);

                    foreach (ListViewItem LVI in listViewMain.SelectedItems)
                    {
                        LVI.Text             = arrItems[0];
                        LVI.SubItems[1].Text = arrItems[1];
                        LVI.SubItems[2].Text = arrItems[2];
                        LVI.SubItems[3].Text = arrItems[3];
                        LVI.Tag = arrItems[4];

                        manageItems.Change(LVI.Index, arrItems);
                    }

                    manageItems.SaveFile();
                }
            }
            else
            {
                MessageBox.Show("변경하실 항목을 선택해 주세요.", "오류", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            ManageItems manageItems = new ManageItems(this);
            AES256      AES         = new AES256();

            string[] arrItems = { textBoxSiteName.Text, textBoxSiteAddress.Text, textBoxID.Text, textBoxMemo.Text, textBoxPassword.Text };
            arrItems[4] = AES.EncryptString(arrItems[4]);

            if (manageItems.CheckInputData())
            {
                ListViewItem LVI = new ListViewItem();
                LVI.Text = arrItems[0];
                LVI.SubItems.Add(arrItems[1]);
                LVI.SubItems.Add(arrItems[2]);
                LVI.SubItems.Add(arrItems[3]);
                LVI.Tag = arrItems[4];

                listViewMain.Items.Add(LVI);
                manageItems.Add(arrItems);
                manageItems.SaveFile();
            }
        }