Esempio n. 1
0
        private void Templateredir_Click(object sender, EventArgs e)
        {
            if (TemplateselectionBox.SelectedIndex >= 0)
            {
                switch (TemplateselectionBox.SelectedIndex)
                {
                case 0:
                    new Letterofattorney(fullpath).ShowDialog();
                    break;

                case 1:
                    new Recruitment(fullpath).ShowDialog();
                    break;

                case 2:
                    new Vacation(fullpath).ShowDialog();
                    break;

                default:
                    break;
                }
                if (System.IO.File.Exists(fullpath))
                {
                    Controlfunc.Makeitvisible(Endofwork, Finishlabel1, Finishlabel2, Actionlabel, Nextuserlabel, ActionSelectionBox, NextuserselectionBox, Finishlabel3, NoticeBox);
                    Controlfunc.Makeitinvisible(SelectFolder, Labelforname, DocumentName, Attentionlabel, Createlabel1, Createlabel2, Createlabel3, TemplateselectionBox, Templateredir, NewBlank);
                    templateok = true;
                }
            }
            else
            {
                MessageBox.Show("Select template at first");
            }
        }
Esempio n. 2
0
 private void DocumentName_TextChanged(object sender, EventArgs e)
 {
     if (DocumentName.Text != "" && pathf != null)
     {
         Controlfunc.Makeitvisible(NewBlank, TemplateselectionBox, Createlabel1, Createlabel2, Createlabel3);
     }
     else
     {
         Controlfunc.Makeitinvisible(NewBlank, TemplateselectionBox, Createlabel1, Createlabel2, Createlabel3);
     }
     fullpath        = pathf + "\\" + DocumentName.Text + ".docx";
     Pathtofile.Text = "Path to new file: " + fullpath;
 }
Esempio n. 3
0
        private void NewBlank_Click(object sender, EventArgs e)
        {
            WordApp = new Word.Application
            {
                Visible = true
            };

            object visible = true;

            WordDoc = WordApp.Documents.Add(ref miss, ref newTemplate, ref documentType, ref visible);
            WordDoc.Activate();
            Controlfunc.Makeitvisible(Endofwork, Finishlabel1, Finishlabel2, Actionlabel, Nextuserlabel, ActionSelectionBox, NextuserselectionBox, Finishlabel3, NoticeBox);
            Controlfunc.Makeitinvisible(SelectFolder, Labelforname, DocumentName, Attentionlabel, Createlabel1, Createlabel2, Createlabel3, TemplateselectionBox, Templateredir, NewBlank);
        }
Esempio n. 4
0
        private void EditFile_Click(object sender, EventArgs e)
        {
            WordApp = new Word.Application()
            {
                Visible = true
            };
            System.IO.File.WriteAllBytes(file.pathtofile, Cryptfunc.AESDecrypt(System.IO.File.ReadAllBytes(file.pathtofile)));
            object readOnly = false;
            object path     = file.pathtofile;

            WordDoc = WordApp.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss);
            WordDoc.Activate();

            Controlfunc.Makeitinvisible(EditFile, SeeLogs, Deletefile);
            Controlfunc.Makeitvisible(Chooseuserlabel, Chosenuser, ActionSelectionBox, Actionselectionlabel, NoteBox, Notelabel1, Notelabel2, EndwithoutSave, EndwithSave);
        }
Esempio n. 5
0
        private void Seefile_Click(object sender, EventArgs e)
        {
            WordApp = new Word.Application()
            {
                Visible = true
            };

            compl = Cryptfunc.AESDecrypt(System.IO.File.ReadAllBytes(file.pathtofile));
            System.IO.File.WriteAllBytes(file.pathtofile, compl);
            object readOnly = false;
            object path     = file.pathtofile;

            WordDoc = WordApp.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss);
            WordDoc.Activate();

            Controlfunc.Makeitinvisible(Seefile, Deletefile);
            see = true;
        }
Esempio n. 6
0
        private void SelectFolder_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                pathf = fbd.SelectedPath;
            }
            if (DocumentName.Text != "" && pathf != null)
            {
                Controlfunc.Makeitvisible(NewBlank, TemplateselectionBox, Createlabel1, Createlabel2, Createlabel3);
            }
            else
            {
                Controlfunc.Makeitinvisible(NewBlank, TemplateselectionBox, Createlabel1, Createlabel2, Createlabel3);
            }
            fullpath        = pathf + "\\" + DocumentName.Text + ".docx";
            Pathtofile.Text = "Path to new file: " + fullpath;
        }
Esempio n. 7
0
 public DetailsForm(BeginingForm form1, MiddleForm form2, File file)
 {
     InitializeComponent();
     this.form1 = form1;
     this.form2 = form2;
     this.file  = file;
     this.Text  = "Properties of " + "\"" + this.file.name + "\"";
     if (file.State == "Completed")
     {
         Controlfunc.Makeitinvisible(Finalizedocument, EditFile);
         Seefile.Visible = true;
     }
     else
     {
         if (form2.current.accesslevel != 0 && form2.current.name != file.touser)
         {
             Finalizedocument.Visible = false;
         }
     }
 }