Ejemplo n.º 1
0
		private void btnDelete_Click(object sender, EventArgs e)
		{
			BEQuickReports ds = new BEQuickReports();
			BPGeneratedReports bpMain = new BPGeneratedReports();
			BPGeneratedReportTokens bpTokens = new BPGeneratedReportTokens();
			ds = bpMain.SelectByID(GeneratedReportID);
			ds.Merge(bpTokens.SelectByGeneratedReportID(GeneratedReportID));
			ds.Relations.Add("Rel1",ds.tbl_GeneratedReports.Columns["GeneratedReportID"],ds.tbl_GeneratedReportTokens.Columns["GeneratedReportID"]);
			ds.EnforceConstraints = true;
			ds.tbl_GeneratedReports.FindByGeneratedReportID(GeneratedReportID).Delete();
			bpMain.Update(ds);
			bpTokens.Update(ds);
			btnCancel_Click(null,null);
		}
Ejemplo n.º 2
0
		private bool SaveBaseReport()
		{
			if (txtReportAlias.Text == "")
			{
				lblError2.Visible=true;
				return false;
			}
			else
			{
				lblError2.Visible = false;
				DSQuickReports = new BEQuickReports();
				BEQuickReports.tbl_GeneratedReportsRow reportRow;
				BPGeneratedReports bpReport = new BPGeneratedReports();
				if (GeneratedReportID == 0)
				{
					reportRow = DSQuickReports.tbl_GeneratedReports.Newtbl_GeneratedReportsRow();
					reportRow.DateCreated = DateTime.Now;
					reportRow.CreatedByCompanyUserID = Convert.ToInt32(OryxUser.OryxIdentity.MemberID);
				}
				else
				{
					DSQuickReports = bpReport.SelectAll();
					reportRow = DSQuickReports.tbl_GeneratedReports.FindByGeneratedReportID(GeneratedReportID);
				}
				reportRow.QuickReportID = QuickReportID;
				reportRow.GeneratedReportType = Convert.ToInt32(GeneratedReportType);
				reportRow.GeneratedReportName = txtReportAlias.Text;
				reportRow.GeneralReport = Convert.ToBoolean(Convert.ToInt32(ddlVisibility.SelectedValue));
				reportRow.GeneratedReportActive = true;
				reportRow.DateModified = DateTime.Now;
				reportRow.ModifiedByAdminID = Convert.ToInt32(OryxUser.OryxIdentity.MemberID);
				reportRow.CompanyID = CompanyID;
				if (GeneratedReportID == 0)
				{
					DSQuickReports.tbl_GeneratedReports.Rows.Add(reportRow);
				}
				bpReport.Update(DSQuickReports);
				GeneratedReportID = reportRow.GeneratedReportID;
				return true;
			}
		}
Ejemplo n.º 3
0
		protected void BrowseSelector_Bind()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			ddlBrowseSelect.DataSource = bp.SelectGeneratedReportsByAdminIDQuickReportIDGeneratedReportTypeAndCompanyID(QuickReportID, 1, GlobalCompanyID, Convert.ToInt32(OryxUser.OryxIdentity.MemberID)).tbl_GeneratedReports;
			ddlBrowseSelect.DataTextField = "GeneratedReportName";
			ddlBrowseSelect.DataValueField = "GeneratedReportID";
			ddlBrowseSelect.DataBind();
			//DO no need this line if there is already a default report
			ddlBrowseSelect.Items.Insert(0,new ListItem("Default", "-1"));
		}		
Ejemplo n.º 4
0
		private void FillTextBoxes()
		{
			if (GeneratedReportID != 0)
			{
				BPCompanyAliases bpAliases = new BPCompanyAliases();
				Hashtable aliases = bpAliases.SelectColumnMappings(CompanyID);

				BPGeneratedReports bp = new BPGeneratedReports();
				BPGeneratedReportTokens bpGRT = new BPGeneratedReportTokens();
				BEQuickReports ds = new BEQuickReports();
				ds = bp.SelectByID(GeneratedReportID);
				ds.Merge(bpGRT.SelectByGeneratedReportID(GeneratedReportID));
				BEQuickReports.tbl_GeneratedReportsRow report = ds.tbl_GeneratedReports.FindByGeneratedReportID(GeneratedReportID);
				txtReportAlias.Text = report.GeneratedReportName;
				if (ddlVisibility.Items.FindByValue(Convert.ToInt32(report.GeneralReport).ToString()) != null)
				{
					ddlVisibility.SelectedValue = Convert.ToInt32(report.GeneralReport).ToString();
				}
				QuickReportID = report.QuickReportID;
				GeneratedReportType = (QuickReport.GeneratedReportTypes) report.GeneratedReportType;
				gridDataSource.Fill(ds.tbl_GeneratedReportTokens, aliases);
			}
		}
