示例#1
0
		public static string ExportGridColumns(string sGRID_NAME)
		{
			StringBuilder sbSQL = new StringBuilder();
			UniqueStringCollection arrSelectFields = new UniqueStringCollection();
			// 05/03/2011   Always include the ID as it might be used by the Export code to filter by selected items. 
            arrSelectFields.Add("ID");

			GridColumns(sGRID_NAME, arrSelectFields, null);

			// 04/20/2011   If there are no fields in the GridView.Export, then return all fields (*). 
			if ( arrSelectFields.Count > 1 )
			{
				foreach ( string sField in arrSelectFields )
				{
					if ( sbSQL.Length > 0 )
						sbSQL.Append("     , ");
					sbSQL.AppendLine(sField);
				}
			}
			else
			{
				sbSQL.AppendLine("*");
			}
			return sbSQL.ToString();
		}
示例#2
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.Load += new System.EventHandler(this.Page_Load);
     m_sMODULE = "TQClientAddress";
     SetMenu(m_sMODULE);
     // 02/08/2008   We need to build a list of the fields used by the search clause. 
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("ID");
 }
示例#3
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     arrSelectFields            = new UniqueStringCollection();
     arrSelectFields.Add("DATE_MODIFIED");
     arrSelectFields.Add("NOTE_ID");
     this.AppendGridColumns(grdMain, "ProductTemplates.Notes", arrSelectFields);
     if (IsPostBack)
     {
         ctlDynamicButtons.AppendButtons("ProductTemplates.Notes", Guid.Empty, Guid.Empty);
     }
 }
示例#4
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.Load += new System.EventHandler(this.Page_Load);
     //ctlSearchView.Command += new CommandEventHandler(Page_Command);
     //ctlExportHeader.Command += new CommandEventHandler(Page_Command);
     // 11/26/2005   Add fields early so that sort events will get called. 
     m_sMODULE = "TQClientAddress";
     SetMenu(m_sMODULE);
     // 02/08/2008   We need to build a list of the fields used by the search clause. 
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("ID");
 }
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     m_sMODULE = "Invoices";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_ENTERED");
     arrSelectFields.Add("INVOICE_ID");
     arrSelectFields.Add("ASSIGNED_USER_ID");
     this.AppendGridColumns(grdMain, "Payments." + m_sMODULE, arrSelectFields);
     if (IsPostBack)
         ctlDynamicButtons.AppendButtons("Payments." + m_sMODULE, Guid.Empty, Guid.Empty);
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     // ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     ctlSearchView.Command = new CommandEventHandler(Page_Command);
     m_sMODULE = "ProductTemplates";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("NAME");
     this.AppendGridColumns(grdMain, m_sMODULE + ".PopupView", arrSelectFields);
     // ctlDynamicButtons.AppendButtons(m_sMODULE + ".PopupView", Guid.Empty, Guid.Empty);
     // if (!IsPostBack)
     //     ctlDynamicButtons.ShowButton("Clear", !TypeConvert.ToBoolean(Request["ClearDisabled"]));
 }
示例#7
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     //ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     ctlSearchView.Command = new CommandEventHandler(Page_Command);
     m_sMODULE             = "ProductCatalog";
     arrSelectFields       = new UniqueStringCollection();
     arrSelectFields.Add("NAME");
     this.AppendGridColumns(grdMain, m_sMODULE + ".PopupView", arrSelectFields);
     //ctlDynamicButtons.AppendButtons(m_sMODULE + ".PopupView", Guid.Empty, Guid.Empty);
     //if (!IsPostBack)
     //    ctlDynamicButtons.ShowButton("Clear", !TypeConvert.ToBoolean(Request["ClearDisabled"]));
 }
示例#8
0
		public static void SearchGridColumns(string sGRID_NAME, UniqueStringCollection arrSelectFields)
		{
			StringCollection arrSkippedFields = new StringCollection();
			arrSkippedFields.Add("USER_NAME"    );
			arrSkippedFields.Add("ASSIGNED_TO"  );
			arrSkippedFields.Add("CREATED_BY"   );
			arrSkippedFields.Add("MODIFIED_BY"  );
			arrSkippedFields.Add("DATE_ENTERED" );
			arrSkippedFields.Add("DATE_MODIFIED");
			arrSkippedFields.Add("TEAM_NAME"    );
			arrSkippedFields.Add("TEAM_SET_NAME");
			GridColumns(sGRID_NAME, arrSelectFields, arrSkippedFields);
		}
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     m_sMODULE       = "ProductTemplates";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_ENTERED");
     arrSelectFields.Add("PRODUCT_TEMPLATE_ID");
     this.AppendGridColumns(grdMain, "ProductTemplates.RelatedProducts", arrSelectFields);
     if (IsPostBack)
     {
         ctlDynamicButtons.AppendButtons("ProductTemplates.RelatedProducts", Guid.Empty, Guid.Empty);
     }
 }
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     m_sMODULE       = "Payments";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_ENTERED");
     arrSelectFields.Add("ID");
     this.AppendGridColumns(grdMain, m_sMODULE + ".PaymentTransactions", arrSelectFields);
     if (IsPostBack)
     {
         ctlDynamicButtons.AppendButtons(m_sMODULE + ".PaymentTransactions", Guid.Empty, Guid.Empty);
     }
 }
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     m_sMODULE       = "Invoices";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_ENTERED");
     arrSelectFields.Add("INVOICE_ID");
     arrSelectFields.Add("ASSIGNED_USER_ID");
     this.AppendGridColumns(grdMain, "Payments." + m_sMODULE, arrSelectFields);
     if (IsPostBack)
     {
         ctlDynamicButtons.AppendButtons("Payments." + m_sMODULE, Guid.Empty, Guid.Empty);
     }
 }
示例#12
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     m_sMODULE = "ProductTemplates";
     SetMenu(m_sMODULE);
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("NAME");
     this.AppendGridColumns(grdMain, m_sMODULE + ".ListView", arrSelectFields);
     ctlSearchView.Command   = new CommandEventHandler(Page_Command);
     ctlExportHeader.Command = new CommandEventHandler(Page_Command);
     ctlMassUpdate.Command   = new CommandEventHandler(Page_Command);
     if (CRMSecurity.GetUserAccess(m_sMODULE, "delete") < 0 && CRMSecurity.GetUserAccess(m_sMODULE, "edit") < 0)
     {
         ctlMassUpdate.Visible = false;
     }
 }
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtonsOpen.Command    += new CommandEventHandler(Page_Command);
     ctlDynamicButtonsHistory.Command += new CommandEventHandler(Page_Command);
     m_sMODULE       = "Calls";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_MODIFIED");
     arrSelectFields.Add("ACTIVITY_ID");
     arrSelectFields.Add("ACTIVITY_TYPE");
     arrSelectFields.Add("ACTIVITY_ASSIGNED_USER_ID");
     arrSelectFields.Add("IS_OPEN");
     arrSelectFields.Add("DATE_DUE");
     arrSelectFields.Add("STATUS");
     arrSelectFields.Add("DIRECTION");
     this.AppendGridColumns(grdOpen, "Invoices.Activities.Open", arrSelectFields);
     this.AppendGridColumns(grdHistory, "Invoices.Activities.History", arrSelectFields);
     if (IsPostBack)
     {
         ctlDynamicButtonsOpen.AppendButtons("Invoices.Activities.Open", Guid.Empty, Guid.Empty);
         ctlDynamicButtonsHistory.AppendButtons("Invoices.Activities.History", Guid.Empty, Guid.Empty);
     }
 }
