gyhlw_dotnet/网站项目/VRS/Management/Exam/SceneBase_Edit.aspx.cs

67 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace VRS.Management.Exam
{
public partial class SceneBase_Edit : BasePage
{
//DataService.BLL.pro_exam_batch bll = new DataService.BLL.pro_exam_batch();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
DataService.BLL.admin_user bll_user = new DataService.BLL.admin_user();
DataService.BLL.admin_school bll_school = new DataService.BLL.admin_school();
DataService.BLL.pro_scene_base bll = new DataService.BLL.pro_scene_base();
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!IsPostBack)
{
DataLoad();
}
}
protected void DataLoad()
{
string Id = Request.Params["Id"];
if (!string.IsNullOrWhiteSpace(Id))
{
var model = bll.GetModel(Id);
name.Text = model.scene_name;
r1.Text = model.r1;
}
else
{
OnError(null);
}
}
protected void btnSure_Click(object sender, EventArgs e)
{
DataService.Model.pro_scene_base model = bll.GetModel(Request.Params["Id"]);
if (string.IsNullOrEmpty(name.Text.Trim()))
{
RadAjaxManager1.Alert("场景名称不能为空!");
return;
}
var id = Request.Params["Id"];
if (bll.GetRecordCount(string.Format(" scene_name = '{0}' and scene_id!='{1}' ", name.Text.Trim(), model.scene_id)) > 0)
{
RadAjaxManager1.Alert("场景名称称禁止重复!");
return;
}
model.r1 = r1.Text.Trim();
if (bll.Update(model))
{
log.write_log("修改场景成功。" + "场景名称:" + name.Text.Trim() + "批次id" + model.scene_id);
RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();");
}
else
RadAjaxManager1.Alert("修改失败!");
}
}
}