DTCMS_Detail

举报
清雨小竹 发表于 2022/09/25 00:22:23 2022/09/25
【摘要】 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyEdit.aspx.cs" Inherits="DTcms.Web.admin.oacmp.companyEdit" %><!DOCTYPE html><html xmlns="...

  
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyEdit.aspx.cs" Inherits="DTcms.Web.admin.oacmp.companyEdit" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>编辑信息</title>
  6. <script type="text/javascript" src="../../scripts/jquery/jquery-1.10.2.min.js"></script>
  7. <script type="text/javascript" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
  8. <script type="text/javascript" src="../../scripts/lhgdialog/lhgdialog.js?skin=idialog"></script>
  9. <script type="text/javascript" src="../../scripts/datepicker/WdatePicker.js"></script>
  10. <script type="text/javascript" src="../../scripts/swfupload/swfupload.js"></script>
  11. <script type="text/javascript" src="../../scripts/swfupload/swfupload.queue.js"></script>
  12. <script type="text/javascript" src="../../scripts/swfupload/swfupload.handlers.js"></script>
  13. <script type="text/javascript" charset="utf-8" src="../../editor/kindeditor-min.js"></script>
  14. <script type="text/javascript" charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
  15. <script type="text/javascript" src="../js/layout.js"></script>
  16. <link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
  17. <script type="text/javascript">
  18. $(function () {
  19. //初始化表单验证
  20. $("#form1").initValidform();
  21. //计算用户组价格
  22. $("#field_control_sell_price").change(function () {
  23. var sprice = $(this).val();
  24. if (sprice > 0) {
  25. $(".groupprice").each(function () {
  26. var num = $(this).attr("discount") * sprice / 100;
  27. $(this).val(ForDight(num, 2));
  28. });
  29. }
  30. });
  31. //初始化编辑器
  32. var editor = KindEditor.create('.editor', {
  33. width: '98%',
  34. height: '350px',
  35. resizeType: 1,
  36. uploadJson: '../../tools/upload_ajax.ashx?action=EditorFile&IsWater=1',
  37. fileManagerJson: '../../tools/upload_ajax.ashx?action=ManagerFile',
  38. allowFileManager: true
  39. });
  40. var editorMini = KindEditor.create('.editor-mini', {
  41. width: '98%',
  42. height: '250px',
  43. resizeType: 1,
  44. uploadJson: '../../tools/upload_ajax.ashx?action=EditorFile&IsWater=1',
  45. items: [
  46. 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
  47. 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
  48. 'insertunorderedlist', '|', 'emoticons', 'image', 'link']
  49. });
  50. //初始化上传控件
  51. $(".upload-img").each(function () {
  52. $(this).InitSWFUpload({ sendurl: "../../tools/upload_ajax.ashx", flashurl: "../../scripts/swfupload/swfupload.swf" });
  53. });
  54. $(".upload-album").each(function () {
  55. $(this).InitSWFUpload({ btntext: "批量上传", btnwidth: 66, single: false, water: true, thumbnail: true, filesize: "2048", sendurl: "../../tools/upload_ajax.ashx", flashurl: "../../scripts/swfupload/swfupload.swf", filetypes: "*.jpg;*.jpge;*.png;*.gif;" });
  56. });
  57. $(".attach-btn").click(function () {
  58. showAttachDialog();
  59. });
  60. //设置封面图片的样式
  61. $(".photo-list ul li .img-box img").each(function () {
  62. if ($(this).attr("src") == $("#hidFocusPhoto").val()) {
  63. $(this).parent().addClass("selected");
  64. }
  65. });
  66. });
  67. //创建附件窗口
  68. function showAttachDialog(obj) {
  69. var objNum = arguments.length;
  70. var attachDialog = $.dialog({
  71. id: 'attachDialogId',
  72. lock: true,
  73. max: false,
  74. min: false,
  75. title: "上传附件",
  76. content: 'url:dialog/dialog_attach.aspx',
  77. width: 500,
  78. height: 180
  79. });
  80. //如果是修改状态,将对象传进去
  81. if (objNum == 1) {
  82. attachDialog.data = obj;
  83. }
  84. }
  85. //删除附件节点
  86. function delAttachNode(obj) {
  87. $(obj).parent().remove();
  88. }
  89. </script>
  90. </head>
  91. <body class="mainbody">
  92. <form id="form1" runat="server">
  93. <!--导航栏-->
  94. <div class="location">
  95. <a href="school_list.aspx" class="back"><i></i><span>
  96. 返回列表页</span></a> <a href="../center.aspx" class="home"><i></i><span>首页</span></a>
  97. <i class="arrow"></i><a href="homework_list.aspx"><span>
  98. 内容管理</span></a> <i class="arrow"></i><span>编辑信息</span>
  99. </div>
  100. <div class="line10">
  101. </div>
  102. <!--/导航栏-->
  103. <!--内容-->
  104. <div class="content-tab-wrap">
  105. <div id="floatHead" class="content-tab">
  106. <div class="content-tab-ul-wrap">
  107. <ul>
  108. <li><a href="javascript:;" οnclick="tabs(this);" class="selected">基本信息</a></li>
  109. </ul>
  110. </div>
  111. </div>
  112. </div>
  113. <div id="editview" runat="server" class="tab-content">
  114. <dl>
  115. <dt>公司名称</dt>
  116. <dd>
  117. <asp:TextBox ID="appName" runat="server" CssClass="input normal" datatype="*2-100"
  118. sucmsg=" " />
  119. <span class="Validform_checktip">*标题最多100个字符</span>
  120. </dd>
  121. </dl>
  122. <dl>
  123. <dt>联系电话</dt>
  124. <dd>
  125. <asp:TextBox ID="appShName" runat="server" CssClass="input normal" datatype="*2-100"
  126. sucmsg=" " />
  127. <span class="Validform_checktip">*标题最多100个字符(不可更改)</span>
  128. </dd>
  129. </dl>
  130. <dl>
  131. <dt>公司地址</dt>
  132. <dd>
  133. <asp:TextBox ID="TextBox1" runat="server" CssClass="input normal" datatype="*2-100"
  134. sucmsg=" " />
  135. <span class="Validform_checktip">*标题最多100个字符(不可更改)</span>
  136. </dd>
  137. </dl>
  138. <dl id="textView" runat="server">
  139. <dt>公司简介</dt>
  140. <dd>
  141. <asp:TextBox ID="txtSendEmail" runat="server" CssClass="input" TextMode="MultiLine"
  142. datatype="*0-255" sucmsg=" "></asp:TextBox>
  143. <span class="Validform_checktip">公司简介,255个字符以内</span>
  144. </dd>
  145. </dl>
  146. </div>
  147. <div id="field_tab_content" runat="server" visible="false" class="tab-content" style="display: none">
  148. </div>
  149. <!--/内容-->
  150. <!--工具栏-->
  151. <div id="foottool" runat="server" class="page-footer">
  152. <div class="btn-list">
  153. <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
  154. <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" οnclick="javascript: history.back(-1);" />
  155. </div>
  156. <div class="clear">
  157. </div>
  158. </div>
  159. <!--/工具栏-->
  160. </form>
  161. </body>
  162. </html>




  
  1. using DTcms.Common;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Configuration;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. namespace DTcms.Web.admin.oacmp
  10. {
  11. public partial class companyEdit : Web.UI.ManagePage
  12. {
  13. private static string appRootPath = ConfigurationManager.AppSettings["appRootPath"];
  14. private string action = DTEnums.ActionEnum.Add.ToString(); //操作类型
  15. protected string channel_name = string.Empty; //频道名称
  16. private int id = 0;
  17. //页面加载事件
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. string _action = DTRequest.GetQueryString("action");
  21. if (!string.IsNullOrEmpty(_action) && _action == DTEnums.ActionEnum.Edit.ToString())
  22. {
  23. this.action = DTEnums.ActionEnum.Edit.ToString();//修改类型
  24. this.id = DTRequest.GetQueryInt("id");
  25. if (this.id == 0)
  26. {
  27. JscriptMsg("传输参数不正确!", "back", "Error");
  28. return;
  29. }
  30. if (!new BLL.oa_company().Exists(this.id))
  31. {
  32. JscriptMsg("信息不存在或已被删除!", "back", "Error");
  33. return;
  34. }
  35. }
  36. if (!Page.IsPostBack)
  37. {
  38. NewsChkAdminLevel(); //检查权限
  39. if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
  40. {
  41. ShowInfo(this.id);
  42. }
  43. }
  44. }
  45. public void NewsChkAdminLevel()
  46. {
  47. Model.manager model = GetAdminInfo();
  48. if (model.role_type <= 0)
  49. {
  50. string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\", \"Error\")";
  51. Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
  52. Response.End();
  53. }
  54. }
  55. #region 赋值操作=================================
  56. private void ShowInfo(int _id)
  57. {
  58. BLL.oa_company bll = new BLL.oa_company();
  59. Model.oa_company model = bll.GetModel(_id);
  60. Model.manager modelMan = GetAdminInfo();
  61. }
  62. #endregion
  63. #region 增加操作=================================
  64. private bool DoAdd()
  65. {
  66. bool result = false;
  67. Model.oa_company model = new Model.oa_company();
  68. BLL.oa_company bll = new BLL.oa_company();
  69. Model.manager modelMan = GetAdminInfo();
  70. if (bll.Add(model) == true)
  71. {
  72. AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加成功"); //记录日志
  73. result = true;
  74. }
  75. return result;
  76. }
  77. #endregion
  78. #region 修改操作=================================
  79. private bool DoEdit(int _id)
  80. {
  81. bool result = false;
  82. BLL.oa_company bll = new BLL.oa_company();
  83. Model.oa_company model = bll.GetModel(_id);
  84. if (bll.Update(model))
  85. {
  86. AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改成功"); //记录日志
  87. result = true;
  88. }
  89. return result;
  90. }
  91. #endregion
  92. //保存
  93. protected void btnSubmit_Click(object sender, EventArgs e)
  94. {
  95. if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
  96. {
  97. NewsChkAdminLevel(); //检查权限
  98. if (!DoEdit(this.id))
  99. {
  100. JscriptMsg("保存过程中发生错误啦!", "", "Error");
  101. return;
  102. }
  103. JscriptMsg("修改信息成功!", "AppList.aspx", "Success");
  104. }
  105. else //添加
  106. {
  107. NewsChkAdminLevel(); //检查权限
  108. if (!DoAdd())
  109. {
  110. JscriptMsg("保存过程中发生错误啦!", "", "Error");
  111. return;
  112. }
  113. JscriptMsg("添加信息成功!", "AppList.aspx", "Success");
  114. }
  115. Model.manager model = GetAdminInfo();
  116. }
  117. }
  118. }


文章来源: zzzili.blog.csdn.net,作者:清雨小竹,版权归原作者所有,如需转载,请联系作者。

原文链接:zzzili.blog.csdn.net/article/details/40342879

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。