Esempio n. 1
0
		private void butUserQuery_Click(object sender,EventArgs e) {
			if(!Security.IsAuthorized(Permissions.UserQuery)) {
				return;
			}
			if(DataConnection.DBtype==DatabaseType.Oracle) {
				MsgBox.Show(this,"Not allowed while using Oracle.");
				return;
			}
			FormQuery FormQ;
			if(Security.IsAuthorized(Permissions.UserQueryAdmin,true)) {
				FormQ = new FormQuery(null);
				FormQ.ShowDialog();
				SecurityLogs.MakeLogEntry(Permissions.UserQuery,0,"");
			}
			else {
				FormQueryFavorites FormQF = new FormQueryFavorites();
				FormQF.ShowDialog();
				if(FormQF.DialogResult == DialogResult.OK) {
					FormQ=new FormQuery(null,true);
					FormQ.textQuery.Text=FormQF.UserQueryCur.QueryText;
					FormQ.textTitle.Text=FormQF.UserQueryCur.FileName;
					SecurityLogs.MakeLogEntry(Permissions.UserQuery,0,Lan.g(this,"User query form accessed."));
					FormQ.ShowDialog();
				}
			}
		}
Esempio n. 2
0
		private void butFormulate_Click(object sender, System.EventArgs e) {//is now the 'Favorites' button
			FormQueryFavorites FormQF=new FormQueryFavorites();
			FormQF.UserQueryCur=UserQueryCur;
			FormQF.ShowDialog();
			if(FormQF.DialogResult==DialogResult.OK){
				textQuery.Text=FormQF.UserQueryCur.QueryText;
				//grid2.CaptionText=UserQueries.Cur.Description;
				textTitle.Text=FormQF.UserQueryCur.Description;
				UserQueryCur=FormQF.UserQueryCur;
				report=new ReportSimpleGrid();
				report.Query=textQuery.Text;
				SubmitQuery();
				//this.butSaveChanges.Enabled=true;
			}
			else{
				//butSaveChanges.Enabled=false;
			}
		}