using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using System.Data;
|
using System.Data.SqlClient;
|
using CY.Model;
|
using CY.BLL;
|
using CY.Infrastructure.Common;
|
using CY.BLL.Sys;
|
using CY.BLL.EC;
|
using CY.Infrastructure.DESEncrypt;
|
using CY.Infrastructure.Query;
|
|
namespace CY.WebForm.Pages.Property
|
{
|
//吴辉
|
//行政物品分类
|
public partial class ShebeiCateEdit : BasePage
|
{
|
Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
|
OA_ShebeiCateBLL oA_WorkReminderBll = null;
|
|
public ShebeiCateEdit()
|
{
|
bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
|
oA_WorkReminderBll = new OA_ShebeiCateBLL();
|
}
|
|
//页面加载
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
InitData();
|
}
|
}
|
|
//数据加载
|
public void InitData()
|
{
|
OA_ShebeiCate m_OA_ShebeiCate = oA_WorkReminderBll.GetModelByKeyid(Request["keyid"].ToInt32());
|
if (m_OA_ShebeiCate != null)
|
{
|
this.txtCarNumber.Value = m_OA_ShebeiCate.Name;
|
}
|
}
|
|
//表单提交
|
protected void btn_submit_form(object sender, EventArgs e)
|
{
|
try
|
{
|
DateTime nowTime = DateTime.Now;
|
OA_ShebeiCate m_OA_ShebeiCate = oA_WorkReminderBll.GetModelByKeyid(Request["keyid"].ToInt32());
|
if (m_OA_ShebeiCate == null)
|
{
|
m_OA_ShebeiCate = new OA_ShebeiCate();
|
m_OA_ShebeiCate.MemberId = CurrentUser.MemberId;
|
m_OA_ShebeiCate.Status = 1;
|
m_OA_ShebeiCate.Remark = "";
|
}
|
m_OA_ShebeiCate.Name = this.txtCarNumber.Value;
|
m_OA_ShebeiCate.Operator = CurrentUser.ShortName;
|
m_OA_ShebeiCate.LastUpdateTime = nowTime;
|
|
if (Request["keyid"].ToInt32() > 0)
|
{
|
if (oA_WorkReminderBll.UpdateModel(m_OA_ShebeiCate))
|
JavaScript.MessageBox("更新成功", this, true, true);
|
else
|
JavaScript.MessageBox("更新失败", this);
|
}
|
else
|
{
|
if (oA_WorkReminderBll.InsertModel(m_OA_ShebeiCate))
|
{
|
txtCarNumber.Value = "";
|
JavaScript.MessageBox("新增成功", this, false, true);
|
}
|
else
|
{
|
JavaScript.MessageBox("操作失败", this);
|
}
|
}
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
JavaScript.MessageBox("操作失败", this);
|
}
|
}
|
}
|
}
|