/// <summary> /// 保存信息 /// </summary> public void SaveInfo() { if (ThemeTypeID.IsNull()) { objSys_ThemeType.ThemeTypeID = Guid.NewGuid().ToString(); ///主题类型名称 objSys_ThemeType.ThemeTypeName = txtThemeTypeName.TextCutWord(50); ///主题类型代码 objSys_ThemeType.ThemeTypeCode = txtThemeTypeCode.TextCut(100); ///主题类型备注 objSys_ThemeType.Remark = txtRemark.TextCutWord(100); objThemeRule.InsertThemeType(objSys_ThemeType); MessageDialog("新增成功", "ThemeTypeList.aspx"); } else { objSys_ThemeType = objThemeRule.Sys_ThemeType.First(p => p.ThemeTypeID == ThemeTypeID); ///主题类型名称 objSys_ThemeType.ThemeTypeName = txtThemeTypeName.TextCutWord(50); ///主题类型代码 objSys_ThemeType.ThemeTypeCode = txtThemeTypeCode.TextCut(100); ///主题类型备注 objSys_ThemeType.Remark = txtRemark.TextCutWord(100); objThemeRule.UpdateThemeType(objSys_ThemeType); MessageDialog("修改成功", "ThemeTypeList.aspx"); } }
public void InsertThemeType(Sys_ThemeType objSys_ThemeType) { objSys_ThemeType.ThemeTypeName.CheckIsNull("请输入主题类型名称", "ParameterLog"); objSys_ThemeType.ThemeTypeCode.CheckIsNull("请输入主题类型代码", "ParameterLog"); this.CurrentEntities.AddTosys_themetype(objSys_ThemeType); this.CurrentEntities.SaveChanges(); }
/// <summary> /// 页面加载 /// </summary> public override void RenderPage() { if (ThemeTypeID.IsNoNull()) { objSys_ThemeType = objThemeRule.Sys_ThemeType.First(s => s.ThemeTypeID == ThemeTypeID); Page.DataBind(); } else { } }
public void UpdateThemeType(Sys_ThemeType objSys_ThemeType) { objSys_ThemeType.ThemeTypeName.CheckIsNull("请输入主题类型名称", "ParameterLog"); objSys_ThemeType.ThemeTypeCode.CheckIsNull("请输入主题类型代码", "ParameterLog"); this.CurrentEntities.SaveChanges(); }