示例#14
0
 public void ConfigureResolver()
 {
     UniqueStringCollection strings = new UniqueStringCollection(this._query.AllFileReferences.Concat<string>(PluginAssembly.GetCompatibleAssemblies(this._query.IsMyExtensions)), new FileNameComparer());
     if (this._query.Repository != null)
     {
         strings.AddRange(this._query.Repository.GetDriverAssemblies());
     }
     UniqueStringCollection strings2 = new UniqueStringCollection(this._query.AdditionalGACReferences);
     if (!(this._query.IsMyExtensions || (MyExtensions.Query == null)))
     {
         strings.AddRange(MyExtensions.Query.AllFileReferences);
         strings2.AddRange(MyExtensions.Query.AdditionalGACReferences);
     }
     bool flag = ((this._query.Repository != null) && this._query.Repository.DriverLoader.IsValid) && (this._query.Repository.DriverLoader.Driver is LinqToSqlDynamicDriver);
     string fileOrPath = this._typeResolver.Configure(strings, strings2, (this._query.Repository != null) && !this._query.Repository.DynamicSchema, flag);
     if (((fileOrPath != null) && (this._query.Repository != null)) && this._query.Repository.DynamicSchema)
     {
         this._typeResolver.set_DataContextBuilding(false);
         if ((this._query.Repository.IntellicachePath == null) || (this._query.Repository.IntellicachePath.FullPath != fileOrPath))
         {
             this._query.Repository.IntellicachePath = new TempFileRef(fileOrPath);
         }
     }
 }
示例#15
0
		// 03/01/2014   Add Preview button. 
		public void AppendGridColumns(string sGRID_NAME, UniqueStringCollection arrSelectFields, CommandEventHandler Page_Command)
		{
			SplendidDynamic.AppendGridColumns(sGRID_NAME, this, arrSelectFields, Page_Command);
		}
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     m_sMODULE = "ProductTemplates";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_ENTERED");
     arrSelectFields.Add("PRODUCT_TEMPLATE_ID");
     this.AppendGridColumns(grdMain, "ProductTemplates.RelatedProducts", arrSelectFields);
     if (IsPostBack)
         ctlDynamicButtons.AppendButtons("ProductTemplates.RelatedProducts", Guid.Empty, Guid.Empty);
 }
示例#17
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.Load += new System.EventHandler(this.Page_Load);
     //ctlSearchView.Command += new CommandEventHandler(Page_Command);
     //ctlExportHeader.Command += new CommandEventHandler(Page_Command);
     // 11/26/2005   Add fields early so that sort events will get called. 
     m_sMODULE = "TQMyFavorite";
     SetMenu(m_sMODULE);
     // 02/08/2008   We need to build a list of the fields used by the search clause. 
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("ID");
     this.AppendGridColumns(grdMain, m_sMODULE + "." + LayoutListView, arrSelectFields);
     grdMain.ItemCommand += grdMain_ItemCommand;
 }
示例#18
0
		public static void AppendGridColumns(string sGRID_NAME, DataGrid grd, UniqueStringCollection arrSelectFields)
		{
			AppendGridColumns(sGRID_NAME, grd, arrSelectFields, null);
		}
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     m_sMODULE = "Products";
     SetMenu(m_sMODULE);
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("ID");
     arrSelectFields.Add("NAME");
     this.AppendGridColumns(grdMain, m_sMODULE + ".ListView", arrSelectFields);
     ctlSearchView.Command = new CommandEventHandler(Page_Command);
     ctlExportHeader.Command = new CommandEventHandler(Page_Command);
     ctlMassUpdate.Command = new CommandEventHandler(Page_Command);
     if (CRMSecurity.GetUserAccess(m_sMODULE, "delete") < 0 && CRMSecurity.GetUserAccess(m_sMODULE, "edit") < 0)
         ctlMassUpdate.Visible = false;
 }
示例#20
0
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.Page_Load);
			ctlSearchView.Command += new CommandEventHandler(Page_Command);
			m_sMODULE = "BusinessRules";
			SetMenu(m_sMODULE);
			arrSelectFields = new UniqueStringCollection();
			arrSelectFields.Add("NAME");
			this.AppendGridColumns(grdMain, m_sMODULE + "." + LayoutListView, arrSelectFields);
		}
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     ctlDynamicButtonsOpen.Command += new CommandEventHandler(Page_Command);
     ctlDynamicButtonsHistory.Command += new CommandEventHandler(Page_Command);
     m_sMODULE = "Calls";
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("DATE_MODIFIED");
     arrSelectFields.Add("ACTIVITY_ID");
     arrSelectFields.Add("ACTIVITY_TYPE");
     arrSelectFields.Add("ACTIVITY_ASSIGNED_USER_ID");
     arrSelectFields.Add("IS_OPEN");
     arrSelectFields.Add("DATE_DUE");
     arrSelectFields.Add("STATUS");
     arrSelectFields.Add("DIRECTION");
     this.AppendGridColumns(grdOpen, "Invoices.Activities.Open", arrSelectFields);
     this.AppendGridColumns(grdHistory, "Invoices.Activities.History", arrSelectFields);
     if (IsPostBack)
     {
         ctlDynamicButtonsOpen.AppendButtons("Invoices.Activities.Open", Guid.Empty, Guid.Empty);
         ctlDynamicButtonsHistory.AppendButtons("Invoices.Activities.History", Guid.Empty, Guid.Empty);
     }
 }
示例#22
0
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.Page_Load);
			ctlSearchView  .Command += new CommandEventHandler(Page_Command);
			ctlExportHeader.Command += new CommandEventHandler(Page_Command);
            m_sMODULE = "TQAccount";
			SetMenu(m_sMODULE);
			arrSelectFields = new UniqueStringCollection();
            arrSelectFields.Add("ID");
            arrSelectFields.Add("C_UserID");
            arrSelectFields.Add("C_Status");
			arrSelectFields.Add("isCompanyAdmin");
			this.AppendGridColumns(grdMain, m_sMODULE + "." + LayoutListView, arrSelectFields);

            grdMain.ItemCommand += grdMain_ItemCommand;
		}
示例#23
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.Load += new System.EventHandler(this.Page_Load);
     ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
     ctlSearchView.Command += new CommandEventHandler(Page_Command);
     ctlCheckAll.Command += new CommandEventHandler(Page_Command);
     m_sMODULE = "TQClient";
     // 07/26/2007   Use the new PopupView so that the view is customizable. 
     // 02/08/2008   We need to build a list of the fields used by the search clause. 
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("C_ClientShortName");
     // 08/01/2010   We need a separate view to select the Full Name instead of the User Name. 
     this.AppendGridColumns(grdMain, m_sMODULE + ".PopupView" + (Sql.ToString(Request["C_ClientShortName"]) == "1" ? "Name" : ""), arrSelectFields);
     // 04/29/2008   Make use of dynamic buttons. 
     ctlDynamicButtons.AppendButtons(m_sMODULE + ".Popup" + (bMultiSelect ? "MultiSelect" : "View"), Guid.Empty, Guid.Empty);
     if (!IsPostBack && !bMultiSelect)
         ctlDynamicButtons.ShowButton("Clear", !Sql.ToBoolean(Request["ClearDisabled"]));
 }