Ejemplo n.º 5
0
		protected void BindQuickReportsList()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			DSQuickReports = bp.SelectGeneratedReportsByAdminIDQuickReportIDGeneratedReportTypeAndCompanyID(QuickReportID, GeneratedReportType, GlobalCompanyID, Convert.ToInt32(OryxUser.OryxIdentity.MemberID));
			DSQuickReports.tbl_GeneratedReports.DefaultView.Sort = "GeneratedReportName";
		}
Ejemplo n.º 6
0
		private void GetNewDataSet()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			dsBrowseGrid = bp.GenerateReport(Convert.ToInt32(GeneratedReportID), Convert.ToInt32(ddlCompanies.SelectedValue));
			dsBrowseGrid.Tables[0].TableName = "Data";
			dsBrowseGrid.Tables[1].TableName = "Info";

//			ActiveColumn = dsBrowseGrid.Tables["Info"].Rows[0]["ActiveColumn"].ToString();
			LetterColumn = dsBrowseGrid.Tables["Info"].Rows[0]["LetterColumn"].ToString();
			LinkColumn = dsBrowseGrid.Tables["Info"].Rows[0]["LinkColumn"].ToString();

			BuildGrid();
			dgBrowseGrid.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
			dgBrowseGrid.GroupingPageSize = dgBrowseGrid.PageSize;
			BindDataGrid();
		}
Ejemplo n.º 7
0
		private void GetNewDataSet()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			dsBrowseGrid = bp.GenerateReport(Convert.ToInt32(GeneratedReportID),Convert.ToInt32(ddlCompanies.SelectedValue));
			dsBrowseGrid.Tables[0].TableName = "Data";
			dsBrowseGrid.Tables[1].TableName = "Info";

			DataRow[] tmpRow = dsBrowseGrid.Tables["Info"].Select("TokenType=" + Convert.ToInt32(QuickReport.TokenTypes.LetterColumn) + " or TokenType=" + Convert.ToInt32(QuickReport.TokenTypes.LinkLetterColumn));
			if (tmpRow.Length > 0)
			{
				LetterColumn = tmpRow[0]["TokenAlias"].ToString();
			}
			else
			{
				LetterColumn = "";
			}
			tmpRow = dsBrowseGrid.Tables["Info"].Select("TokenType=" + Convert.ToInt32(QuickReport.TokenTypes.LinkColumn) + " or TokenType=" + Convert.ToInt32(QuickReport.TokenTypes.LinkLetterColumn));
			if (tmpRow.Length > 0)
			{
				LinkColumn = tmpRow[0]["TokenAlias"].ToString();
			}
			else
			{
				LinkColumn = "";
			}
			ActiveColumn = "InternalOrderCurrent";

			BuildGrid();
			dgBrowseGrid.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
			dgBrowseGrid.GroupingPageSize = dgBrowseGrid.PageSize;
			BindDataGrid();
		}
Ejemplo n.º 8
0
		protected void BindQuickReportsList()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			DSQuickReports = bp.SelectGeneratedReportsByQuickReportIDAndGeneratedReportTypeAndCompanyUserID(QuickReportTableID, GeneratedReportType,  OryxUser.OryxIdentity.MemberID);
			//filter out all but the the ones this user made.
			DSQuickReports.tbl_GeneratedReports.DefaultView.Sort = "GeneratedReportName";
		}
