private void CreateRegister() { if (KtextTittle.Value == "") { KtextTittle.IsWrong(); return; } if (fileName != "" && fileOriginPath != "") { DatabaseClass.Document videoToAdd = new DatabaseClass.Document { Title = KtextTittle.Value, Url = fileName }; try { videoToAdd.Insert(fileOriginPath); //fatherForm.SearchData(); //Dispose(); } catch (Exception err) { //throw; MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } } }
public documentView(DatabaseClass.Document document) { InitializeComponent(); Documento = document; LabelTitle.Text = Documento.Title; int position = random.Next(0, COLORS_ARRAY.Length); LabelTitle.ForeColor = COLORS_ARRAY[position]; }
private void Dgv_List_SelectionChanged(object sender, EventArgs e) { try { var id = Convert.ToInt32(dgv_List.SelectedRows[0].Cells[0].Value.ToString()); CURRENT_DOCUMENT = new DatabaseClass.Document(id); TextTittle.Text = CURRENT_DOCUMENT.Title; } catch (Exception) { CURRENT_DOCUMENT = null; //MessageBox.Show(error.Message); } }
private void Btn_ConfirmDelete_Click(object sender, EventArgs e) { if (CURRENT_DOCUMENT != null) { try { CURRENT_DOCUMENT.Delete(); CURRENT_DOCUMENT = null; SearchData(); pnl_ConfirmDeleteBack.Visible = false; } catch (Exception err) { new MessageForm(0, err.Message); } } }
public FormDocumentCU(FormDocumentManage fatherForm, DatabaseClass.Document oldVideo) { InitializeComponent(); this.fatherForm = fatherForm; this.oldDocument = oldVideo; fileName = this.oldDocument.Url; fileOriginPath = this.oldDocument.GetFullUrl(); KtextTittle.Value = this.oldDocument.Title; if (fileName != null) { PanelFileChecked.BackColor = Color.PaleGreen; } else { PanelFileChecked.BackColor = Color.LightCoral; } }
private void UpdateRegister() { if (KtextTittle.Value == "") { KtextTittle.IsWrong(); return; } if (fileName != "" && fileOriginPath != "") { DatabaseClass.Document videoToAdd = new DatabaseClass.Document(oldDocument.Id); videoToAdd.Title = KtextTittle.Value; videoToAdd.Url = fileName; try { videoToAdd.Update(oldDocument.Url, fileOriginPath); } catch (Exception err) { MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } } }