76 lines
2.3 KiB
C#
76 lines
2.3 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
|
||
namespace VRS.Management.VSAT
|
||
{
|
||
public partial class TechKnowManage_Add : BasePage
|
||
{
|
||
DataService.BLL.pro_know bll = new DataService.BLL.pro_know();
|
||
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
|
||
DataService.BLL.pro_type_manage bll_type_manage = new DataService.BLL.pro_type_manage();
|
||
protected override void Page_Load(object sender, EventArgs e)
|
||
{
|
||
base.Page_Load(sender, e);
|
||
if (!IsPostBack)
|
||
{
|
||
|
||
}
|
||
}
|
||
protected void btnSure_Click(object sender, EventArgs e)
|
||
{
|
||
if (string.IsNullOrEmpty(title.Text.Trim()))
|
||
{
|
||
RadAjaxManager1.Alert("标题不能为空!");
|
||
return;
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(keyword.Text.Trim()))
|
||
{
|
||
RadAjaxManager1.Alert("关键字不能为空!");
|
||
return;
|
||
}
|
||
if (bll.GetRecordCount(string.Format(" title = '{0}' ", title.Text.Trim())) > 0)
|
||
{
|
||
RadAjaxManager1.Alert("标题禁止重复!");
|
||
return;
|
||
}
|
||
|
||
|
||
|
||
//设备名称唯一
|
||
DataService.Model.pro_know model = new DataService.Model.pro_know();
|
||
model.know_id = BasePage.GetNewId("know");
|
||
model.title = title.Text.Trim();
|
||
model.keyword = keyword.Text.Trim();
|
||
model.content = RadEditor1.Content;
|
||
|
||
|
||
|
||
string type_id = "";
|
||
var type = bll_type_manage.GetModelList(" type_name='维修知识' ").FirstOrDefault();
|
||
if (null != type)
|
||
{
|
||
type_id = type.type_id;
|
||
}
|
||
model.type_id = type_id;
|
||
if (bll.Add(model))
|
||
{
|
||
log.write_log("添加维修知识成功。" + "名称:" + model.title + ",ID:" + model.know_id);
|
||
RadAjaxManager1.ResponseScripts.Add("alert('添加成功!');CloseAndRebind();");
|
||
}
|
||
else
|
||
{
|
||
RadAjaxManager1.Alert("添加失败!");
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |