Ejemplo n.º 1
0
        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            DocumentForm frm = new DocumentForm();

            frm.MdiParent = this;
            frm.Dock      = DockStyle.Fill;
            frm.Show();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string docID = Guid.NewGuid().ToString();
            string image = @"" + fileUrlTxtBx.Text;

            if (System.IO.File.Exists(image))
            {
                try
                {
                    string filepath   = image;
                    string localPath  = new Uri(filepath).LocalPath;
                    string remotePath = Helper.uploadUrl;

                    WebClient theClient     = new WebClient();
                    byte[]    responseArray = theClient.UploadFile(remotePath, filepath);
                    Console.WriteLine("\nResponse Received.The contents of the file uploaded are:\n{0}", System.Text.Encoding.ASCII.GetString(responseArray));
                    theClient.Dispose();
                }
                catch (Exception c)
                {
                }
            }
            try
            {
                string Query = "INSERT INTO document(documentID, orgID, fileID, name, client, details,fileUrl, created, action,lawyer, sync,note, sizes) VALUES ('" + docID + "','" + Helper.orgID + "','" + this.fileCbx.Text + "','" + image + "','" + clientCbx.Text + "','" + this.fileCbx.Text + "','" + fileUrlTxtBx.Text + "','" + DateTime.Now.Date.ToString("yyyy-MM-dd") + "','create','" + this.lawyerCbx.Text + "','f','" + noteTxt.Text + "','2.0');";
                Helper.Execute(Query, DBConnect.conn);
                MessageBox.Show("Information saved");

                DocumentForm frm = new DocumentForm();
                frm.MdiParent = MainForm.ActiveForm;
                frm.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }