DTCMS_Detail
【摘要】
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyEdit.aspx.cs" Inherits="DTcms.Web.admin.oacmp.companyEdit" %><!DOCTYPE html><html xmlns="...
-
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companyEdit.aspx.cs" Inherits="DTcms.Web.admin.oacmp.companyEdit" %>
-
<!DOCTYPE html>
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<title>编辑信息</title>
-
<script type="text/javascript" src="../../scripts/jquery/jquery-1.10.2.min.js"></script>
-
<script type="text/javascript" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
-
<script type="text/javascript" src="../../scripts/lhgdialog/lhgdialog.js?skin=idialog"></script>
-
<script type="text/javascript" src="../../scripts/datepicker/WdatePicker.js"></script>
-
<script type="text/javascript" src="../../scripts/swfupload/swfupload.js"></script>
-
<script type="text/javascript" src="../../scripts/swfupload/swfupload.queue.js"></script>
-
<script type="text/javascript" src="../../scripts/swfupload/swfupload.handlers.js"></script>
-
<script type="text/javascript" charset="utf-8" src="../../editor/kindeditor-min.js"></script>
-
<script type="text/javascript" charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
-
<script type="text/javascript" src="../js/layout.js"></script>
-
<link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
-
<script type="text/javascript">
-
$(function () {
-
//初始化表单验证
-
$("#form1").initValidform();
-
//计算用户组价格
-
$("#field_control_sell_price").change(function () {
-
var sprice = $(this).val();
-
if (sprice > 0) {
-
$(".groupprice").each(function () {
-
var num = $(this).attr("discount") * sprice / 100;
-
$(this).val(ForDight(num, 2));
-
});
-
}
-
});
-
//初始化编辑器
-
var editor = KindEditor.create('.editor', {
-
width: '98%',
-
height: '350px',
-
resizeType: 1,
-
uploadJson: '../../tools/upload_ajax.ashx?action=EditorFile&IsWater=1',
-
fileManagerJson: '../../tools/upload_ajax.ashx?action=ManagerFile',
-
allowFileManager: true
-
});
-
var editorMini = KindEditor.create('.editor-mini', {
-
width: '98%',
-
height: '250px',
-
resizeType: 1,
-
uploadJson: '../../tools/upload_ajax.ashx?action=EditorFile&IsWater=1',
-
items: [
-
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
-
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
-
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
-
});
-
//初始化上传控件
-
$(".upload-img").each(function () {
-
$(this).InitSWFUpload({ sendurl: "../../tools/upload_ajax.ashx", flashurl: "../../scripts/swfupload/swfupload.swf" });
-
});
-
$(".upload-album").each(function () {
-
$(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;" });
-
});
-
$(".attach-btn").click(function () {
-
showAttachDialog();
-
});
-
//设置封面图片的样式
-
$(".photo-list ul li .img-box img").each(function () {
-
if ($(this).attr("src") == $("#hidFocusPhoto").val()) {
-
$(this).parent().addClass("selected");
-
}
-
});
-
});
-
//创建附件窗口
-
function showAttachDialog(obj) {
-
var objNum = arguments.length;
-
var attachDialog = $.dialog({
-
id: 'attachDialogId',
-
lock: true,
-
max: false,
-
min: false,
-
title: "上传附件",
-
content: 'url:dialog/dialog_attach.aspx',
-
width: 500,
-
height: 180
-
});
-
//如果是修改状态,将对象传进去
-
if (objNum == 1) {
-
attachDialog.data = obj;
-
}
-
}
-
//删除附件节点
-
function delAttachNode(obj) {
-
$(obj).parent().remove();
-
}
-
</script>
-
-
</head>
-
<body class="mainbody">
-
<form id="form1" runat="server">
-
<!--导航栏-->
-
<div class="location">
-
<a href="school_list.aspx" class="back"><i></i><span>
-
返回列表页</span></a> <a href="../center.aspx" class="home"><i></i><span>首页</span></a>
-
<i class="arrow"></i><a href="homework_list.aspx"><span>
-
内容管理</span></a> <i class="arrow"></i><span>编辑信息</span>
-
</div>
-
<div class="line10">
-
</div>
-
<!--/导航栏-->
-
<!--内容-->
-
<div class="content-tab-wrap">
-
<div id="floatHead" class="content-tab">
-
<div class="content-tab-ul-wrap">
-
<ul>
-
<li><a href="javascript:;" οnclick="tabs(this);" class="selected">基本信息</a></li>
-
</ul>
-
</div>
-
</div>
-
</div>
-
<div id="editview" runat="server" class="tab-content">
-
<dl>
-
<dt>公司名称</dt>
-
<dd>
-
<asp:TextBox ID="appName" runat="server" CssClass="input normal" datatype="*2-100"
-
sucmsg=" " />
-
<span class="Validform_checktip">*标题最多100个字符</span>
-
</dd>
-
</dl>
-
-
<dl>
-
<dt>联系电话</dt>
-
<dd>
-
<asp:TextBox ID="appShName" runat="server" CssClass="input normal" datatype="*2-100"
-
sucmsg=" " />
-
<span class="Validform_checktip">*标题最多100个字符(不可更改)</span>
-
</dd>
-
</dl>
-
-
<dl>
-
<dt>公司地址</dt>
-
<dd>
-
<asp:TextBox ID="TextBox1" runat="server" CssClass="input normal" datatype="*2-100"
-
sucmsg=" " />
-
<span class="Validform_checktip">*标题最多100个字符(不可更改)</span>
-
</dd>
-
</dl>
-
-
<dl id="textView" runat="server">
-
<dt>公司简介</dt>
-
<dd>
-
<asp:TextBox ID="txtSendEmail" runat="server" CssClass="input" TextMode="MultiLine"
-
datatype="*0-255" sucmsg=" "></asp:TextBox>
-
<span class="Validform_checktip">公司简介,255个字符以内</span>
-
</dd>
-
</dl>
-
-
</div>
-
-
<div id="field_tab_content" runat="server" visible="false" class="tab-content" style="display: none">
-
-
</div>
-
<!--/内容-->
-
<!--工具栏-->
-
<div id="foottool" runat="server" class="page-footer">
-
<div class="btn-list">
-
<asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
-
<input name="btnReturn" type="button" value="返回上一页" class="btn yellow" οnclick="javascript: history.back(-1);" />
-
</div>
-
<div class="clear">
-
</div>
-
</div>
-
<!--/工具栏-->
-
</form>
-
</body>
-
</html>
-
using DTcms.Common;
-
using System;
-
using System.Collections.Generic;
-
using System.Configuration;
-
using System.Linq;
-
using System.Web;
-
using System.Web.UI;
-
using System.Web.UI.WebControls;
-
-
namespace DTcms.Web.admin.oacmp
-
{
-
public partial class companyEdit : Web.UI.ManagePage
-
{
-
private static string appRootPath = ConfigurationManager.AppSettings["appRootPath"];
-
private string action = DTEnums.ActionEnum.Add.ToString(); //操作类型
-
protected string channel_name = string.Empty; //频道名称
-
private int id = 0;
-
-
-
//页面加载事件
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
string _action = DTRequest.GetQueryString("action");
-
-
if (!string.IsNullOrEmpty(_action) && _action == DTEnums.ActionEnum.Edit.ToString())
-
{
-
this.action = DTEnums.ActionEnum.Edit.ToString();//修改类型
-
this.id = DTRequest.GetQueryInt("id");
-
if (this.id == 0)
-
{
-
JscriptMsg("传输参数不正确!", "back", "Error");
-
return;
-
}
-
if (!new BLL.oa_company().Exists(this.id))
-
{
-
JscriptMsg("信息不存在或已被删除!", "back", "Error");
-
return;
-
}
-
}
-
if (!Page.IsPostBack)
-
{
-
NewsChkAdminLevel(); //检查权限
-
if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
-
{
-
ShowInfo(this.id);
-
}
-
}
-
}
-
-
-
public void NewsChkAdminLevel()
-
{
-
Model.manager model = GetAdminInfo();
-
if (model.role_type <= 0)
-
{
-
string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\", \"Error\")";
-
Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
-
Response.End();
-
}
-
-
}
-
-
#region 赋值操作=================================
-
private void ShowInfo(int _id)
-
{
-
BLL.oa_company bll = new BLL.oa_company();
-
Model.oa_company model = bll.GetModel(_id);
-
-
Model.manager modelMan = GetAdminInfo();
-
-
-
-
}
-
#endregion
-
-
#region 增加操作=================================
-
private bool DoAdd()
-
{
-
-
bool result = false;
-
Model.oa_company model = new Model.oa_company();
-
BLL.oa_company bll = new BLL.oa_company();
-
-
Model.manager modelMan = GetAdminInfo();
-
-
-
-
if (bll.Add(model) == true)
-
{
-
AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加成功"); //记录日志
-
result = true;
-
}
-
return result;
-
}
-
#endregion
-
-
#region 修改操作=================================
-
private bool DoEdit(int _id)
-
{
-
bool result = false;
-
BLL.oa_company bll = new BLL.oa_company();
-
Model.oa_company model = bll.GetModel(_id);
-
-
-
if (bll.Update(model))
-
{
-
-
AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改成功"); //记录日志
-
result = true;
-
}
-
return result;
-
}
-
#endregion
-
-
-
//保存
-
protected void btnSubmit_Click(object sender, EventArgs e)
-
{
-
if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
-
{
-
NewsChkAdminLevel(); //检查权限
-
if (!DoEdit(this.id))
-
{
-
JscriptMsg("保存过程中发生错误啦!", "", "Error");
-
return;
-
}
-
JscriptMsg("修改信息成功!", "AppList.aspx", "Success");
-
}
-
else //添加
-
{
-
NewsChkAdminLevel(); //检查权限
-
if (!DoAdd())
-
{
-
JscriptMsg("保存过程中发生错误啦!", "", "Error");
-
return;
-
}
-
JscriptMsg("添加信息成功!", "AppList.aspx", "Success");
-
}
-
-
Model.manager model = GetAdminInfo();
-
-
}
-
-
}
-
}
文章来源: zzzili.blog.csdn.net,作者:清雨小竹,版权归原作者所有,如需转载,请联系作者。
原文链接:zzzili.blog.csdn.net/article/details/40342879
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)