CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.cs

48 lines
1.4 KiB
C#

using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.CQMS.Performance
{
public partial class OutDayEdit : PageBase
{
//主键
public string PerformanceGid
{
get
{
return (string)ViewState["PerformanceGid"];
}
set
{
ViewState["PerformanceGid"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//主键
PerformanceGid = Request.Params["PerformanceGid"];
//根据主键加载主表
var pModel = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid);
txtOutDay.Text = pModel.OutDay.ToString();
txtWorkRange.Text = pModel.WorkRange;
}
}
protected void btnEdit_Click(object sender, EventArgs e)
{
var pModel = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid);
pModel.OutDay = Convert.ToInt32(txtOutDay.Text);
pModel.WorkRange = txtWorkRange.Text.Trim();
Funs.DB.SubmitChanges();
ShowNotify("修改成功。", MessageBoxIcon.Success);
}
}
}