示例#24
0
        private void Extract(TagArchive archive, bool recusive, params string[] files)
        {
            extractionActive = true;
            int totalFilesExtracted = 0, totalFilesToExtract = 0;

            List <TagSet> sets = archive.BuildTagLocationList(files, currentGame);

            // Setup the counts.
            foreach (TagSet set in sets)
            {
                totalFilesToExtract += set.Tags.Count;
            }

            progressPanel.TotalExtracted = 0;
            progressPanel.TagCount       = totalFilesToExtract;

            UniqueStringCollection additionalFiles = new UniqueStringCollection();

            try
            {
                foreach (TagSet set in sets)
                {
                    string filename = currentGame.Maps[set.MapIndex].Filename;

                    // UI Update
                    progressPanel.CurrentMap = Path.GetFileName(filename);

                    progressPanel.CurrentMap = filename;
                    progressPanel.OpeningMap = true;
                    IMapFile map = currentGame.CreateMapFileObject();
                    map.Load(currentGame.MapFilePath + "\\" + filename);

                    progressPanel.ExtractingTags = true;
                    // Sort alphabetically so that folders don't get extracted out of order.
                    set.Tags.Sort();

                    // Extract the tags one by one.
                    foreach (string tag in set.Tags)
                    {
                        // UI Update
                        progressPanel.CurrentTag = tag;
                        bool successful = true;
                        try
                        {
                            // Check and see if we have attempted to cancel...
                            if (!extractionActive)
                            {
                                return;
                            }

                            if (!archive.FileExists(tag))
                            {
                                byte[] data = map.GetTag(tag);
                                archive.AddFile(tag, data);
                            }
                        }
                        catch (Exception ex)
                        {
                            successful = false;
                            Output.Write(OutputTypes.Error, "Unable to extract tag '" + tag + ex.Message);
                        }
                        if (successful)
                        {
                            RemoveFromQueue(tag);
                        }
                        totalFilesExtracted++;

                        // UI Update
                        progressPanel.TotalExtracted = totalFilesExtracted;

                        if (recusive)
                        {
                            // Attempt to deserialize the tag, and get its dependencies.
                            string   tagExtension = Path.GetExtension(tag).Trim('.');
                            Type     tagType      = currentGame.TypeTable.LocateEntryByName(tagExtension).TagType;
                            TagPath  poolPath     = new TagPath(tag, currentGame.GameID, TagLocation.Archive);
                            string[] dependencies = Core.Prometheus.Instance.Pool.GetTagReferences(poolPath.ToPath(), tagType);
                            foreach (string dependency in dependencies)
                            {
                                if (!archive.FileExists(dependency))
                                {
                                    additionalFiles.Add(dependency);
                                }
                            }
                        }
                    }
                }
                if (additionalFiles.Count > 0)
                {
                    progressPanel.Title = "Extracting dependencies...";
                    // Extract the additional files.
                    Extract(archive, true, additionalFiles.ToArray());
                }
            }
            finally
            {
                UpdateExtractionButton();
            }
        }
示例#25
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.Load += new System.EventHandler(this.Page_Load);
     // 11/26/2005   Add fields early so that sort events will get called. 
     m_sMODULE = "TQOrderDetailSell";
     SetMenu(m_sMODULE);
     // 02/08/2008   We need to build a list of the fields used by the search clause. 
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("ID");
     arrSelectFields.Add("C_Status");
     arrSelectFields.Add("C_CarID");
     arrSelectFields.Add("C_ShippingUrl");
     arrSelectFields.Add("C_Driver");
     arrSelectFields.Add("C_Tel");
     this.AppendGridColumns(grdMain, m_sMODULE + "." + LayoutListView, arrSelectFields);
 }
示例#26
0
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.Page_Load);
			ctlSearchView  .Command += new CommandEventHandler(Page_Command);
			ctlExportHeader.Command += new CommandEventHandler(Page_Command);
			// 11/26/2005   Add fields early so that sort events will get called. 
			m_sMODULE = "UserLogins";
			SetMenu("Users");
			// 02/08/2008   We need to build a list of the fields used by the search clause. 
			arrSelectFields = new UniqueStringCollection();
			arrSelectFields.Add("FULL_NAME");
			// 02/21/2008   IS_ADMIN is used in the grid. 
			arrSelectFields.Add("IS_ADMIN");
			arrSelectFields.Add("DATE_MODIFIED");
			this.AppendGridColumns(grdMain, "Users.LoginView", arrSelectFields);
		}
示例#27
0
		// 04/20/2011   Create a new method so that we can get export field. 
		public static void GridColumns(string sGRID_NAME, UniqueStringCollection arrSelectFields, StringCollection arrSkippedFields)
		{
			DataTable dt = SplendidCache.GridViewColumns(sGRID_NAME);
			if ( dt != null )
			{
				// 01/18/2010   To apply ACL Field Security, we need to know if the Module Name, which we will extract from the EditView Name. 
				string sMODULE_NAME = String.Empty;
				string[] arrGRID_NAME = sGRID_NAME.Split('.');
				if ( arrGRID_NAME.Length > 0 )
				{
					if ( arrGRID_NAME[0] == "ListView" || arrGRID_NAME[0] == "PopupView" || arrGRID_NAME[0] == "Activities" )
						sMODULE_NAME = arrGRID_NAME[0];
					// 01/18/2010   A sub-panel should apply the access rules of the related module. 
					else if ( Sql.ToBoolean(HttpContext.Current.Application["Modules." + arrGRID_NAME[1] + ".Valid"]) )
						sMODULE_NAME = arrGRID_NAME[1];
					else
						sMODULE_NAME = arrGRID_NAME[0];
				}
				foreach(DataRow row in dt.Rows)
				{
					string sCOLUMN_TYPE = Sql.ToString (row["COLUMN_TYPE"]);
					string sDATA_FIELD  = Sql.ToString (row["DATA_FIELD" ]);
					string sDATA_FORMAT = Sql.ToString (row["DATA_FORMAT"]);
					
					// 04/20/2011   Export requests will not exclude any fields. 
					if ( arrSkippedFields != null )
					{
						if ( arrSkippedFields.Contains(sDATA_FIELD) || sDATA_FIELD.EndsWith("_ID") || sDATA_FIELD.EndsWith("_CURRENCY") )
							continue;
					}
					
					// 01/18/2010   A field is either visible or not.  At this time, we will not only show a field to its owner. 
					bool bIsReadable  = true;
					if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sDATA_FIELD) )
					{
						Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty);
						bIsReadable  = acl.IsReadable();
					}
					
					if ( bIsReadable )
					{
						if ( String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0 )
						{
							if ( String.Compare(sDATA_FORMAT, "HyperLink", true) == 0 )
							{
								if ( !Sql.IsEmptyString(sDATA_FIELD) )
									arrSelectFields.Add(sDATA_FIELD);
							}
						}
						else if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 )
						{
							// 09/23/2010   Add the bound field. 
							if ( !Sql.IsEmptyString(sDATA_FIELD) )
								arrSelectFields.Add(sDATA_FIELD);
						}
					}
				}
			}
		}
