コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: uNormatov/FreboCms
        private void GetMetaData()
        {
            if (!string.IsNullOrEmpty(PageInfo.MetaQueryName))
            {
                using (GeneralConnection generalConnection = new GeneralConnection())
                {
                    ErrorInfoList errors = new ErrorInfoList();
                    bool ok;
                    DataTable dataTable = generalConnection.ExecuteDataTableQuery(PageInfo.MetaQueryName, GetSelectParamaters(PageInfo.MetaQueryParameters, out ok), QueryType.SqlQuery, errors);

                    if (ok && dataTable != null && dataTable.Rows.Count > 0)
                    {
                        if (dataTable.Columns.Contains("MetaTitle"))
                            PageInfo.MetaTitle = ValidationHelper.GetString(dataTable.Rows[0]["MetaTitle"], string.Empty);
                        if (dataTable.Columns.Contains("MetaDescription"))
                            PageInfo.MetadataDescription = ValidationHelper.GetString(dataTable.Rows[0]["MetaDescription"], string.Empty);
                        if (dataTable.Columns.Contains("MetaKeywords"))
                            PageInfo.MetadataKeywords = ValidationHelper.GetString(dataTable.Rows[0]["MetaKeywords"], string.Empty);
                        if (dataTable.Columns.Contains("CopyRights"))
                            PageInfo.ContentRights = ValidationHelper.GetString(dataTable.Rows[0]["CopyRights"], string.Empty);
                        if (dataTable.Columns.Contains("MetaImage"))
                            PageInfo.MetaImage = ValidationHelper.GetString(dataTable.Rows[0]["MetaImage"], string.Empty);
                    }
                }
            }
        }
コード例 #2
0
ファイル: FRepeater.cs プロジェクト: uNormatov/FreboCms
        public override void DataBind()
        {
            using (GeneralConnection generalConnection = new GeneralConnection())
            {
                ErrorInfoList errors = new ErrorInfoList();
                string key = GeneratCacheKey();
                DataTable dataTable = null;
                if (CacheHelper.Contains(key))
                    dataTable = (DataTable)CacheHelper.Get(key);

                if (dataTable == null)
                {
                    dataTable = generalConnection.ExecuteDataTableQuery(QueryName, QueryParameters, _queryType, errors);
                    if (dataTable != null)
                        CacheHelper.Add(key, dataTable);
                }

                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    DataSource = dataTable;
                    LoadTemplate();
                    base.DataBind();
                }
            }
        }
コード例 #3
0
ファイル: webpart.ascx.cs プロジェクト: uNormatov/FreboCms
        private void GetSordeDictionary()
        {
            _tags = new SortedDictionary<string, int>();
            _urls = new Dictionary<string, string>();
            using (GeneralConnection generalConnection = new GeneralConnection())
            {
                ErrorInfoList errors = new ErrorInfoList();
                DataTable dataTable = generalConnection.ExecuteDataTableQuery("n_maqola.tag_cloud_uchun", null,
                    QueryType.SqlQuery, errors);

                if (errors.Count == 0 && dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow row in dataTable.Rows)
                    {
                        _tags.Add(ValidationHelper.GetString(row["Name"], string.Empty), ValidationHelper.GetInteger(row["Count"], 0));
                        _urls.Add(ValidationHelper.GetString(row["Name"], string.Empty), ValidationHelper.GetString(row["SeoTemplate"], string.Empty));
                    }

                    dataTable = generalConnection.ExecuteDataTableQuery("n_maqola.all_published_count", null, QueryType.SqlQuery, errors);
                    if (errors.Count == 0 && dataTable.Rows.Count > 0)
                    {
                        _totalCount = ValidationHelper.GetInteger(dataTable.Rows[0][0], 0);
                    }
                    else
                    {
                        _totalCount = 0;
                    }
                }
            }
        }
コード例 #4
0
        private string AddComment(HttpRequest request)
        {
            int contentTypeId = ValidationHelper.GetInteger(request.QueryString["contenttypeid"], 0);
            string email = ValidationHelper.GetString(request.QueryString["email"], string.Empty);
            string name = ValidationHelper.GetString(request.QueryString["name"], string.Empty);
            string body = ValidationHelper.GetString(request.QueryString["body"], string.Empty);
            string seotemplate = ValidationHelper.GetString(request.QueryString["seotemplate"], string.Empty);
            int order = ValidationHelper.GetInteger(request.QueryString["order"], 0);
            string url = ValidationHelper.GetString(request.QueryString["url"], string.Empty);
            string website = ValidationHelper.GetString(request.QueryString["website"], string.Empty);
            int parentId = ValidationHelper.GetInteger(request.QueryString["parentid"], 0);
            JavaScriptSerializer js = new JavaScriptSerializer();

            CommentBoxInfo comment = new CommentBoxInfo();
            comment.Name = name;
            comment.Email = email;
            comment.Body = body;
            comment.SeoTemplate = seotemplate;
            comment.Order = order + 1;
            comment.Url = url;
            comment.Website = website;
            comment.CreatedDate = DateTime.Now;
            comment.ContentTypeId = contentTypeId;
            ErrorInfoList errorInfoList = new ErrorInfoList();
            _commentBoxProvider.Create(comment, errorInfoList);
            if (errorInfoList.HasError())
                comment.IsOk = false;
            else
                comment.IsOk = true;
            comment.Time = UzbKeywordHelper.GetDateString(comment.CreatedDate.Value, DateTime.Now);
            return js.Serialize(comment);
        }
