protected void BindGv() { System.Collections.Generic.List <PTStopMsg> list = ( from stop in this.stopMsgServer where stop.PrjGuid == this.hfldPrjId.Value select stop into list0 orderby list0.InputDate descending select list0).ToList <PTStopMsg>(); this.gvStopMsg.DataSource = list; this.gvStopMsg.DataBind(); if (list.Count <= 0) { this.hfldIsAllowAdd.Value = "1"; return; } PTStopMsg stopMsg = list.FirstOrDefault <PTStopMsg>(); PTRetMsgService source = new PTRetMsgService(); System.Collections.Generic.List <PTRetMsg> list2 = ( from ret in source where ret.StopMsgId == stopMsg.StopMsgId && ret.FlowState.Value == 1 select ret).ToList <PTRetMsg>(); if (list2.Count > 0) { this.hfldIsAllowAdd.Value = "1"; return; } this.hfldIsAllowAdd.Value = "0"; }
protected void BindInfos() { this.hfldStopMsgId.Value = this.stopMsgId; PTStopMsg byId = this.stopMsgServer.GetById(this.stopMsgId); if (byId != null) { this.txtConstArea.Text = byId.ConstArea; this.txtConstructionUnit.Text = byId.ConstUnit; this.txtProjectMileage.Text = byId.ProjectMileage; this.txtStopDate.Text = byId.StopDate.ToString("yyyy-MM-dd"); this.txtStopReason.Text = byId.StopReason; this.txtMainContent.Text = byId.MainContent; this.txtProjectProblem.Text = byId.ProjectProblem; this.txtProblemReason.Text = byId.ProblemReason; this.txtImpactLossDegree.Text = byId.ImpactLossDegree; this.txtRemedialMeasure.Text = byId.RemedialMeasure; this.txtSupervisorSign.Text = byId.SupervisorSign; if (byId.SupervisorSignDate.HasValue) { this.txtSupervisorSignDate.Text = byId.SupervisorSignDate.Value.ToString("yyyy-MM-dd"); } this.txtGeneralSign.Text = byId.GeneralSign; if (byId.GeneralSignDate.HasValue) { this.txtGeneralSignDate.Text = byId.GeneralSignDate.Value.ToString("yyyy-MM-dd"); } this.hfldInputDate.Value = byId.InputDate.ToString(); this.hfldInputUser.Value = byId.InputUser; } }
protected void btnDelete_Click(object sender, System.EventArgs e) { try { string value = this.hfldStopMsgChecked.Value; PTStopMsg byId = this.stopMsgServer.GetById(value); this.stopMsgServer.Delete(byId); this.BindGv(); base.RegisterShow("系统提示", "删除成功!"); } catch { base.RegisterShow("系统提示", "删除失败!"); } }
protected void btnSave_Click(object sender, System.EventArgs e) { if (string.IsNullOrEmpty(this.txtStopDate.Text.Trim())) { base.RegisterShow("系统提示", "停工日期必须输入!"); return; } if (this.type == "edit") { PTStopMsg model = this.GetModel(); this.stopMsgServer.Update(model); } else { PTStopMsg model2 = this.GetModel(); this.stopMsgServer.Add(model2); } base.RegisterScript("top.ui.tabSuccess({ parentName: '_StopMsgEdit' });"); }
protected void BindProject() { ProjectInfo byId = ProjectInfo.GetById(this.prjId); this.txtPrjName.Text = byId.PrjName; this.hfldPrjGuid.Value = this.prjId; PTStopMsgService source = new PTStopMsgService(); PTStopMsg pTStopMsg = ( from stop in source where stop.PrjGuid == this.prjId select stop into list orderby list.InputDate descending select list).FirstOrDefault <PTStopMsg>(); if (pTStopMsg != null) { this.hfldStopMsgId.Value = pTStopMsg.StopMsgId; } }
protected PTStopMsg GetModel() { PTStopMsg pTStopMsg = new PTStopMsg(); pTStopMsg.StopMsgId = this.hfldStopMsgId.Value; pTStopMsg.PrjGuid = this.hfldPrjGuid.Value.Trim(); pTStopMsg.ConstArea = this.txtConstArea.Text.Trim(); pTStopMsg.ConstUnit = this.txtConstructionUnit.Text.Trim(); pTStopMsg.ProjectMileage = this.txtProjectMileage.Text.Trim(); pTStopMsg.StopDate = System.Convert.ToDateTime(this.txtStopDate.Text.Trim()); pTStopMsg.StopReason = this.txtStopReason.Text.Trim(); pTStopMsg.MainContent = this.txtMainContent.Text.Trim(); pTStopMsg.ProjectProblem = this.txtProjectProblem.Text.Trim(); pTStopMsg.ProblemReason = this.txtProblemReason.Text.Trim(); pTStopMsg.ImpactLossDegree = this.txtImpactLossDegree.Text.Trim(); pTStopMsg.RemedialMeasure = this.txtRemedialMeasure.Text.Trim(); pTStopMsg.SupervisorSign = this.txtSupervisorSign.Text.Trim(); if (!string.IsNullOrEmpty(this.txtSupervisorSignDate.Text.Trim())) { pTStopMsg.SupervisorSignDate = new System.DateTime?(System.Convert.ToDateTime(this.txtSupervisorSignDate.Text.Trim())); } else { pTStopMsg.SupervisorSignDate = null; } pTStopMsg.GeneralSign = this.txtGeneralSign.Text.Trim(); if (!string.IsNullOrEmpty(this.txtGeneralSignDate.Text.Trim())) { pTStopMsg.GeneralSignDate = new System.DateTime?(System.Convert.ToDateTime(this.txtGeneralSignDate.Text.Trim())); } else { pTStopMsg.GeneralSignDate = null; } pTStopMsg.FlowState = new int?(-1); pTStopMsg.InputUser = this.hfldInputUser.Value; pTStopMsg.InputDate = System.Convert.ToDateTime(this.hfldInputDate.Value); return(pTStopMsg); }
protected void BindInfos() { PTStopMsg byId = this.stopMsgServer.GetById(this.stopMsgId); if (byId != null) { string text = " 年 月 日"; ProjectInfo byId2 = ProjectInfo.GetById(byId.PrjGuid); this.txtPrjName.Text = byId2.PrjName; this.txtConstArea.Text = byId.ConstArea; this.txtConstructionUnit.Text = byId.ConstUnit; this.txtProjectMileage.Text = byId.ProjectMileage; this.txtStopDate.Text = byId.StopDate.ToString("yyyy年MM月dd日"); this.txtStopReason.Text = byId.StopReason; this.txtMainContent.Text = byId.MainContent; this.txtProjectProblem.Text = byId.ProjectProblem; this.txtProblemReason.Text = byId.ProblemReason; this.txtImpactLossDegree.Text = byId.ImpactLossDegree; this.txtRemedialMeasure.Text = byId.RemedialMeasure; this.txtSupervisorSign.Text = byId.SupervisorSign; if (byId.SupervisorSignDate.HasValue) { this.txtSupervisorSignDate.Text = byId.SupervisorSignDate.Value.ToString("yyyy年MM月dd日"); } else { this.txtSupervisorSignDate.Text = text; } this.txtGeneralSign.Text = byId.GeneralSign; if (byId.GeneralSignDate.HasValue) { this.txtGeneralSignDate.Text = byId.GeneralSignDate.Value.ToString("yyyy年MM月dd日"); return; } this.txtGeneralSignDate.Text = text; } }