gyhlw_dotnet/网站项目/VRS/Management/VSAT/SubjectManage_Edit.aspx.cs

75 lines
2.3 KiB
C#
Raw Permalink 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.VSAT
{
public partial class SubjectManage_Edit : BasePage
{
DataService.BLL.pro_subject bll = new DataService.BLL.pro_subject();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//BindFaultType(dp_fault, "");
//BindSceneType(dp_scene, "");
DataLoad();
}
}
protected void DataLoad()
{
string Id = Request.Params["Id"];
if (!string.IsNullOrWhiteSpace(Id))
{
var model = bll.GetModel(Id);
subject_name.Text = model.subject_name;
dsc.Text = model.dsc;
dp_scene.SelectedValue = model.scene_id;
dp_fault.SelectedValue = model.fault_id;
start_time.SelectedDate = model.start_time;
r1.Text = model.r1;
}
else
{
OnError(null);
}
}
protected void btnSure_Click(object sender, EventArgs e)
{
/*
if (string.IsNullOrEmpty(dp_scene.SelectedValue))
{
RadAjaxManager1.Alert("场景不能为空!");
return;
}
*/
DataService.Model.pro_subject model = bll.GetModel(Request.Params["Id"]);
model.subject_name = subject_name.Text.Trim();
model.dsc = dsc.Text.Trim();
//model.scene_id = dp_scene.SelectedValue;
//model.fault_id = dp_fault.SelectedValue;
model.start_time = start_time.SelectedDate;
model.r1 = r1.Text;
if (bll.Update(model))
{
log.write_log("修改科目成功。" + "科目名称:" + subject_name.Text.Trim() + "科目ID" + model.subject_id);
RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();");
}
else
RadAjaxManager1.Alert("修改失败!");
}
}
}