示例#28
0
        public void Start()
        {
            ThreadStart start = null;
            object      obj2;
            QueryCore   core;

            lock ((obj2 = this._locker))
            {
                core = this._query;
                if ((core == null) || this._cancelRequest)
                {
                    return;
                }
                if (this._executionProgress != LINQPad.ExecutionModel.ExecutionProgress.Starting)
                {
                    throw new InvalidOperationException("Cannot call Start twice on Client");
                }
            }
            if ((core.QueryKind == QueryLanguage.SQL) || (core.QueryKind == QueryLanguage.ESQL))
            {
                if (this._compileOnly)
                {
                    this.OnQueryCompleted("", "");
                }
                else
                {
                    lock ((obj2 = this._locker))
                    {
                        this._executionProgress = LINQPad.ExecutionModel.ExecutionProgress.Executing;
                    }
                    Server server = this._serverGenerator(this);
                    lock ((obj2 = this._locker))
                    {
                        if (this._cancelRequest || (server == null))
                        {
                            return;
                        }
                        if (this._server != server)
                        {
                            this.ClearServer();
                        }
                        this._server = server;
                    }
                    server.WriteResultsToGrids = core.ToDataGrids && (core.QueryKind == QueryLanguage.SQL);
                    UniqueStringCollection source = new UniqueStringCollection(new FileNameComparer());
                    if (core.GetDriver(true) != null)
                    {
                        try
                        {
                            source.AddRange(core.Repository.GetDriverAssemblies());
                            if (!((core.QueryKind != QueryLanguage.ESQL) || string.IsNullOrEmpty(core.Repository.CustomAssemblyPath)))
                            {
                                source.Add(core.Repository.CustomAssemblyPath);
                            }
                        }
                        catch
                        {
                        }
                    }
                    server.ExecuteSqlQuery(core.QueryKind, core.Repository, this._source, source.ToArray <string>(), this, this._pluginWinManager);
                }
            }
            else if ((core.Repository != null) && core.Repository.DynamicSchema)
            {
                lock ((obj2 = this._locker))
                {
                    this._executionProgress = LINQPad.ExecutionModel.ExecutionProgress.AwaitingDataContext;
                }
                DataContextManager.GetDataContextInfo(core.Repository, new DataContextCallback(this.GotDataContext), SchemaChangeTestMode.None);
            }
            else
            {
                if (start == null)
                {
                    start = () => this.CompileAndRun(null);
                }
                new Thread(start)
                {
                    Name = "Query Compiler", IsBackground = true
                }.Start();
            }
        }
示例#29
0
		// 02/08/2008   We need to build a list of the fields used by the search clause. 
		protected void AppendGridColumns(SplendidGrid grd, string sGRID_NAME, UniqueStringCollection arrSelectFields)
		{
			// 11/17/2007   Convert all view requests to a mobile request if appropriate.
			sGRID_NAME = sGRID_NAME + (this.IsMobile ? ".Mobile" : "");
			grd.AppendGridColumns(sGRID_NAME, arrSelectFields);
		}
示例#30
0
		// 02/08/2008   We need to build a list of the fields used by the dynamic grid. 
		public void AppendGridColumns(string sGRID_NAME, UniqueStringCollection arrSelectFields)
		{
			SplendidDynamic.AppendGridColumns(sGRID_NAME, this, arrSelectFields, null);
		}
示例#31
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);
			ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
			ctlSearchView    .Command += new CommandEventHandler(Page_Command);
			ctlNewRecord     .Command += new CommandEventHandler(Page_Command);
			ctlCheckAll      .Command += new CommandEventHandler(Page_Command);
			m_sMODULE = "BusinessRules";
			arrSelectFields = new UniqueStringCollection();
			arrSelectFields.Add("NAME");
			this.AppendGridColumns(grdMain, m_sMODULE + ".PopupView", arrSelectFields);
			ctlDynamicButtons.AppendButtons(m_sMODULE + ".Popup" + (bMultiSelect ? "MultiSelect" : "View"), Guid.Empty, Guid.Empty);
			if ( !IsPostBack && !bMultiSelect )
				ctlDynamicButtons.ShowButton("Clear", !Sql.ToBoolean(Request["ClearDisabled"]));
		}
