提交试车代码
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
{
|
||||
public partial class FourDecisionProposerHandleEdit : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string DecisionId
|
||||
{
|
||||
get { return (string)ViewState["DecisionId"]; }
|
||||
set { ViewState["DecisionId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否查看
|
||||
/// </summary>
|
||||
public bool IsView
|
||||
{
|
||||
get { return (bool)ViewState["IsView"]; }
|
||||
set { ViewState["IsView"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 问题图片是否可编辑
|
||||
/// </summary>
|
||||
public int QuestionEditImg
|
||||
{
|
||||
get { return (int)ViewState["QuestionEditImg"]; }
|
||||
set { ViewState["QuestionEditImg"] = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.DecisionId = Request["DecisionId"];
|
||||
//是否查看
|
||||
this.IsView = string.IsNullOrWhiteSpace(Request["IsView"]) ? false : bool.Parse(Request["IsView"]);
|
||||
//数据绑定
|
||||
PageInit();
|
||||
//判断是否查看
|
||||
if (IsView)
|
||||
{
|
||||
btnReturn.Hidden = true;
|
||||
btnSave.Hidden = true;
|
||||
QuestionEditImg = -1;
|
||||
lblResponsibilityUnit.Enabled = false;
|
||||
lblQuestionDesc.Enabled = false;
|
||||
lblRestrictCondition.Enabled = false;
|
||||
lblLevel.Enabled = false;
|
||||
lblSpeciality.Enabled = false;
|
||||
lblAskDestructionTime.Enabled = false;
|
||||
lblRealityDestructionTime.Enabled = false;
|
||||
lblResponsibilityUser.Enabled = false;
|
||||
lblProposeUser.Enabled = false;
|
||||
lblGeneraUser.Enabled = false;
|
||||
lblSupervisionUser.Enabled = false;
|
||||
lblOwnerUser.Enabled = false;
|
||||
lblDecisionIsClose.Enabled = false;
|
||||
txtConfirmDesc.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 默认绑定
|
||||
/// </summary>
|
||||
public void PageInit()
|
||||
{
|
||||
QuestionEditImg = 0;
|
||||
var query = from a in Funs.DB.PreRun_SubThreeChecksFourDecision
|
||||
join b in Funs.DB.Base_Project on a.ProjectId equals b.ProjectId
|
||||
join c in Funs.DB.Base_Unit on a.ResponsibilityUnit equals c.UnitId
|
||||
join d in Funs.DB.Sys_User on a.ResponsibilityUser equals d.UserId
|
||||
join e in Funs.DB.Sys_User on a.ProposeUser equals e.UserId
|
||||
join f in Funs.DB.Sys_User on a.GeneraUser equals f.UserId
|
||||
join g in Funs.DB.Sys_User on a.SupervisionUser equals g.UserId
|
||||
join h in Funs.DB.Sys_User on a.OwnerUser equals h.UserId
|
||||
where a.DecisionId == this.DecisionId
|
||||
select new
|
||||
{
|
||||
a.DecisionId,
|
||||
a.ProjectId,
|
||||
b.ProjectName,
|
||||
a.ResponsibilityUnit,
|
||||
ResponsibilityUnitName = c.UnitName,
|
||||
a.ResponsibilityUser,
|
||||
ResponsibilityUserName = d.UserName,
|
||||
a.ProposeUser,
|
||||
ProposeUserName = e.UserName,
|
||||
a.GeneraUser,
|
||||
GeneraUserName = f.UserName,
|
||||
a.SupervisionUser,
|
||||
SupervisionUserName = g.UserName,
|
||||
a.OwnerUser,
|
||||
OwnerUserName = h.UserName,
|
||||
a.QuestionDesc,
|
||||
a.Level,
|
||||
a.Speciality,
|
||||
a.AskDestructionTime,
|
||||
a.RealityDestructionTime,
|
||||
a.RestrictCondition,
|
||||
a.DecisionIsClose,
|
||||
DecisionIsCloseName = a.DecisionIsClose == 1 ? "已关闭" : "未关闭"
|
||||
};
|
||||
var model = query.FirstOrDefault();
|
||||
if (model != null)
|
||||
{
|
||||
lblProjectName.Text = model.ProjectName;
|
||||
lblResponsibilityUnit.Text = model.ResponsibilityUnitName;
|
||||
lblQuestionDesc.Text = model.QuestionDesc;
|
||||
lblRestrictCondition.Text = model.RestrictCondition;
|
||||
lblLevel.Text = model.Level;
|
||||
lblSpeciality.Text = model.Speciality;
|
||||
lblAskDestructionTime.Text = model.AskDestructionTime.Value != null ? model.AskDestructionTime.Value.ToString("yyyy-MM-dd") : string.Empty;
|
||||
lblRealityDestructionTime.Text = model.RealityDestructionTime != null ? model.RealityDestructionTime.Value.ToString("yyyy-MM-dd") : string.Empty;
|
||||
lblResponsibilityUser.Text = model.ResponsibilityUserName;
|
||||
lblProposeUser.Text = model.ProposeUserName;
|
||||
lblGeneraUser.Text = model.GeneraUserName;
|
||||
lblSupervisionUser.Text = model.SupervisionUserName;
|
||||
lblOwnerUser.Text = model.OwnerUserName;
|
||||
lblDecisionIsClose.Text = model.DecisionIsCloseName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 问题图片查看
|
||||
/// </summary>
|
||||
protected void imgBtnQuestionFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/CheckControl&menuId={2}", QuestionEditImg, this.DecisionId + "q", Const.InspectTailTerm)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退回
|
||||
/// </summary>
|
||||
protected void btnReturn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var decisionModel = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == this.DecisionId);
|
||||
if (decisionModel != null)
|
||||
{
|
||||
decisionModel.ResponsibilityProposeSatate = 2;
|
||||
var model = new PreRun_DecisionConfirmRecords();
|
||||
model.ConfirmId = Guid.NewGuid().ToString();
|
||||
model.ProjectId = this.CurrUser.LoginProjectId;
|
||||
model.DecisionId = this.DecisionId;
|
||||
model.ConfirmDesc = txtConfirmDesc.Text;
|
||||
model.ConfirmTime = DateTime.Now;
|
||||
model.ConfirmUser = this.CurrUser.UserId;
|
||||
model.ConfirmType = 1;
|
||||
model.ConfirmState = 2;
|
||||
model.AddUser = this.CurrUser.UserId;
|
||||
model.AddTime = DateTime.Now;
|
||||
Funs.DB.PreRun_DecisionConfirmRecords.InsertOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
ShowNotify("退回成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 确认并提交责任人确认
|
||||
/// </summary>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var decisionModel = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == this.DecisionId);
|
||||
if (decisionModel != null)
|
||||
{
|
||||
decisionModel.ResponsibilityProposeSatate = 3;
|
||||
decisionModel.ProposeHandleData = DateTime.Now;
|
||||
var model = new PreRun_DecisionConfirmRecords();
|
||||
model.ConfirmId = Guid.NewGuid().ToString();
|
||||
model.ProjectId = this.CurrUser.LoginProjectId;
|
||||
model.DecisionId = this.DecisionId;
|
||||
model.ConfirmDesc = txtConfirmDesc.Text;
|
||||
model.ConfirmTime = DateTime.Now;
|
||||
model.ConfirmUser = this.CurrUser.UserId;
|
||||
model.ConfirmType = 1;
|
||||
model.ConfirmState = 1;
|
||||
model.AddUser = this.CurrUser.UserId;
|
||||
model.AddTime = DateTime.Now;
|
||||
Funs.DB.PreRun_DecisionConfirmRecords.InsertOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
ShowNotify("确认并提交责任人确认成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭
|
||||
/// </summary>
|
||||
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user