Пример #1
0
        private void Endofwork_Click(object sender, EventArgs e)
        {
            if (ActionSelectionBox.SelectedIndex >= 0)
            {
                if (NextuserselectionBox.SelectedIndex >= 0)
                {
                    if (!templateok)
                    {
                        object path = fullpath;
                        WordDoc.SaveAs2(ref path);
                        WordDoc.Close(ref miss, ref miss, ref miss);
                        WordApp.Quit(ref miss, ref miss, ref miss);
                    }

                    File file = new File(pathf, DocumentName.Text, NextuserselectionBox.Text, ActionSelectionBox.Text, form2.current.name, NoticeBox.Text);
                    System.IO.File.WriteAllBytes(file.pathtofile, Cryptfunc.AESEncrypt(System.IO.File.ReadAllBytes(file.pathtofile)));
                    Cryptfunc.Loging(file);
                    Cryptfunc.Signing(file);

                    this.Close();
                    form2.UpdateGrid();
                }
                else
                {
                    MessageBox.Show("Choose next user at first!");
                }
            }
            else
            {
                MessageBox.Show("Choose action at first!");
            }
        }
Пример #2
0
        private void DetailsForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (see)
            {
                WordDoc.Close(ref miss, ref miss, ref miss);
                WordApp.Quit(ref miss, ref miss, ref miss);

                System.IO.File.WriteAllBytes(file.pathtofile, Cryptfunc.AESEncrypt(compl));
            }
            form2.UpdateGrid();
        }