Example #1
0
 /// <summary>
 /// 将一个参数加入参数队列
 /// </summary>
 /// <param name="lp">标签参数</param>
 /// <param name="list">列表</param>
 public void AddParameter(KeyValue AblerParam, ref List<KeyValue> list)
 {
     bool flag = true;
     foreach (KeyValue p in list)
     {
         if (p.Key.Equals(AblerParam.Key))
             flag = false; break;
     }
     if (flag)
         list.Add(AblerParam);
 }
        public virtual WhereClause CreateWhereClause()
        {
            // This CreateWhereClause is used for loading the data.
            EstimateLineTable.Instance.InnerFilter = null;
            WhereClause wc = new WhereClause();

            // CreateWhereClause() Compose the WHERE clause consiting of:
            // 1. Static clause defined at design time.
            // 2. User selected search criteria.
            // 3. User selected filter criteria.

              KeyValue selectedRecordKeyValue = new KeyValue();
            FPCEstimate.UI.Controls.EditScope.ScopeRecordControl scopeRecordControlObj = (MiscUtils.FindControlRecursively(this.Page , "ScopeRecordControl") as FPCEstimate.UI.Controls.EditScope.ScopeRecordControl);

                if (scopeRecordControlObj != null && scopeRecordControlObj.GetRecord() != null && scopeRecordControlObj.GetRecord().IsCreated && scopeRecordControlObj.GetRecord().ScopeID != null)
                {
                    wc.iAND(EstimateLineTable.ScopeID, BaseFilter.ComparisonOperator.EqualsTo, scopeRecordControlObj.GetRecord().ScopeID.ToString());
                    selectedRecordKeyValue.AddElement(EstimateLineTable.ScopeID.InternalName, scopeRecordControlObj.GetRecord().ScopeID.ToString());
                }
                else
                {
                    wc.RunQuery = false;
                    return wc;
                }

              HttpContext.Current.Session["EstimateLineTableControlWhereClause"] = selectedRecordKeyValue.ToXmlString();

            return wc;
        }
        public void BuidSiteMapResx(string sFileName, bool isActive, bool isDeleted, Int32 portalID, string username)
        {
            var pages = dbSiteMap.usp_GetAllPages(isActive, isDeleted, portalID, username);
            List<KeyValue> lstResDef = new List<KeyValue>();
            try
            {
                string key = string.Empty;
                string value = string.Empty;
                lstResDef.Add(new KeyValue("RootTitle", "Root"));
                lstResDef.Add(new KeyValue("RootDescription", "Root"));
                lstResDef.Add(new KeyValue("AdministrationTitle", "Administration"));
                lstResDef.Add(new KeyValue("AdministrationDescription", "Administration"));
                lstResDef.Add(new KeyValue("YouAreInTitle", "You Are In"));
                lstResDef.Add(new KeyValue("YouAreIntDescription", "You Are In"));
                foreach (var page in pages)
                {
                    key = page.PageName.Replace(" ", "") + "Title";
                    value = page.PageName;
                    KeyValue keyValueTitle = new KeyValue(key, value);
                    lstResDef.Add(keyValueTitle);

                    key = page.PageName.Replace(" ", "") + "Description";
                    value = page.Description;
                    KeyValue keyValueDescription = new KeyValue(key, value);
                    lstResDef.Add(keyValueDescription);
                }
            }
            finally
            {
                CommonFunction.WriteResX(sFileName, lstResDef);
            }
        }