Ejemplo n.º 1
0
 protected void RepContentForm_OnItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         FieldControl control     = (FieldControl)e.Item.FindControl("Field");
         FieldInfo    dataItem    = (FieldInfo)e.Item.DataItem;
         FieldType    controlType = control.ControlType;
         if (controlType == FieldType.NodeType)
         {
             control.Value = this.m_NodeId.ToString();
         }
         if ((((control.FieldLevel == 0) && (dataItem.Id != "title")) && ((controlType != FieldType.NodeType) && (controlType != FieldType.SpecialType))) && ((controlType != FieldType.StatusType) && (controlType != FieldType.PictureType)))
         {
             control.FindControl("EasyOne2007").Visible = false;
         }
         if ((controlType == FieldType.ContentType) && !this.m_UserPurviewInfo.SetEditor)
         {
             ContentType type2 = (ContentType)control.FindControl("EasyOne2007");
             type2.Editor.ToolbarSet = "Simple";
         }
         if (controlType == FieldType.ContentType)
         {
             ((ContentType)control.FindControl("EasyOne2007")).IsUpload = true;
         }
         if (this.m_Action == "modify")
         {
             if (controlType == FieldType.ContentType)
             {
                 ContentType type3 = (ContentType)control.FindControl("EasyOne2007");
                 type3.Content       = ContentManage.ToFieldType(this.m_ContentData.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType);
                 type3.DefaultPicurl = ContentManage.ToFieldType(this.m_ContentData.Rows[0]["DefaultPicurl"].ToString(), FieldType.TextType);
                 type3.IsUpload      = true;
             }
             else
             {
                 control.Value = ContentManage.ToFieldType(this.m_ContentData.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType);
             }
             if (controlType == FieldType.KeywordType)
             {
                 control.Value = StringHelper.ReplaceChar(control.Value, '|', ' ');
             }
             if ((controlType == FieldType.PictureType) && (dataItem.FieldLevel == 0))
             {
                 PictureType type4 = (PictureType)control.FindControl("EasyOne2007");
                 type4.UploadFiles = ContentManage.ToFieldType(this.m_ContentData.Rows[0]["UploadFiles"].ToString(), FieldType.TextType);
             }
             if (controlType == FieldType.FileType)
             {
                 FileType type5 = (FileType)control.FindControl("EasyOne2007");
                 if (DataConverter.CBoolean(dataItem.Settings[3]))
                 {
                     type5.FileSize = ContentManage.ToFieldType(this.m_ContentData.Rows[0][dataItem.Settings[4]].ToString(), dataItem.FieldType);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        protected void RepModel_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                FieldControl control     = (FieldControl)e.Item.FindControl("Field");
                FieldInfo    dataItem    = (FieldInfo)e.Item.DataItem;
                FieldType    controlType = control.ControlType;
                switch (controlType)
                {
                case FieldType.LookType:
                {
                    int modelId = DataConverter.CLng(dataItem.Settings[0]);
                    if (!Field.FieldExists(modelId, dataItem.Settings[1]))
                    {
                        Field.SetDisabled(dataItem.FieldName, modelId, true);
                        e.Item.Visible = false;
                    }
                    break;
                }

                case FieldType.NodeType:
                    control.Value = this.m_NodeId.ToString();
                    break;
                }
                if (this.m_Action == "add")
                {
                    if ((((controlType == FieldType.AuthorType) && string.IsNullOrEmpty(dataItem.DefaultValue)) && ((dataItem.Settings.Count > 1) && DataConverter.CBoolean(dataItem.Settings[1]))) && (this.Session["AuthorValue"] != null))
                    {
                        control.Value = this.Session["AuthorValue"].ToString();
                    }
                    if ((((controlType == FieldType.SourceType) && string.IsNullOrEmpty(dataItem.DefaultValue)) && ((dataItem.Settings.Count > 1) && DataConverter.CBoolean(dataItem.Settings[1]))) && (this.Session["SourceValue"] != null))
                    {
                        control.Value = this.Session["SourceValue"].ToString();
                    }
                }
                if (controlType == FieldType.ContentType)
                {
                    ((ContentType)control.FindControl("EasyOne2007")).IsUpload = true;
                }
                HtmlControl control2 = this.InitTabByFieldType(e, dataItem);
                if (this.m_Action == "modify")
                {
                    if (((BasePage.RequestInt32("LinkType") == 1) && (dataItem.FieldLevel == 1)) && control.FindControl("EasyOne2007").Visible)
                    {
                        if (this.arrTrs0.Length > (control2.ClientID.Length + 3))
                        {
                            this.arrTrs0.Remove((this.arrTrs0.Length - control2.ClientID.Length) - 3, control2.ClientID.Length + 3);
                        }
                        else
                        {
                            this.arrTrs0.Remove((this.arrTrs0.Length - control2.ClientID.Length) - 2, control2.ClientID.Length + 2);
                        }
                        control.FindControl("EasyOne2007").Visible = false;
                    }
                    if (controlType == FieldType.ContentType)
                    {
                        ContentType type2 = (ContentType)control.FindControl("EasyOne2007");
                        type2.Content       = ContentManage.ToFieldType(this.m_ContentDataTable.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType);
                        type2.DefaultPicurl = ContentManage.ToFieldType(this.m_ContentDataTable.Rows[0]["DefaultPicurl"].ToString(), FieldType.TextType);
                    }
                    else
                    {
                        control.Value = ContentManage.ToFieldType(this.m_ContentDataTable.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType);
                    }
                    if ((controlType == FieldType.PictureType) && (dataItem.FieldLevel == 0))
                    {
                        PictureType type3 = (PictureType)control.FindControl("EasyOne2007");
                        type3.UploadFiles = ContentManage.ToFieldType(this.m_ContentDataTable.Rows[0]["UploadFiles"].ToString(), FieldType.TextType);
                    }
                    if (controlType == FieldType.FileType)
                    {
                        FileType type4 = (FileType)control.FindControl("EasyOne2007");
                        if (DataConverter.CBoolean(dataItem.Settings[3]))
                        {
                            type4.FileSize = ContentManage.ToFieldType(this.m_ContentDataTable.Rows[0][dataItem.Settings[4]].ToString(), dataItem.FieldType);
                        }
                    }
                    if ((string.Compare("UpdateTime", control.FieldName) == 0) && (control.FieldLevel == 0))
                    {
                        control.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    }
                    if (controlType == FieldType.KeywordType)
                    {
                        control.Value = StringHelper.ReplaceChar(control.Value, '|', ' ');
                    }
                    if (((controlType == FieldType.TitleType) && (control.Settings.Count > 3)) && DataConverter.CBoolean(control.Settings[3]))
                    {
                        TitleType type5 = (TitleType)control.FindControl("EasyOne2007");
                        type5.PinyinTitle = this.m_ContentDataTable.Rows[0]["PinyinTitle"].ToString();
                    }
                }
            }
        }