1、项目环境设置
2、大屏数据调优
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
public partial class ScheduleEdit : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ScheduleId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ScheduleId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ScheduleId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Projectid
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Projectid"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Projectid"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
ScheduleId = Request.Params["ScheduleId"];
|
||||
Projectid = CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(ScheduleId))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Projectid))
|
||||
{
|
||||
Model.Sys_Schedule model = Funs.DB.Sys_Schedule.FirstOrDefault(x => x.ScheduleId == ScheduleId && x.ProjectId == Projectid);
|
||||
txtScheduleName.Text = model.ScheduleName;
|
||||
txtScheduleDate.Text = model.ScheduleDate.ToString();
|
||||
txtSortId.Text = model.SortId.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Sys_Schedule model = Funs.DB.Sys_Schedule.OrderByDescending(x => x.SortId).FirstOrDefault(x => x.ProjectId == Projectid);
|
||||
if (model != null)
|
||||
{
|
||||
txtSortId.Text = (model.SortId + 1).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
txtSortId.Text = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Sys_Schedule model = new Model.Sys_Schedule();
|
||||
model.ScheduleDate = Convert.ToDateTime(txtScheduleDate.Text);
|
||||
model.ScheduleName = txtScheduleName.Text.Trim();
|
||||
model.SortId = Convert.ToInt32(txtSortId.Text);
|
||||
model.ProjectId = Projectid;
|
||||
|
||||
if (!string.IsNullOrEmpty(ScheduleId))
|
||||
{
|
||||
model.ScheduleId = ScheduleId;
|
||||
ScheduleService.Update(model);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
model.ScheduleId = SQLHelper.GetNewID(typeof(Model.Sys_Schedule)); ;
|
||||
ScheduleService.Add(model);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user