示例#32
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);
			ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
			ctlSearchView    .Command += new CommandEventHandler(Page_Command);
			m_sMODULE = "DynamicLayout";
			arrSelectFields = new UniqueStringCollection();
			arrSelectFields.Add("DETAIL_NAME");
			this.AppendGridColumns(grdMain, m_sMODULE + ".DetailView.PopupView", arrSelectFields);
			ctlDynamicButtons.AppendButtons(m_sMODULE + ".PopupView", Guid.Empty, Guid.Empty);
		}
        public static void AppendGridColumns(string sGRID_NAME, DataGrid grd, UniqueStringCollection arrSelectFields)
        {
            if (grd == null)
            {
                return;
            }
            DataTable dt = CRMCache.GridViewColumns(sGRID_NAME);
            if (dt != null)
            {
                DataView dv = dt.DefaultView;
                dv.Sort = "COLUMN_INDEX";

                bool bEnableTeamManagement = Common.Config.enable_team_management();
                foreach (DataRowView row in dv)
                {
                    int nCOLUMN_INDEX = TypeConvert.ToInteger(row["COLUMN_INDEX"]);
                    string sCOLUMN_TYPE = TypeConvert.ToString(row["COLUMN_TYPE"]);
                    string sHEADER_TEXT = TypeConvert.ToString(row["HEADER_TEXT"]);
                    string sSORT_EXPRESSION = TypeConvert.ToString(row["SORT_EXPRESSION"]);
                    string sITEMSTYLE_WIDTH = TypeConvert.ToString(row["ITEMSTYLE_WIDTH"]);
                    string sITEMSTYLE_CSSCLASS = TypeConvert.ToString(row["ITEMSTYLE_CSSCLASS"]);
                    string sITEMSTYLE_HORIZONTAL_ALIGN = TypeConvert.ToString(row["ITEMSTYLE_HORIZONTAL_ALIGN"]);
                    string sITEMSTYLE_VERTICAL_ALIGN = TypeConvert.ToString(row["ITEMSTYLE_VERTICAL_ALIGN"]);
                    bool bITEMSTYLE_WRAP = TypeConvert.ToBoolean(row["ITEMSTYLE_WRAP"]);
                    string sDATA_FIELD = TypeConvert.ToString(row["DATA_FIELD"]);
                    string sDATA_FORMAT = TypeConvert.ToString(row["DATA_FORMAT"]);
                    string sURL_FIELD = TypeConvert.ToString(row["URL_FIELD"]);
                    string sURL_FORMAT = TypeConvert.ToString(row["URL_FORMAT"]);
                    string sURL_TARGET = TypeConvert.ToString(row["URL_TARGET"]);
                    string sLIST_NAME = TypeConvert.ToString(row["LIST_NAME"]);

                    string sURL_MODULE = TypeConvert.ToString(row["URL_MODULE"]);

                    string sURL_ASSIGNED_FIELD = TypeConvert.ToString(row["URL_ASSIGNED_FIELD"]);

                    if (arrSelectFields != null)
                    {
                        arrSelectFields.Add(sDATA_FIELD);
                        if (!TypeConvert.IsEmptyString(sSORT_EXPRESSION))
                            arrSelectFields.Add(sSORT_EXPRESSION);
                        if (!TypeConvert.IsEmptyString(sURL_FIELD))
                        {
                            if (sURL_FIELD.IndexOf(' ') >= 0)
                                arrSelectFields.AddRange(sURL_FIELD.Split(' '));
                            else
                                arrSelectFields.Add(sURL_FIELD);
                            if (!TypeConvert.IsEmptyString(sURL_ASSIGNED_FIELD))
                                arrSelectFields.Add(sURL_ASSIGNED_FIELD);
                        }
                    }

                    HorizontalAlign eHorizontalAlign = HorizontalAlign.NotSet;
                    switch (sITEMSTYLE_HORIZONTAL_ALIGN.ToLower())
                    {
                        case "left": eHorizontalAlign = HorizontalAlign.Left; break;
                        case "right": eHorizontalAlign = HorizontalAlign.Right; break;
                    }
                    VerticalAlign eVerticalAlign = VerticalAlign.NotSet;
                    switch (sITEMSTYLE_VERTICAL_ALIGN.ToLower())
                    {
                        case "top": eVerticalAlign = VerticalAlign.Top; break;
                        case "middle": eVerticalAlign = VerticalAlign.Middle; break;
                        case "bottom": eVerticalAlign = VerticalAlign.Bottom; break;
                    }

                    if (row["ITEMSTYLE_WRAP"] == DBNull.Value)
                        bITEMSTYLE_WRAP = true;
                    DataGridColumn col = null;

                    if (String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0
                      && (String.Compare(sDATA_FORMAT, "Date", true) == 0
                          || String.Compare(sDATA_FORMAT, "DateTime", true) == 0
                          || String.Compare(sDATA_FORMAT, "Currency", true) == 0
                          || String.Compare(sDATA_FORMAT, "Image", true) == 0
                         )
                       )
                    {
                        sCOLUMN_TYPE = "TemplateColumn";
                    }
                    if (String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0)
                    {
                        if (TypeConvert.IsEmptyString(sLIST_NAME))
                        {

                            BoundColumn bnd = new BoundColumn();
                            bnd.HeaderText = sHEADER_TEXT;
                            bnd.DataField = sDATA_FIELD;
                            bnd.SortExpression = sSORT_EXPRESSION;
                            bnd.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH);
                            bnd.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS;
                            bnd.ItemStyle.HorizontalAlign = eHorizontalAlign;
                            bnd.ItemStyle.VerticalAlign = eVerticalAlign;
                            bnd.ItemStyle.Wrap = bITEMSTYLE_WRAP;

                            bnd.HeaderStyle.HorizontalAlign = eHorizontalAlign;
                            col = bnd;
                        }
                        else
                        {

                            TemplateColumn tpl = new TemplateColumn();
                            tpl.HeaderText = sHEADER_TEXT;
                            tpl.SortExpression = sSORT_EXPRESSION;
                            tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH);
                            tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS;
                            tpl.ItemStyle.HorizontalAlign = eHorizontalAlign;
                            tpl.ItemStyle.VerticalAlign = eVerticalAlign;
                            tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP;

                            tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign;
                            tpl.ItemTemplate = new CreateItemTemplateLiteralList(sDATA_FIELD, sLIST_NAME);
                            col = tpl;
                        }
                    }
                    else if (String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0)
                    {

                        TemplateColumn tpl = new TemplateColumn();
                        tpl.HeaderText = sHEADER_TEXT;
                        tpl.SortExpression = sSORT_EXPRESSION;
                        tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH);
                        tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS;
                        tpl.ItemStyle.HorizontalAlign = eHorizontalAlign;
                        tpl.ItemStyle.VerticalAlign = eVerticalAlign;
                        tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP;

                        tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign;
                        if (String.Compare(sDATA_FORMAT, "HyperLink", true) == 0)
                        {

                            if (sURL_FIELD.IndexOf(' ') >= 0)
                                tpl.ItemTemplate = new CreateItemTemplateHyperLinkOnClick(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD);
                            else
                                tpl.ItemTemplate = new CreateItemTemplateHyperLink(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD);
                        }
                        else if (String.Compare(sDATA_FORMAT, "Image", true) == 0)
                        {
                            tpl.ItemTemplate = new CreateItemTemplateImage(sDATA_FIELD, sITEMSTYLE_CSSCLASS);
                        }
                        else
                        {
                            tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS;
                            tpl.ItemTemplate = new CreateItemTemplateLiteral(sDATA_FIELD, sDATA_FORMAT);
                        }
                        col = tpl;
                    }
                    else if (String.Compare(sCOLUMN_TYPE, "HyperLinkColumn", true) == 0)
                    {

                        HyperLinkColumn lnk = new HyperLinkColumn();
                        lnk.HeaderText = sHEADER_TEXT;
                        lnk.DataTextField = sDATA_FIELD;
                        lnk.SortExpression = sSORT_EXPRESSION;
                        lnk.DataNavigateUrlField = sURL_FIELD;
                        lnk.DataNavigateUrlFormatString = sURL_FORMAT;
                        lnk.Target = sURL_TARGET;
                        lnk.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH);
                        lnk.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS;
                        lnk.ItemStyle.HorizontalAlign = eHorizontalAlign;
                        lnk.ItemStyle.VerticalAlign = eVerticalAlign;
                        lnk.ItemStyle.Wrap = bITEMSTYLE_WRAP;

                        lnk.HeaderStyle.HorizontalAlign = eHorizontalAlign;
                        col = lnk;
                    }
                    if (col != null)
                    {

                        if (sDATA_FIELD == "TEAM_NAME" && !bEnableTeamManagement)
                        {
                            col.Visible = false;
                        }

                        if (nCOLUMN_INDEX >= grd.Columns.Count)
                            grd.Columns.Add(col);
                        else
                            grd.Columns.AddAt(nCOLUMN_INDEX, col);
                    }
                }
            }
        }
示例#34
0
 public void Start()
 {
     ThreadStart start = null;
     object obj2;
     QueryCore core;
     lock ((obj2 = this._locker))
     {
         core = this._query;
         if ((core == null) || this._cancelRequest)
         {
             return;
         }
         if (this._executionProgress != LINQPad.ExecutionModel.ExecutionProgress.Starting)
         {
             throw new InvalidOperationException("Cannot call Start twice on Client");
         }
     }
     if ((core.QueryKind == QueryLanguage.SQL) || (core.QueryKind == QueryLanguage.ESQL))
     {
         if (this._compileOnly)
         {
             this.OnQueryCompleted("", "");
         }
         else
         {
             lock ((obj2 = this._locker))
             {
                 this._executionProgress = LINQPad.ExecutionModel.ExecutionProgress.Executing;
             }
             Server server = this._serverGenerator(this);
             lock ((obj2 = this._locker))
             {
                 if (this._cancelRequest || (server == null))
                 {
                     return;
                 }
                 if (this._server != server)
                 {
                     this.ClearServer();
                 }
                 this._server = server;
             }
             server.WriteResultsToGrids = core.ToDataGrids && (core.QueryKind == QueryLanguage.SQL);
             UniqueStringCollection source = new UniqueStringCollection(new FileNameComparer());
             if (core.GetDriver(true) != null)
             {
                 try
                 {
                     source.AddRange(core.Repository.GetDriverAssemblies());
                     if (!((core.QueryKind != QueryLanguage.ESQL) || string.IsNullOrEmpty(core.Repository.CustomAssemblyPath)))
                     {
                         source.Add(core.Repository.CustomAssemblyPath);
                     }
                 }
                 catch
                 {
                 }
             }
             server.ExecuteSqlQuery(core.QueryKind, core.Repository, this._source, source.ToArray<string>(), this, this._pluginWinManager);
         }
     }
     else if ((core.Repository != null) && core.Repository.DynamicSchema)
     {
         lock ((obj2 = this._locker))
         {
             this._executionProgress = LINQPad.ExecutionModel.ExecutionProgress.AwaitingDataContext;
         }
         DataContextManager.GetDataContextInfo(core.Repository, new DataContextCallback(this.GotDataContext), SchemaChangeTestMode.None);
     }
     else
     {
         if (start == null)
         {
             start = () => this.CompileAndRun(null);
         }
         new Thread(start) { Name = "Query Compiler", IsBackground = true }.Start();
     }
 }
