コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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];
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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);
         }
     }
 }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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);
                }
            }
        }