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")) && (dataItem.FieldType != FieldType.SpecialType)) { control.FindControl("EasyOne2007").Visible = false; } if (controlType == FieldType.ContentType) { ((ContentType)control.FindControl("EasyOne2007")).IsUpload = true; } if (control.Visible) { this.m_FieldInput = true; } } }
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); } } } } }
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(); } } } }
private DataTable GetDataTableFromRepeater() { DataRow row; DataTable dataTable = new DataTable(); dataTable.Columns.Add("FieldName"); dataTable.Columns.Add("FieldValue"); dataTable.Columns.Add("FieldType"); dataTable.Columns.Add("FieldLevel"); foreach (RepeaterItem item in this.RepModel.Items) { FieldControl control = (FieldControl)item.FindControl("Field"); switch (control.ControlType) { case FieldType.PictureType: { PictureType type2 = (PictureType)control.FindControl("EasyOne2007"); row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = type2.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); if ((control.Settings.Count > 7) && DataConverter.CBoolean(control.Settings[7])) { DataRow row2 = dataTable.NewRow(); row2["FieldName"] = "UploadFiles"; row2["FieldValue"] = type2.UploadFiles; row2["FieldType"] = FieldType.TextType; row2["FieldLevel"] = 0; dataTable.Rows.Add(row2); } continue; } case FieldType.FileType: { FileType type3 = (FileType)control.FindControl("EasyOne2007"); row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = type3.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); if (DataConverter.CBoolean(control.Settings[3])) { DataRow row3 = dataTable.NewRow(); row3["FieldName"] = control.Settings[4]; row3["FieldValue"] = type3.FileSize; row3["FieldType"] = FieldType.TextType; row3["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row3); } continue; } case FieldType.NodeType: { EasyOne.WebSite.Controls.FieldControl.NodeType type5 = (EasyOne.WebSite.Controls.FieldControl.NodeType)control.FindControl("EasyOne2007"); row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = type5.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); row = dataTable.NewRow(); row["FieldName"] = "infoid"; row["FieldValue"] = type5.InfoNodeId; row["FieldType"] = FieldType.InfoType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); continue; } case FieldType.InfoType: { continue; } case FieldType.AuthorType: { if ((control.Settings.Count > 1) && DataConverter.CBoolean(control.Settings[1])) { this.Session["AuthorValue"] = control.Value; } row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = control.Value; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); continue; } case FieldType.SourceType: { if ((control.Settings.Count > 1) && DataConverter.CBoolean(control.Settings[1])) { this.Session["SourceValue"] = control.Value; } row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = control.Value; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); continue; } case FieldType.KeywordType: { row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = StringHelper.ReplaceChar(control.Value.Trim(), ' ', '|'); row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); continue; } case FieldType.ContentType: { ContentType type = (ContentType)control.FindControl("EasyOne2007"); row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = type.Content; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); if (type.SaveRemotePic) { if (string.IsNullOrEmpty(this.m_ContentFieldName)) { break; } this.m_ContentFieldName = this.m_ContentFieldName + "$" + control.FieldName; } continue; } case FieldType.TitleType: { TitleType type6 = (TitleType)control.FindControl("EasyOne2007"); row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = control.Value; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); string pinyinTitle = type6.PinyinTitle; if (string.IsNullOrEmpty(pinyinTitle)) { pinyinTitle = ChineseSpell.MakeSpellCode(control.Value, SpellOptions.EnableUnicodeLetter); } row = dataTable.NewRow(); row["FieldName"] = "PinyinTitle"; row["FieldValue"] = pinyinTitle; row["FieldType"] = FieldType.TextType; row["FieldLevel"] = 0; dataTable.Rows.Add(row); continue; } case FieldType.MultiplePhotoType: { MultiplePhotoType type4 = (MultiplePhotoType)control.FindControl("EasyOne2007"); row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = type4.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); continue; } default: goto Label_0773; } this.m_ContentFieldName = this.m_ContentFieldName + control.FieldName; continue; Label_0773: row = dataTable.NewRow(); row["FieldName"] = control.FieldName; row["FieldValue"] = control.Value; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; dataTable.Rows.Add(row); } if (this.m_Action == "add") { row = dataTable.NewRow(); row["FieldName"] = "Inputer"; row["FieldValue"] = PEContext.Current.Admin.UserName; row["FieldType"] = FieldType.TextType; row["FieldLevel"] = 0; dataTable.Rows.Add(row); } if (GetStatusFromDataTable(dataTable) == 0x63) { row = dataTable.NewRow(); row["FieldName"] = "Editor"; row["FieldValue"] = PEContext.Current.Admin.AdminName; row["FieldType"] = FieldType.TextType; row["FieldLevel"] = 0; dataTable.Rows.Add(row); row = dataTable.NewRow(); row["FieldName"] = "PassedTime"; row["FieldValue"] = DateTime.Now.ToString("yyyy-MM-dd"); row["FieldType"] = FieldType.DateTimeType; row["FieldLevel"] = 0; dataTable.Rows.Add(row); } return(dataTable); }
private DataTable GetDataTableFromRepeater() { DataTable table = new DataTable(); table.Columns.Add("FieldName"); table.Columns.Add("FieldValue"); table.Columns.Add("FieldType"); table.Columns.Add("FieldLevel"); foreach (RepeaterItem item in this.RepContentForm.Items) { FieldControl control = (FieldControl)item.FindControl("Field"); DataRow row = table.NewRow(); switch (control.ControlType) { case FieldType.PictureType: { PictureType type2 = (PictureType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = type2.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); if ((control.Settings.Count > 7) && DataConverter.CBoolean(control.Settings[7])) { DataRow row2 = table.NewRow(); row2["FieldName"] = "UploadFiles"; row2["FieldValue"] = type2.UploadFiles; row2["FieldType"] = FieldType.TextType; row2["FieldLevel"] = 0; table.Rows.Add(row2); } continue; } case FieldType.FileType: { FileType type3 = (FileType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = type3.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); if (DataConverter.CBoolean(control.Settings[3])) { DataRow row3 = table.NewRow(); row3["FieldName"] = control.Settings[4]; row3["FieldValue"] = type3.FileSize; row3["FieldType"] = FieldType.TextType; row3["FieldLevel"] = control.FieldLevel; table.Rows.Add(row3); } continue; } case FieldType.NodeType: { EasyOne.WebSite.Controls.FieldControl.NodeType type7 = (EasyOne.WebSite.Controls.FieldControl.NodeType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = type7.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); DataRow row4 = table.NewRow(); row4["FieldName"] = "infoid"; row4["FieldValue"] = type7.InfoNodeId; row4["FieldType"] = FieldType.InfoType; row4["FieldLevel"] = control.FieldLevel; table.Rows.Add(row4); continue; } case FieldType.AuthorType: { AuthorType type8 = (AuthorType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = this.ReplaceQutoChar(type8.FieldValue); row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); continue; } case FieldType.SourceType: { SourceType type6 = (SourceType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = this.ReplaceQutoChar(type6.FieldValue); row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); continue; } case FieldType.KeywordType: { KeywordType type5 = (KeywordType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = this.ReplaceQutoChar(StringHelper.ReplaceChar(type5.FieldValue, ' ', '|')); row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); continue; } case FieldType.ContentType: { ContentType type = (ContentType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = type.Content; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); continue; } case FieldType.MultiplePhotoType: { MultiplePhotoType type4 = (MultiplePhotoType)control.FindControl("EasyOne2007"); row["FieldName"] = control.FieldName; row["FieldValue"] = type4.FieldValue; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); continue; } } row["FieldName"] = control.FieldName; row["FieldValue"] = control.Value; row["FieldType"] = control.ControlType; row["FieldLevel"] = control.FieldLevel; table.Rows.Add(row); } DataRow row5 = table.NewRow(); row5["FieldName"] = "Inputer"; row5["FieldValue"] = PEContext.Current.User.UserName; row5["FieldType"] = FieldType.TextType; row5["FieldLevel"] = 0; table.Rows.Add(row5); return(table); }