コード例 #5
0
ファイル: CommonSettings.cs プロジェクト: bitvalser/SI
 public CommonSettings()
 {
     Humans           = new ObservableCollection <HumanAccount>();
     Humans2          = new List <HumanAccount>();
     CompPlayers      = new ObservableCollection <ComputerAccount>();
     CompPlayers2     = new List <ComputerAccount>();
     CompShowmans     = new ObservableCollection <ComputerAccount>();
     CompShowmans2    = new List <ComputerAccount>();
     BestPlayers      = new ObservableCollection <BestPlayer>();
     DelayedErrorsNew = new ErrorInfoList();
 }
コード例 #6
0
 public ContentTypeModel(int contentTypeId, DataRow row, GeneralConnection generalConnection, ContentTypeProvider contentTypeProvider, ErrorInfoList errors)
 {
     _contentTypeId = contentTypeId;
     if (generalConnection != null)
         _generalConnection = generalConnection;
     if (contentTypeProvider != null)
         _contentTypeProvider = contentTypeProvider;
     if (errors != null)
         ErrorInfoList = errors;
     IsEdit = true;
     Init(row);
 }
コード例 #7
0
 public ContentTypeModel(int contentTypeId, GeneralConnection generalConnection, ContentTypeProvider contentTypeProvider, ErrorInfoList errors)
 {
     _contentTypeId = contentTypeId;
     if (generalConnection != null)
         _generalConnection = generalConnection;
     if (contentTypeProvider != null)
         _contentTypeProvider = contentTypeProvider;
     if (errors != null)
         ErrorInfoList = errors;
     ContentId = 0;
     _dataRow = null;
     IsEdit = false;
     Init(null);
 }
コード例 #8
0
    public void DrawErrors(Rect rect)
    {
        GUIHelpers.IsInsepctor = false;
        if (InvertGraphEditor.PlatformDrawer == null)
        {
            return;
        }

        var d = InvertGraphEditor.PlatformDrawer as UnityDrawer;

        d.DrawStretchBox(rect, CachedStyles.WizardListItemBoxStyle, 10);


        if (!ErrorInfo.Any())
        {
            var textRect   = rect;
            var cacheColor = GUI.color;
            GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.4f);
            d.DrawLabel(textRect, "No Issues Found", CachedStyles.WizardSubBoxTitleStyle, DrawingAlignment.MiddleCenter);
            GUI.color = cacheColor;
            return;
        }

        if (ErrorInfoList == null)
        {
            return;
        }
        if (ErrorInfoList.IsDirty)
        {
            ErrorInfoList.Refresh();
        }

        Signal <IDrawTreeView>(_ => _.DrawTreeView(rect, ErrorInfoList, (m, i) =>
        {
            var bp = i as ErrorInfo;
            if (bp != null && bp.SourceNode != null)
            {
                Execute(new NavigateToNodeCommand()
                {
                    Node   = bp.SourceNode,
                    Select = true
                });
            }
        }));


//        // var itemRect = new Rect(0f, 0f, rect.width, 25);
//        if (GUIHelpers.DoToolbarEx("Issues"))
//        {
//
//            foreach (var item in ErrorInfo)
//            {
//                var item1 = item;
//                var name = string.Empty;
//                var node = item.Record as GraphNode;
//                if (node != null)
//                {
//                    var filter = node.Filter;
//                    if (filter != null)
//                        name = filter.Name + ": ";
//                }
//                if (GUILayout.Button(name + item1.Message,EventButtonStyleSmall))
//                {
//
//                    if (node != null)
//                        Execute(new NavigateToNodeCommand()
//                        {
//                            Node = node
//                        });
//                }
//
//                var lastRect = GUILayoutUtility.GetLastRect();
//                PlatformDrawer.DrawImage(lastRect.WithWidth(lastRect.height).PadSides(3),"WarningIcon",true);
//                //InvertGraphEditor.PlatformDrawer.DoButton(itemRect.Pad(25f,0f,0f,0f),item.Message,CachedStyles.DefaultLabel, () =>
//                //{
//
//                //});
//                //itemRect.y += 26;
//                //var lineRect = itemRect;
//                //lineRect.height -= 24;
//                //InvertGraphEditor.PlatformDrawer.DrawRect(lineRect,new Color(0f,0f,0f,0.3f));
//            }
//        }
//
    }
コード例 #9
0
ファイル: edit.ascx.cs プロジェクト: uNormatov/FreboCms
 public edit(string properties, ErrorInfoList errorInfoList)
     : base(properties, errorInfoList)
 {
 }
コード例 #10
0
ファイル: edit.ascx.cs プロジェクト: uNormatov/FreboCms
 public edit(string properties, ErrorInfoList errorInfoList)
     : base(properties, errorInfoList)
 {
     _contentTypeProvider = new ContentTypeProvider();
     _formProvider = new FormProvider();
 }