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

66 lines
2.0 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 TechRuleManage : BasePage
{
DataService.BLL.pro_know bll = new DataService.BLL.pro_know();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Dataload();
}
}
private void Dataload()
{
var typeModel = GetTypeByName("技术规范");
if (typeModel != null)
{
var models = bll.GetModelList(string.Format(" type_id = '{0}' ", typeModel.type_id));
if (models.Any())
{
hideId.Value = models.First().know_id;
RadEditor1.Content = models.First().content;
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
var model = new DataService.Model.pro_know();
if (!string.IsNullOrWhiteSpace(hideId.Value))
{
model = bll.GetModel(hideId.Value);
model.content = RadEditor1.Content;
if (bll.Update(model))
{
log.write_log("更新技术规范成功。" + "ID" + hideId.Value);
}
}
else
{
model.know_id = Guid.NewGuid().ToString();
model.type_id = GetTypeByName("技术规范").type_id;
model.create_time = DateTime.Now;
model.content = RadEditor1.Content;
if (bll.Add(model))
{
log.write_log("添加技术规范成功。" + "ID" + model.know_id);
}
}
}
protected void btnReset_Click(object sender, EventArgs e)
{
Dataload();
}
}
}