Ejemplo n.º 9
0
		protected void BrowseSelector_Bind()
		{
			ddlBrowseSelect.SelectedIndex = -1;
			ddlBrowseSelect.Items.Clear();

			BPGeneratedReports bp = new BPGeneratedReports();
			ddlBrowseSelect.DataSource = bp.SelectGeneratedReportsByAdminIDQuickReportIDGeneratedReportTypeAndCompanyID(QuickReportID, 1, GlobalCompanyID, Convert.ToInt32(OryxUser.OryxIdentity.MemberID)).tbl_GeneratedReports;
			ddlBrowseSelect.DataTextField = "GeneratedReportName";
			ddlBrowseSelect.DataValueField = "GeneratedReportID";
			ddlBrowseSelect.DataBind();
			ListItem tmpItem = ddlBrowseSelect.Items.FindByValue(GeneratedReportID.ToString());
			if (tmpItem == null)
			{
				ddlBrowseSelect.Items[0].Selected = true;
			}
			else
			{
				tmpItem.Selected = true;
			}
			GeneratedReportID = Convert.ToInt32(ddlBrowseSelect.SelectedValue);
		}
Ejemplo n.º 10
0
		private void GetNewDataSet()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			dsBrowseGrid = bp.GenerateReport(Convert.ToInt32(GeneratedReportID),Convert.ToInt32(ddlCompanies.SelectedValue));
			dsBrowseGrid.Tables[0].TableName = "Data";
			dsBrowseGrid.Tables[1].TableName = "Info";

//			ActiveColumn = dsBrowseGrid.Tables["Info"].Rows[0]["ActiveColumn"].ToString();
			LetterColumn = dsBrowseGrid.Tables["Info"].Rows[0]["LetterColumn"].ToString();
			LinkColumn = dsBrowseGrid.Tables["Info"].Rows[0]["LinkColumn"].ToString();
			foreach (DataColumn dc in dsBrowseGrid.Tables["Data"].Columns)
			{
				if (dc.ColumnName.ToLower().StartsWith("internal") == true)
				{
					dc.ColumnMapping = MappingType.Hidden;	
				}
			}

			BuildGrid();
			dgBrowseGrid.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
			dgBrowseGrid.GroupingPageSize = dgBrowseGrid.PageSize;
			BindDataGrid();
		}
Ejemplo n.º 11
0
		protected void BrowseSelector_Bind()
		{
			ddlBrowseSelect.Items.Clear();
			BPGeneratedReports bp = new BPGeneratedReports();
			ddlBrowseSelect.DataSource = bp.SelectByAdminIDandQuickReportID(OryxUser.OryxIdentity.MemberID,QuickReportID).tbl_GeneratedReports;
			ddlBrowseSelect.DataTextField = "GeneratedReportName";
			ddlBrowseSelect.DataValueField = "GeneratedReportID";
			ddlBrowseSelect.DataBind();
		}
Ejemplo n.º 12
0
		protected void BrowseSelector_Bind()
		{
			BPGeneratedReports bp = new BPGeneratedReports();
			ddlBrowseSelect.DataSource = bp.SelectGeneratedReportsByQuickReportIDAndGeneratedReportTypeAndCompanyUserID(QuickReportID, Convert.ToInt32(QuickReport.GeneratedReportTypes.Browse), OryxUser.OryxIdentity.MemberID);
//			ddlBrowseSelect.DataSource = bp.SelectByCompanyUserIDandQuickReportIDAndCompanyID(OryxUser.OryxIdentity.MemberID,QuickReportID, CompanyID).tbl_GeneratedReports;
			ddlBrowseSelect.DataTextField = "GeneratedReportName";
			ddlBrowseSelect.DataValueField = "GeneratedReportID";
			ddlBrowseSelect.DataBind();
			//DO no need this line if there is already a default report but as is for the orders index cannot create one.
			ddlBrowseSelect.Items.Insert(0,new ListItem("Default", "-1"));
		}	
Ejemplo n.º 13
0
		protected void BrowseSelector_Bind()
		{
			ddlBrowseSelect.Items.Clear();
			BPGeneratedReports bp = new BPGeneratedReports();
			ddlBrowseSelect.DataSource = bp.SelectGeneratedReportsByQuickReportIDAndGeneratedReportTypeAndCompanyUserID(QuickReportID, Convert.ToInt32(QuickReport.GeneratedReportTypes.Browse), OryxUser.OryxIdentity.MemberID);
//			ddlBrowseSelect.DataSource = bp.SelectByCompanyUserIDandQuickReportID(OryxUser.OryxIdentity.MemberID,QuickReportID).tbl_GeneratedReports;
			ddlBrowseSelect.DataTextField = "GeneratedReportName";
			ddlBrowseSelect.DataValueField = "GeneratedReportID";
			ddlBrowseSelect.DataBind();
		}