Exemplo n.º 1
0
        private void btn_Copy_Click(object sender, EventArgs e)
        {
            CopyForm copyForm = new CopyForm();

            copyForm.Show();//非模态单独窗口
            //copyForm.ShowInTaskbar = false;
            //copyForm.ShowDialog();
        }
        public ActionResult MarkCopy([FromBody] CopyForm copy)
        {
            DBCode res = _access.CheckExercisePermission(copy.ExerciseID, Role.Teacher);

            if (res != DBCode.OK)
            {
                return(HandleDatabaseOutput(res));
            }
            if (IsAnyNull(copy?.user1, copy?.user2, copy?.ExerciseID))
            {
                return(BadRequest("fields are null"));
            }
            return(HandleDatabaseOutput(_access.MarkCopy(copy)));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Copy the given link the the clipboard.
        /// </summary>
        /// <param name="url"></param>
        private void CopyUrl(string url = null)
        {
            if (!ConfigService.Current.NoUrlCopy && !string.IsNullOrEmpty(url))
            {
                Clipboard.SetText(url);

                if (VersionService.GetPlatform() != PlatformType.Windows)
                {
                    var form = new CopyForm(url);

                    form.FormClosed += (s, e) => Application.Exit();
                    form.Show();
                }
            }
        }
Exemplo n.º 4
0
        private void saveWithVoiceStart_Click(object sender, EventArgs e)
        {
            AviManager  aviManager = new AviManager(fileNameText.Text, true);
            VideoStream aviStream  = aviManager.GetVideoStream();

            CopyForm dialog = new CopyForm(0, (int)Math.Floor(aviStream.CountFrames / aviStream.FrameRate));

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                int            startSecond   = dialog.Start;
                int            stopSecond    = dialog.Stop;
                SaveFileDialog saveWithVoice = new SaveFileDialog();
                if (saveWithVoice.ShowDialog() == DialogResult.OK)
                {
                    noticeText.Text = fileNameText.Text + " dosyasinin " + saveWithVoice.FileName.ToString() + " dosyasina d�n�s�m� basladi\r\n";
                    AviManager newFile = aviManager.CopyTo(saveWithVoice.FileName.ToString() + ".avi", startSecond, stopSecond);
                    newFile.Close();
                    noticeText.Text += "...finished.";
                }
            }
            aviManager.Close();
        }
Exemplo n.º 5
0
        public JsonResult HandleAddCopy(EmployeeForm eform)
        {
            var success = false;
            var reason  = "unknown";

            Console.WriteLine(eform.Data);

            CopyForm form = JsonSerializer.Deserialize <CopyForm>(eform.Data);

            try
            {
                var handler = new ConnectionHandler();
                using (MySqlConnection connection = handler.Connection)
                {
                    string sql = "INSERT INTO BookDetails(ISBN, bookCondition, location, availability) " +
                                 "VALUES (@ISBN, @CONDITION, @LOCATION, 'available')";
                    MySqlCommand cmd = new MySqlCommand(sql, connection);

                    cmd.Parameters.AddWithValue("@ISBN", form.ISBN);
                    cmd.Parameters.AddWithValue("@CONDITION", form.Condition);
                    cmd.Parameters.AddWithValue("@LOCATION", form.Location);
                    cmd.ExecuteNonQuery();

                    success = true;
                }
            }
            catch (Exception ex)
            {
                success = false;
                Console.WriteLine(ex);
            }
            if (success)
            {
                reason = "none";
            }

            return(new JsonResult($"{{\"success\":\"{success}\"," +
                                  $"\"reason\":\"{reason}\"}}", new System.Text.Json.JsonSerializerOptions()));
        }
Exemplo n.º 6
0
        private void CopyButton_Click(object sender, EventArgs e)
        {
            try
            {
                CopyForm copyForm = new CopyForm();
                List <FileSystemInfo> checkedfilesAndDirectories = new List <FileSystemInfo>();

                if (isLeftActive)
                {
                    foreach (ListViewItem item in LeftListView.SelectedItems)
                    {
                        if (item.SubItems[2].Text.Equals("<папка>"))
                        {
                            checkedfilesAndDirectories.Add(new DirectoryInfo(Path.Combine(LeftViewRootPath, item.SubItems[0].Text)));
                        }
                        else if (!item.SubItems[0].Text.Equals("..."))
                        {
                            string filename = item.SubItems[0].Text;
                            if (item.SubItems[1].Text != "")
                            {
                                filename = filename + "." + item.SubItems[1].Text;
                            }
                            checkedfilesAndDirectories.Add(new FileInfo(Path.Combine(LeftViewRootPath, filename)));
                        }
                    }
                    if (checkedfilesAndDirectories.Count == 0)
                    {
                        copyForm.Dispose();
                        return;
                    }
                    copyForm.SetParametres(checkedfilesAndDirectories, LeftViewRootPath, RightViewRootPath);
                }
                else
                {
                    foreach (ListViewItem item in RightListView.SelectedItems)
                    {
                        if (item.SubItems[2].Text.Equals("<папка>"))
                        {
                            checkedfilesAndDirectories.Add(new DirectoryInfo(Path.Combine(RightViewRootPath, item.SubItems[0].Text)));
                        }
                        else
                        {
                            string filename = item.SubItems[0].Text;
                            if (item.SubItems[1].Text != "")
                            {
                                filename = filename + "." + item.SubItems[1].Text;
                            }
                            checkedfilesAndDirectories.Add(new FileInfo(Path.Combine(RightViewRootPath, filename)));
                        }
                    }
                    if (checkedfilesAndDirectories.Count == 0)
                    {
                        copyForm.Dispose();
                        return;
                    }
                    copyForm.SetParametres(checkedfilesAndDirectories, RightViewRootPath, LeftViewRootPath);
                }
                copyForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show("FATAL: " + ex.Message + "\n" + ex.StackTrace);
            }
        }
        private void saveWithVoiceStart_Click(object sender, EventArgs e)
        {
            AviManager aviManager = new AviManager(fileNameText.Text, true);
            VideoStream aviStream = aviManager.GetVideoStream();

            CopyForm dialog = new CopyForm(0, (int)Math.Floor(aviStream.CountFrames / aviStream.FrameRate));
            if (dialog.ShowDialog() == DialogResult.OK) {
                int startSecond = dialog.Start;
                int stopSecond = dialog.Stop;
                SaveFileDialog saveWithVoice = new SaveFileDialog();
                if (saveWithVoice.ShowDialog() == DialogResult.OK)
                {
                    noticeText.Text = fileNameText.Text+ " dosyasinin " + saveWithVoice.FileName.ToString() +" dosyasina d�n�s�m� basladi\r\n";
                    AviManager newFile = aviManager.CopyTo(saveWithVoice.FileName.ToString()+".avi", startSecond, stopSecond);
                    newFile.Close();
                    noticeText.Text += "...finished.";
                }
            }
            aviManager.Close();
        }