Exemple #1
0
        public static BarButtonItem addSaveQueryDialog(XtraForm form, BarManager barManager, PopupMenu menu, GridControl gridControl, string dataSetID, string masterQueryNoCondition, 
            params ProtocolVN.Framework.Win.SaveQueryDialog.HookAfterExecAdvQuery[] hooks)
        {
            BarButtonItem advancedSearch = HelpControl.addBarButtonItem(barManager, menu, "Tìm kiếm nâng cao");
            advancedSearch.Glyph = FWImageDic.FIND_IMAGE20;
            advancedSearch.ItemClick += delegate(object sender, ItemClickEventArgs e)
            {
                FilterCase obj = new FilterCase(FrameworkParams.currentUser.id, dataSetID, "Truy vấn mới", masterQueryNoCondition);
                SaveQueryDialog q = new SaveQueryDialog(obj, gridControl);
                if (hooks != null && hooks.Length == 1)
                {
                    q.hook = hooks[0];
                }
                q.Owner = form;
                q.Show();
            };

            return advancedSearch;
        }
        void itemSaveFilter_Click(object sender, EventArgs e)
        {
            try
            {
                XtraForm f = (XtraForm)this.GridControl.FindForm();
                if (f != null)
                {
                    FilterCase obj = new FilterCase(FrameworkParams.currentUser.id, this._GetPLGUI(), "Truy vấn mới", this._fullQueryData);
                    SaveQueryDialog q = new SaveQueryDialog(obj, this.GridControl);
                    q.Owner = f;
                    q.Show();
                }
            }
            catch
            {

            }
        }
 /// <summary>
 /// Hiển thị hộp thoại truy vấn nâng cao và cho phép lưu câu truy vấn
 /// </summary>
 public static void showSaveQueryDialog(XtraForm form, String dataSetID, String masterQueryNoCondition, GridControl gridCtrl, bool isModal)
 {
     FilterCase obj = new FilterCase(FrameworkParams.currentUser.id, dataSetID, "Save Query Dialog", masterQueryNoCondition);
     SaveQueryDialog q = new SaveQueryDialog(obj, gridCtrl);
     XtraForm owner = (form == null ? FrameworkParams.MainForm : form);
     q.Owner = owner;
     if (isModal)
     {
         q.ShowDialog();
     }
     else
     {
         q.Show();
     }
 }