示例#35
0
 private void GetAssemblyReferenceMap(out FileWithVersionInfo[] volatileRefs, out FileWithVersionInfo[] nonvolatileRefs)
 {
     string fileName = null;
     UniqueStringCollection strings = new UniqueStringCollection(base.AllFileReferences, new FileNameComparer());
     strings.AddRange(PluginAssembly.GetCompatibleAssemblies(base.IsMyExtensions));
     if ((base.Repository != null) && !base.Repository.DynamicSchema)
     {
         strings.Add(base.Repository.CustomAssemblyPath);
         strings.AddRange(base.Repository.GetDriverAssemblies());
         if (base.Repository.DriverLoader.IsValid && (base.Repository.DriverLoader.InternalID == null))
         {
             try
             {
                 fileName = Path.GetFileName(base.Repository.DriverLoader.GetAssemblyPath());
             }
             catch
             {
             }
         }
     }
     List<FileWithVersionInfo> list = new List<FileWithVersionInfo>();
     List<string> assemblyFilePaths = new List<string>();
     foreach (string str2 in strings)
     {
         try
         {
             if (Path.IsPathRooted(str2) && File.Exists(str2))
             {
                 if (!(ShadowAssemblyManager.IsShadowable(str2) && !Path.GetFileName(str2).Equals(fileName, StringComparison.OrdinalIgnoreCase)))
                 {
                     list.Add(new FileWithVersionInfo(str2));
                 }
                 else
                 {
                     assemblyFilePaths.Add(str2);
                 }
             }
         }
         catch
         {
         }
     }
     nonvolatileRefs = (from r in list
         orderby r.FilePath
         select r).ToArray<FileWithVersionInfo>();
     volatileRefs = AssemblyProber.GetSameFolderAssemblyReferenceChain(assemblyFilePaths);
 }
示例#36
0
 /// <summary>
 ///		Required method for Designer support - do not modify
 ///		the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.Load += new System.EventHandler(this.Page_Load);
     m_sMODULE = "TQQuoteCheck";
     SetMenu(m_sMODULE);
     // 02/08/2008   We need to build a list of the fields used by the search clause. 
     arrSelectFields = new UniqueStringCollection();
     arrSelectFields.Add("ID");
     arrSelectFields.Add("C_Status");
     this.AppendGridColumns(grdMain, m_sMODULE + "." + LayoutListView, arrSelectFields);
     grdMain.ItemCommand += grdMain_ItemCommand;
 }
