private void lb_Click(object sender, EventArgs e)
 {
     Label lb = sender as Label;
     if (lb.Tag == null) return;
     frmSaveOpen frm = new frmSaveOpen((byte[])lb.Tag, lb.Text);
     HelpProtocolForm.ShowModalDialog(this, frm);
 }
 private void layoutView1_ShownEditor(object sender, EventArgs e)
 {
     if (gridViewMaster.FocusedColumn.Name == ColListFile.Name)
     {
         BaseEdit edt = gridViewMaster.ActiveEditor;
         if (edt != null)
         {
             edt.Cursor = System.Windows.Forms.Cursors.Hand;
             PropertyInfo info = edt.GetType().GetProperty("InnerControl",
                 System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
             if (info != null)
             {
                 object obj = info.GetValue(edt, null);
                 if (obj != null && obj is RichEditControl)
                 {
                     RichEditControl rc = obj as RichEditControl;
                     rc.Options.Hyperlinks.ModifierKeys = Keys.None;
                     rc.Options.Hyperlinks.ShowToolTip = false;
                     rc.HyperlinkClick += delegate(object senderr, HyperlinkClickEventArgs ee)
                     {
                         DataRow fRow = gridViewMaster.GetFocusedDataRow();
                         if (fRow == null) return;
                         DataRow row = dtListFile.Rows.Find(new object[] { fRow["ID"], HelpNumber.ParseInt64(ee.Hyperlink.NavigateUri) });
                         if (row == null) return;
                         frmSaveOpen frm = new frmSaveOpen((byte[])row["NOI_DUNG"], row["TEN_FILE"].ToString());
                         HelpProtocolForm.ShowModalDialog(this, frm);
                         ee.Handled = true;
                     };
                 }
             }
         }
     }
 }
        private void _buttonEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            switch (e.Button.Tag.ToString()) {
                case "Delete":
                    this._PathFile = "";
                    this._buttonEdit.EditValue = null;
                    break;
                case "Get":
                    OpenFileDialog dialog = new OpenFileDialog();
                    dialog.Title = "Chọn tập tin";
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        if (checkSizeFile) {
                            if (!HelpFile.CheckFileSize(dialog.FileName,_SizeFile))
                            {
                                HelpMsgBox._showNotificationMessage("Kích thước file không được vượt quá" + _SizeFile + " MB", false);
                                return;
                            }
                        }
                        this._PathFile = dialog.FileName;
                        string[] temp = dialog.FileName.Split('\\');
                        this._buttonEdit.EditValue = temp[temp.Length - 1];
                    }
                    break;
                case "Open":
                    if (this._PathFile != "")
                        HelpFile.OpenFile(this._PathFile);
                    else {
                        frmSaveOpen frm = new frmSaveOpen(this._Value, this._buttonEdit.EditValue.ToString());
                        HelpProtocolForm.ShowModalDialog((XtraForm)this.FindForm(), frm);
                    }

                    break;
            }
            this.ShowButton(e.Button.Tag.ToString());
        }
 private void lbl_TTDK_Click(object sender, EventArgs e)
 {
     frmSaveOpen frm = new frmSaveOpen(do_Luu_Tru_TT.NOI_DUNG, do_Luu_Tru_TT.TEN_FILE);
     HelpProtocolForm.ShowModalDialog((XtraForm)this.FindForm(), frm);
 }
Example #5
0
 private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     DataRow row = layoutView1.GetDataRow(layoutView1.FocusedRowHandle);
     DOLuuTruTapTin do_tt = DALuuTruTapTin.Instance.Load(HelpNumber.ParseInt64(row["ID"]));
     try
     {
         FWWaitingMsg m = new FWWaitingMsg();
         frmSaveOpen frm = new frmSaveOpen(do_tt.NOI_DUNG, do_tt.TEN_FILE);
         m.Finish();
         HelpProtocolForm.ShowModalDialog(this, frm);
     }
     catch (Exception ex)
     {
         PLException.AddException(ex);
         HelpSysLog.AddException(ex, "");
     }
 }
 private void gridViewTaiLieu_Click(object sender, EventArgs e)
 {
     GridHitInfo gHitInfo = gridViewTaiLieu.CalcHitInfo(gridViewTaiLieu.GridControl.PointToClient(Control.MousePosition));
     if (gHitInfo.InRowCell)//Nếu vị trí click là cell trong row
     {
         if (gHitInfo.Column.FieldName == "TEN_FILE")//Nếu cell được click thuộc _columnField
         {
             FWWaitingMsg m = new FWWaitingMsg();
             frmSaveOpen frm = new frmSaveOpen(DALuuTruTapTin.Instance.Load(HelpNumber.ParseInt64(gridViewTaiLieu.GetDataRow(gridViewTaiLieu.FocusedRowHandle)["TAP_TIN_ID"])).NOI_DUNG, gridViewTaiLieu.GetDataRow(gridViewTaiLieu.FocusedRowHandle)["TEN_FILE"].ToString());
             m.Finish();
             HelpProtocolForm.ShowModalDialog(this, frm);
         }
     }
 }
Example #7
0
        private void gridControlTaiLieu_Click(object sender, EventArgs e)
        {
            DataRow r = layoutView1.GetDataRow(layoutView1.FocusedRowHandle);
            if (r != null)
            {
                LayoutViewHitInfo gHitInfo = layoutView1.CalcHitInfo(layoutView1.GridControl.PointToClient(Control.MousePosition));
                if (gHitInfo.Column == null) return;
                if (gHitInfo.Column.FieldName == "TEN_FILE")//Nếu cell được click thuộc _columnField
                    {
                        FWWaitingMsg m = new FWWaitingMsg();
                        frmSaveOpen frm = new frmSaveOpen(DALuuTruTapTin.Instance.Load(HelpNumber.ParseInt64(layoutView1.GetDataRow(layoutView1.FocusedRowHandle)["ID"])).NOI_DUNG, layoutView1.GetDataRow(layoutView1.FocusedRowHandle)["TEN_FILE"].ToString());
                        m.Finish();
                        HelpProtocolForm.ShowModalDialog(this, frm);
                    }

            }
        }