74 lines
2.2 KiB
C#
74 lines
2.2 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
|
||
namespace VRS.Management
|
||
{
|
||
public partial class ComHistory_Edit : BasePage
|
||
{
|
||
|
||
|
||
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
|
||
|
||
|
||
DataService.BLL.pro_com_history bll = new DataService.BLL.pro_com_history();
|
||
protected override void Page_Load(object sender, EventArgs e)
|
||
{
|
||
base.Page_Load(sender, e);
|
||
if (!IsPostBack)
|
||
{
|
||
BindYears(dp_yearInfo);
|
||
DataLoad();
|
||
}
|
||
}
|
||
|
||
protected void DataLoad()
|
||
{
|
||
string Id = Request.Params["Id"];
|
||
if (!string.IsNullOrWhiteSpace(Id))
|
||
{
|
||
var model = bll.GetModel(Id);
|
||
dp_yearInfo.SelectedValue = model.year_info;
|
||
head.Text = model.head;
|
||
dsc_content.Text = model.dsc;
|
||
|
||
}
|
||
else
|
||
{
|
||
OnError(null);
|
||
}
|
||
}
|
||
|
||
protected void btnSure_Click(object sender, EventArgs e)
|
||
{
|
||
var model = bll.GetModel(Request.Params["Id"]);
|
||
if (string.IsNullOrEmpty(head.Text.Trim()))
|
||
{
|
||
RadAjaxManager1.Alert("标题不能为空!");
|
||
return;
|
||
}
|
||
var id = Request.Params["Id"];
|
||
/*
|
||
if (bll.GetRecordCount(string.Format(" soft_name = '{0}' and soft_id!='{1}' ", name.Text.Trim(), model.soft_id)) > 0)
|
||
{
|
||
RadAjaxManager1.Alert("类型名称称禁止重复!");
|
||
return;
|
||
}
|
||
*/
|
||
model.year_info = dp_yearInfo.SelectedValue;
|
||
model.head = head.Text.Trim();
|
||
model.dsc = dsc_content.Text.Trim();
|
||
|
||
if (bll.Update(model))
|
||
{
|
||
log.write_log("修改公司历程成功。" + "标题:" + head.Text.Trim() + ",id:" + model.id);
|
||
RadAjaxManager1.ResponseScripts.Add("alert('修改成功!');CloseAndRebind();");
|
||
}
|
||
else
|
||
RadAjaxManager1.Alert("修改失败!");
|
||
}
|
||
}
|
||
} |