示例#37
0
		// 02/08/2008   We need to build a list of the fields used by the dynamic grid. 
		// 03/01/2014   Add Preview button. 
		public static void AppendGridColumns(string sGRID_NAME, DataGrid grd, UniqueStringCollection arrSelectFields, CommandEventHandler Page_Command)
		{
			if ( grd == null )
			{
				SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), "DataGrid is not defined for " + sGRID_NAME);
				return;
			}
			DataTable dt = SplendidCache.GridViewColumns(sGRID_NAME);
			if ( dt != null )
			{
				// 01/01/2008   Pull config flag outside the loop. 
				bool bEnableTeamManagement = Crm.Config.enable_team_management();
				// 08/28/2009   Allow dynamic teams to be turned off. 
				bool bEnableDynamicTeams   = Crm.Config.enable_dynamic_teams();
				foreach(DataRow row in dt.Rows)
				{
					int    nCOLUMN_INDEX               = Sql.ToInteger(row["COLUMN_INDEX"              ]);
					string sCOLUMN_TYPE                = Sql.ToString (row["COLUMN_TYPE"               ]);
					string sHEADER_TEXT                = Sql.ToString (row["HEADER_TEXT"               ]);
					string sSORT_EXPRESSION            = Sql.ToString (row["SORT_EXPRESSION"           ]);
					string sITEMSTYLE_WIDTH            = Sql.ToString (row["ITEMSTYLE_WIDTH"           ]);
					string sITEMSTYLE_CSSCLASS         = Sql.ToString (row["ITEMSTYLE_CSSCLASS"        ]);
					string sITEMSTYLE_HORIZONTAL_ALIGN = Sql.ToString (row["ITEMSTYLE_HORIZONTAL_ALIGN"]);
					string sITEMSTYLE_VERTICAL_ALIGN   = Sql.ToString (row["ITEMSTYLE_VERTICAL_ALIGN"  ]);
					bool   bITEMSTYLE_WRAP             = Sql.ToBoolean(row["ITEMSTYLE_WRAP"            ]);
					string sDATA_FIELD                 = Sql.ToString (row["DATA_FIELD"                ]);
					string sDATA_FORMAT                = Sql.ToString (row["DATA_FORMAT"               ]);
					string sURL_FIELD                  = Sql.ToString (row["URL_FIELD"                 ]);
					string sURL_FORMAT                 = Sql.ToString (row["URL_FORMAT"                ]);
					string sURL_TARGET                 = Sql.ToString (row["URL_TARGET"                ]);
					string sLIST_NAME                  = Sql.ToString (row["LIST_NAME"                 ]);
					// 04/28/2006   The module is necessary in order to determine if a user has access. 
					string sURL_MODULE                 = Sql.ToString (row["URL_MODULE"                ]);
					// 05/02/2006   The assigned user id is necessary if the user only has Owner access. 
					string sURL_ASSIGNED_FIELD         = Sql.ToString (row["URL_ASSIGNED_FIELD"        ]);
					// 02/16/2010   Add MODULE_TYPE so that we can lookup custom field IDs. 
					string sMODULE_TYPE = String.Empty;
					try
					{
						sMODULE_TYPE = Sql.ToString (row["MODULE_TYPE"]);
					}
					catch(Exception ex)
					{
						// 06/16/2010   The MODULE_TYPE is not in the view, then log the error and continue. 
						SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex);
					}
					// 10/09/2010   Add PARENT_FIELD so that we can establish dependent listboxes. 
					string sPARENT_FIELD = String.Empty;
					try
					{
						sPARENT_FIELD = Sql.ToString (row["PARENT_FIELD"]);
					}
					catch(Exception ex)
					{
						// 10/09/2010   The PARENT_FIELD is not in the view, then log the error and continue. 
						SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex);
					}

					if ( (sDATA_FIELD == "TEAM_NAME" || sDATA_FIELD == "TEAM_SET_NAME") )
					{
						if ( bEnableTeamManagement && bEnableDynamicTeams )
						{
							sHEADER_TEXT = ".LBL_LIST_TEAM_SET_NAME";
							sDATA_FIELD  = "TEAM_SET_NAME";
						}
					}
					// 02/08/2008   We need to build a list of the fields used by the dynamic grid. 
					if ( arrSelectFields != null )
					{
						// 08/02/2010   The JavaScript and Hover fields will not have a data field. 
						if ( !Sql.IsEmptyString(sDATA_FIELD) )
							arrSelectFields.Add(sDATA_FIELD);
						if ( !Sql.IsEmptyString(sSORT_EXPRESSION) )
							arrSelectFields.Add(sSORT_EXPRESSION);
						if ( !Sql.IsEmptyString(sURL_FIELD) )
						{
							// 08/02/2010   We want to allow Terminology fields, so exclude anything with a "."
							if ( sURL_FIELD.IndexOf(' ') >= 0 )
							{
								string[] arrURL_FIELD = sURL_FIELD.Split(' ');
								foreach ( string s in arrURL_FIELD )
								{
									if ( !s.Contains(".") && !Sql.IsEmptyString(s) )
										arrSelectFields.Add(s);
								}
							}
							else if ( !sURL_FIELD.Contains(".") )
								arrSelectFields.Add(sURL_FIELD);
							if ( !Sql.IsEmptyString(sURL_ASSIGNED_FIELD) )
								arrSelectFields.Add(sURL_ASSIGNED_FIELD);
						}
						// 10/09/2010   Add PARENT_FIELD so that we can establish dependent listboxes. 
						if ( !Sql.IsEmptyString(sPARENT_FIELD) )
							arrSelectFields.Add(sPARENT_FIELD);
					}
					
					HorizontalAlign eHorizontalAlign = HorizontalAlign.NotSet;
					switch ( sITEMSTYLE_HORIZONTAL_ALIGN.ToLower() )
					{
						case "left" :  eHorizontalAlign = HorizontalAlign.Left ;  break;
						case "right":  eHorizontalAlign = HorizontalAlign.Right;  break;
					}
					VerticalAlign eVerticalAlign = VerticalAlign.NotSet;
					switch ( sITEMSTYLE_VERTICAL_ALIGN.ToLower() )
					{
						case "top"   :  eVerticalAlign = VerticalAlign.Top   ;  break;
						case "middle":  eVerticalAlign = VerticalAlign.Middle;  break;
						case "bottom":  eVerticalAlign = VerticalAlign.Bottom;  break;
					}
					// 11/28/2005   Wrap defaults to true. 
					if ( row["ITEMSTYLE_WRAP"] == DBNull.Value )
						bITEMSTYLE_WRAP = true;

					// 01/18/2010   To apply ACL Field Security, we need to know if the Module Name, which we will extract from the EditView Name. 
					string sMODULE_NAME = String.Empty;
					string[] arrGRID_NAME = sGRID_NAME.Split('.');
					if ( arrGRID_NAME.Length > 0 )
					{
						if ( arrGRID_NAME[0] == "ListView" || arrGRID_NAME[0] == "PopupView" || arrGRID_NAME[0] == "Activities" )
							sMODULE_NAME = arrGRID_NAME[0];
						// 01/18/2010   A sub-panel should apply the access rules of the related module. 
						else if ( Sql.ToBoolean(HttpContext.Current.Application["Modules." + arrGRID_NAME[1] + ".Valid"]) )
							sMODULE_NAME = arrGRID_NAME[1];
						else
							sMODULE_NAME = arrGRID_NAME[0];
					}
					// 01/18/2010   A field is either visible or not.  At this time, we will not only show a field to its owner. 
					bool bIsReadable  = true;
					// 08/02/2010   The JavaScript and Hover fields will not have a data field. 
					if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sDATA_FIELD) )
					{
						Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty);
						bIsReadable  = acl.IsReadable();
					}

					DataGridColumn col = null;
					// 02/03/2006   Date and Currency must always be handled by CreateItemTemplateLiteral. 
					// Otherwise, the date or time will not get properly translated to the correct timezone. 
					// This bug was reported by David Williams. 
					// 05/20/2009   We need a way to preserve CRLF in description fields. 
					if (     String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 
					  && (   String.Compare(sDATA_FORMAT, "Date"       , true) == 0 
					      || String.Compare(sDATA_FORMAT, "DateTime"   , true) == 0 
					      || String.Compare(sDATA_FORMAT, "Currency"   , true) == 0
					      || String.Compare(sDATA_FORMAT, "Image"      , true) == 0
					      || String.Compare(sDATA_FORMAT, "MultiLine"  , true) == 0
					     )
					   )
					{
						sCOLUMN_TYPE = "TemplateColumn";
					}
					// 03/14/2014   A hidden field does not render.  It is primarily used to add a field to the SQL select list for Business Rules management. 
					else if ( String.Compare(sCOLUMN_TYPE, "Hidden", true) == 0 )
					{
						continue;
					}
					if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 )
					{
						if ( Sql.IsEmptyString(sLIST_NAME) )
						{
							// GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH
							BoundColumn bnd = new BoundColumn();
							bnd.HeaderText                  = sHEADER_TEXT       ;
							bnd.DataField                   = sDATA_FIELD        ;
							bnd.SortExpression              = sSORT_EXPRESSION   ;
							bnd.ItemStyle.Width             = new Unit(sITEMSTYLE_WIDTH);
							bnd.ItemStyle.CssClass          = sITEMSTYLE_CSSCLASS;
							bnd.ItemStyle.HorizontalAlign   = eHorizontalAlign   ;
							bnd.ItemStyle.VerticalAlign     = eVerticalAlign     ;
							bnd.ItemStyle.Wrap              = bITEMSTYLE_WRAP    ;
							// 04/13/2007   Align the headers to match the data. 
							bnd.HeaderStyle.HorizontalAlign = eHorizontalAlign   ;
							col = bnd;
							// 01/18/2010   Apply ACL Field Security. 
							col.Visible = bIsReadable;
							// 10/23/2012 Kevin.  Allow me to pass data format for gridview bound columns. 
							if ( !Sql.IsEmptyString(sDATA_FORMAT) )
							{
								bnd.DataFormatString = sDATA_FORMAT;
							}
						}
						else
						{
							// GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH
							TemplateColumn tpl = new TemplateColumn();
							tpl.HeaderText                  = sHEADER_TEXT       ;
							tpl.SortExpression              = sSORT_EXPRESSION   ;
							tpl.ItemStyle.Width             = new Unit(sITEMSTYLE_WIDTH);
							tpl.ItemStyle.CssClass          = sITEMSTYLE_CSSCLASS;
							tpl.ItemStyle.HorizontalAlign   = eHorizontalAlign   ;
							tpl.ItemStyle.VerticalAlign     = eVerticalAlign     ;
							tpl.ItemStyle.Wrap              = bITEMSTYLE_WRAP    ;
							// 04/13/2007   Align the headers to match the data. 
							tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign   ;
							// 10/09/2010   Add PARENT_FIELD so that we can establish dependent listboxes. 
							tpl.ItemTemplate = new CreateItemTemplateLiteralList(sDATA_FIELD, sLIST_NAME, sPARENT_FIELD);
							col = tpl;
							// 01/18/2010   Apply ACL Field Security. 
							col.Visible = bIsReadable;
						}
					}
					else if ( String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0 )
					{
						// GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH
						TemplateColumn tpl = new TemplateColumn();
						tpl.HeaderText                  = sHEADER_TEXT       ;
						tpl.SortExpression              = sSORT_EXPRESSION   ;
						tpl.ItemStyle.Width             = new Unit(sITEMSTYLE_WIDTH);
						tpl.ItemStyle.CssClass          = sITEMSTYLE_CSSCLASS;
						tpl.ItemStyle.HorizontalAlign   = eHorizontalAlign   ;
						tpl.ItemStyle.VerticalAlign     = eVerticalAlign     ;
						tpl.ItemStyle.Wrap              = bITEMSTYLE_WRAP    ;
						// 04/13/2007   Align the headers to match the data. 
						tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign   ;
						if ( String.Compare(sDATA_FORMAT, "JavaScript", true) == 0 )
						{
							// 08/02/2010   In our application of Field Level Security, we will hide fields by replacing with "."
							if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sURL_FIELD) )
							{
								string[] arrURL_FIELD = sURL_FIELD.Split(' ');
								for ( int i=0; i < arrURL_FIELD.Length; i++ )
								{
									Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty);
									if ( !acl.IsReadable() )
										arrURL_FIELD[i] = ".";
								}
								sURL_FIELD = String.Join(" ", arrURL_FIELD);
							}
							tpl.ItemTemplate = new CreateItemTemplateJavaScript(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET);
						}
						// 02/26/2014   Add Preview button. 
						else if ( String.Compare(sDATA_FORMAT, "JavaImage", true) == 0 )
						{
							if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sURL_FIELD) )
							{
								string[] arrURL_FIELD = sURL_FIELD.Split(' ');
								for ( int i=0; i < arrURL_FIELD.Length; i++ )
								{
									Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty);
									if ( !acl.IsReadable() )
										arrURL_FIELD[i] = ".";
								}
								sURL_FIELD = String.Join(" ", arrURL_FIELD);
							}
							tpl.ItemTemplate = new CreateItemTemplateJavaScriptImage(sURL_FIELD, sURL_FORMAT, sURL_TARGET);
						}
						// 03/01/2014   Add Preview button. 
						else if ( String.Compare(sDATA_FORMAT, "ImageButton", true) == 0 )
						{
							// 03/01/2014   sURL_FIELD is an internal value, so there is no need to apply ACL rules. 
							tpl.ItemTemplate = new CreateItemTemplateImageButton(sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, Page_Command);
						}
						else if ( String.Compare(sDATA_FORMAT, "Hover", true) == 0 )
						{
							string sIMAGE_SKIN = sURL_TARGET;
							if ( Sql.IsEmptyString(sIMAGE_SKIN) )
								sIMAGE_SKIN = "info_inline";
							// 08/02/2010   In our application of Field Level Security, we will hide fields by replacing with "."
							if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sURL_FIELD) )
							{
								string[] arrURL_FIELD = sURL_FIELD.Split(' ');
								for ( int i=0; i < arrURL_FIELD.Length; i++ )
								{
									Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty);
									if ( !acl.IsReadable() )
										arrURL_FIELD[i] = ".";
								}
								sURL_FIELD = String.Join(" ", arrURL_FIELD);
							}
							tpl.ItemTemplate = new CreateItemTemplateHover(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sIMAGE_SKIN);
						}
						else if ( String.Compare(sDATA_FORMAT, "HyperLink", true) == 0 )
						{
							// 07/26/2007   PopupViews have special requirements.  They need an OnClick action that takes more than one parameter. 
							if ( sURL_FIELD.IndexOf(' ') >= 0 )
								tpl.ItemTemplate = new CreateItemTemplateHyperLinkOnClick(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD, sMODULE_TYPE);
							else
								tpl.ItemTemplate = new CreateItemTemplateHyperLink(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD, sMODULE_TYPE);
						}
						else if ( String.Compare(sDATA_FORMAT, "Image", true) == 0 )
						{
							tpl.ItemTemplate = new CreateItemTemplateImage(sDATA_FIELD, sITEMSTYLE_CSSCLASS);
						}
						else
						{
							tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS;
							tpl.ItemTemplate = new CreateItemTemplateLiteral(sDATA_FIELD, sDATA_FORMAT, sMODULE_TYPE);
						}
						col = tpl;
						// 01/18/2010   Apply ACL Field Security. 
						col.Visible = bIsReadable;
					}
					else if ( String.Compare(sCOLUMN_TYPE, "HyperLinkColumn", true) == 0 )
					{
						// GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH, ITEMSTYLE-CSSCLASS, URL_FIELD, URL_FORMAT
						HyperLinkColumn lnk = new HyperLinkColumn();
						lnk.HeaderText                  = sHEADER_TEXT       ;
						lnk.DataTextField               = sDATA_FIELD        ;
						lnk.SortExpression              = sSORT_EXPRESSION   ;
						lnk.DataNavigateUrlField        = sURL_FIELD         ;
						lnk.DataNavigateUrlFormatString = sURL_FORMAT        ;
						lnk.Target                      = sURL_TARGET        ;
						lnk.ItemStyle.Width             = new Unit(sITEMSTYLE_WIDTH);
						lnk.ItemStyle.CssClass          = sITEMSTYLE_CSSCLASS;
						lnk.ItemStyle.HorizontalAlign   = eHorizontalAlign   ;
						lnk.ItemStyle.VerticalAlign     = eVerticalAlign     ;
						lnk.ItemStyle.Wrap              = bITEMSTYLE_WRAP    ;
						// 04/13/2007   Align the headers to match the data. 
						lnk.HeaderStyle.HorizontalAlign = eHorizontalAlign   ;
						col = lnk;
						// 01/18/2010   Apply ACL Field Security. 
						col.Visible = bIsReadable;
					}
					if ( col != null )
					{
						// 11/25/2006   If Team Management has been disabled, then hide the column. 
						// Keep the column, but hide it so that the remaining column positions will still be valid. 
						// 10/27/2007   The data field was changed to TEAM_NAME on 11/25/2006. It should have been changed here as well. 
						// 08/24/2009   Add support for dynamic teams. 
						if ( (sDATA_FIELD == "TEAM_NAME" || sDATA_FIELD == "TEAM_SET_NAME") && !bEnableTeamManagement )
						{
							col.Visible = false;
						}
						// 11/28/2005   In case the column specified is too high, just append column. 
						if ( nCOLUMN_INDEX >= grd.Columns.Count )
							grd.Columns.Add(col);
						else
							grd.Columns.AddAt(nCOLUMN_INDEX, col);
					}
				}
			}
			// 09/20/2012   We need a SCRIPT field that is form specific. 
			if ( dt.Rows.Count > 0 )
			{
				try
				{
					string sFORM_SCRIPT = Sql.ToString(dt.Rows[0]["SCRIPT"]);
					if ( !Sql.IsEmptyString(sFORM_SCRIPT) )
					{
						// 09/20/2012   The base ID is not the ID of the parent, but the ID of the TemplateControl. 
						sFORM_SCRIPT = sFORM_SCRIPT.Replace("SPLENDID_GRIDVIEW_LAYOUT_ID", grd.TemplateControl.ClientID);
						ScriptManager.RegisterStartupScript(grd, typeof(System.String), sGRID_NAME.Replace(".", "_") + "_SCRIPT", sFORM_SCRIPT, true);
					}
				}
				catch(Exception ex)
				{
					SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex);
				}
			}
		}
示例#38
0
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.Page_Load);
			ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
			m_sMODULE = "UserSignatures";
			arrSelectFields = new UniqueStringCollection();
			arrSelectFields.Add("NAME");
			this.AppendGridColumns(grdMain, "Users." + m_sMODULE, arrSelectFields);
			if ( IsPostBack )
				ctlDynamicButtons.AppendButtons("Users." + m_sMODULE, Guid.Empty, Guid.Empty);
		}
示例#39
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);
			ctlDynamicButtons.Command += new CommandEventHandler(Page_Command);
			ctlSearchView    .Command += new CommandEventHandler(Page_Command);
            m_sMODULE = "TQAccount";
			arrSelectFields = new UniqueStringCollection();
			this.AppendGridColumns(grdMain, m_sMODULE + ".PopupView", arrSelectFields);
			if ( !IsPostBack)
				ctlDynamicButtons.ShowButton("Clear", !Sql.ToBoolean(Request["ClearDisabled"]));
		}