📄 content.cs
字号:
row["FieldValue"] = type5.InfoNodeId;
row["FieldType"] = FieldType.InfoType;
row["FieldLevel"] = control.FieldLevel;
dataTable.Rows.Add(row);
continue;
}
case FieldType.InfoType:
{
continue;
}
case FieldType.ContentType:
{
ContentType type = (ContentType) control.FindControl("PowerEasy2007");
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.MultiplePhotoType:
{
MultiplePhotoType type4 = (MultiplePhotoType) control.FindControl("PowerEasy2007");
row = dataTable.NewRow();
row["FieldName"] = control.FieldName;
row["FieldValue"] = type4.FieldValue;
row["FieldType"] = control.ControlType;
row["FieldLevel"] = control.FieldLevel;
dataTable.Rows.Add(row);
if (DataConverter.CBool(control.Settings[2]))
{
DataRow row4 = dataTable.NewRow();
row4["FieldName"] = control.Settings[3];
row4["FieldValue"] = type4.ThumbFieldValue;
row4["FieldType"] = FieldType.TextType;
row4["FieldLevel"] = control.FieldLevel;
dataTable.Rows.Add(row4);
}
continue;
}
default:
goto Label_054E;
}
this.m_ContentFieldName = this.m_ContentFieldName + control.FieldName;
continue;
Label_054E:
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 static int GetGeneralId(DataTable dataTable)
{
return DataConverter.CLng(dataTable.Select("FieldName = 'generalId'")[0]["FieldValue"].ToString());
}
private static int GetStatusFromDataTable(DataTable dataTable)
{
return DataConverter.CLng(dataTable.Select("FieldName = 'status'")[0]["FieldValue"].ToString());
}
private void InitCharge(int generalId, bool enableCharge)
{
ContentPermissionInfo contentPermissionInfoById = PermissionContent.GetContentPermissionInfoById(generalId);
if (!contentPermissionInfoById.IsNull)
{
this.RadlInfoPurview.SelectedValue = contentPermissionInfoById.PermissionType.ToString();
if (!string.IsNullOrEmpty(contentPermissionInfoById.ArrGroupId))
{
string[] strArray = contentPermissionInfoById.ArrGroupId.Split(new char[] { ',' });
for (int i = 0; i < strArray.Length; i++)
{
this.EChklUserGroupList.Items.FindByValue(strArray[i]).Selected = true;
}
}
}
if (enableCharge)
{
ContentChargeInfo contentChargeInfoById = PowerEasy.Contents.ContentCharge.GetContentChargeInfoById(generalId);
if (!contentChargeInfoById.IsNull)
{
this.TxtInfoPoint.Text = contentChargeInfoById.InfoPoint.ToString();
this.ShowChargeType.ChargeType = contentChargeInfoById.ChargeType;
this.ShowChargeType.PitchTime = contentChargeInfoById.PitchTime;
this.ShowChargeType.ReadTimes = contentChargeInfoById.ReadTimes;
this.TxtDividePercent.Text = contentChargeInfoById.DividePercent.ToString();
}
}
}
private void InitializePage()
{
if (!this.Page.IsPostBack)
{
string str;
ModelInfo modelInfoById = ModelManager.GetModelInfoById(this.m_ModelId);
if (this.m_Action == "add")
{
if (!PowerEasy.Contents.Nodes.CheckNodePermission(this.m_NodeId))
{
AdminPage.WriteErrMsg("此栏目设置了有子节点时不允许向该栏目添加信息!", "ContentManage.aspx");
}
str = "添加" + modelInfoById.ItemName;
}
else
{
str = "修改" + modelInfoById.ItemName;
}
if (this.m_NodeId > 0)
{
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(this.m_NodeId);
this.LblNodeName.Text = "所属节点:<span style='color:red'>" + cacheNodeById.NodeName + "</span>";
str = PowerEasy.Contents.Nodes.ShowNodeNavigation(this.m_NodeId) + " >> " + str;
}
this.SmpNavigator.CurrentNode = str;
this.m_TbodyChargeId = ",\"" + this.TbodyCharge.ClientID + "\"";
if (!modelInfoById.EnableCharge)
{
this.m_TbodyChargeId = "";
}
if (!modelInfoById.EnableSignin)
{
this.TabTitle3.Style.Add("display", "none");
}
if (!modelInfoById.EnbaleVote)
{
this.TabTitle4.Style.Add("display", "none");
}
this.InitUserGroupCheckBoxList();
if (this.m_Action == "add")
{
IList<FieldInfo> fieldList = Field.GetFieldList(this.m_ModelId, false);
this.RepModel.DataSource = fieldList;
this.RepModel.DataBind();
NodeInfo info3 = PowerEasy.Contents.Nodes.GetCacheNodeById(this.m_NodeId);
if (!info3.IsNull)
{
this.TxtInfoPoint.Text = info3.Settings.DefaultItemPoint.ToString();
this.ShowChargeType.ChargeType = info3.Settings.DefaultItemChargeType;
this.ShowChargeType.PitchTime = info3.Settings.DefaultItemPitchTime;
this.ShowChargeType.ReadTimes = info3.Settings.DefaultItemReadTimes;
this.TxtDividePercent.Text = info3.Settings.DefaultItemDividePercent.ToString();
}
}
else
{
int generalId = BasePage.RequestInt32("GeneralID");
this.m_ContentDataTable = ContentManage.GetContentDataById(generalId);
if ((this.m_ContentDataTable == null) || (this.m_ContentDataTable.Rows.Count == 0))
{
AdminPage.WriteErrMsg("<li>指定项目不存在!</li>");
}
IList<FieldInfo> list2 = Field.GetFieldList(DataConverter.CLng(this.m_ContentDataTable.Rows[0]["ModelID"].ToString()), false);
this.RepModel.DataSource = list2;
this.RepModel.DataBind();
this.InitSignin(generalId, modelInfoById.EnableSignin);
this.InitCharge(generalId, modelInfoById.EnableCharge);
}
if (!SiteConfig.SiteOption.EnablePointMoneyExp)
{
this.m_TbodyChargeId = "";
}
}
}
private void InitSignin(int generalId, bool enableSignin)
{
if (enableSignin)
{
SigninContentInfo signinContentByGeneralId = SigninContent.GetSigninContentByGeneralId(generalId);
if (!signinContentByGeneralId.IsNull)
{
this.TxtPriority.Text = signinContentByGeneralId.Priority.ToString();
BasePage.SetSelectedIndexByValue(this.DrpSigninType, signinContentByGeneralId.SigninType.ToString());
this.DpkEndTime.Text = signinContentByGeneralId.EndTime.ToString();
}
this.TxtSigninUser.Text = SigninLog.GetSigninUsers(generalId);
}
}
private HtmlControl InitTabByFieldType(RepeaterItemEventArgs e, FieldInfo fieldInfo)
{
HtmlControl control = (HtmlControl) e.Item.FindControl("Field").FindControl("PowerEasy2007").FindControl("Tab");
if (e.Item.FindControl("Field").FindControl("PowerEasy2007").Visible && control.Visible)
{
if (((((fieldInfo.FieldLevel == 0) && (fieldInfo.Id != "title")) && ((fieldInfo.FieldType != FieldType.NodeType) && (fieldInfo.Id != "elitelevel"))) && (((fieldInfo.Id != "priority") && (fieldInfo.Id != "status")) && ((fieldInfo.FieldType != FieldType.InfoType) && (fieldInfo.FieldType != FieldType.SpecialType)))) && (fieldInfo.Id != "defaultpicurl"))
{
control.Style.Add("display", "none");
if (this.arrTrs1.Length == 0)
{
this.arrTrs1.Append("\"" + control.ClientID + "\"");
return control;
}
this.arrTrs1.Append(",\"" + control.ClientID + "\"");
return control;
}
if (this.arrTrs0.Length == 0)
{
this.arrTrs0.Append("\"" + control.ClientID + "\"");
return control;
}
this.arrTrs0.Append(",\"" + control.ClientID + "\"");
}
return control;
}
private void InitUserGroupCheckBoxList()
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -