protected IntendanceMaster GetIntendanceMaster() { IntendanceMaster intendanceMaster = new IntendanceMaster(); if (this.opType == "add") { intendanceMaster.IntendanceGuid = Guid.NewGuid(); this.IntendanceGuid = intendanceMaster.IntendanceGuid; intendanceMaster.QuestionTag = 0; } else { intendanceMaster.IntendanceGuid = this.IntendanceGuid; } intendanceMaster.PrjGuid = this.ProjectCode; intendanceMaster.QuestionTitle = this.txtQuestionTitle.Text; intendanceMaster.BookInDate = Convert.ToDateTime(this.txtDate.Text); intendanceMaster.SettleState = 0; intendanceMaster.SettleYhdm = this.hdfusercode.Value; if (!intendanceMaster.SettleYhdm.Contains("00000000")) { IntendanceMaster expr_A2 = intendanceMaster; expr_A2.SettleYhdm += "00000000,"; } intendanceMaster.QuestionTypeId = Convert.ToInt32(this.ddlType.SelectedValue); intendanceMaster.OpYhdm = base.UserCode; return(intendanceMaster); }
protected void DataBindToPage() { IntendanceMaster intendanceMaster = this.intendanceMasterAction.GetIntendanceMaster(this.IntendanceGuid); EPM_IntendanceInfo model = this.IntendanceInfoAction.GetModel(this.IntendanceGuid); userManageDb userManageDb = new userManageDb(); if (this.opType != "v" && this.opType != "add") { this.txtQuestionTitle.Text = intendanceMaster.QuestionTitle; this.txtDate.Text = intendanceMaster.BookInDate.ToString("yyyy-MM-dd"); this.ddlType.SelectedValue = intendanceMaster.QuestionTypeId.ToString(); this.txtPerson.Value = WebUtil.GetUserNamesComma(intendanceMaster.SettleYhdm); this.ManagerCode.Value = intendanceMaster.SettleYhdm; this.txtQuestion.Text = model.QuestionExplain; this.InfoGuid = model.NoteId; return; } if (this.opType == "v") { this.lbltype.Visible = true; this.lblQuestionTitle.Visible = true; this.lblDate.Visible = true; this.txtDate.Visible = false; this.ddlType.Visible = false; this.txtPerson.Visible = false; this.txtQuestionTitle.Visible = false; this.Img3.Visible = false; this.lblQuestionTitle.Text = intendanceMaster.QuestionTitle; this.lblDate.Text = intendanceMaster.BookInDate.ToString("yyyy-MM-dd"); this.lbltype.Text = this.intendanceMasterAction.GetQuestionNameById(intendanceMaster.QuestionTypeId); this.lblPerson.Text = userManageDb.GetUserName(intendanceMaster.SettleYhdm); this.InfoGuid = model.NoteId; } }
public IntendanceMaster GetIntendanceMaster(Guid IntendanceGuid) { string str = "select * from OPM_EPCM_IntendanceMaster where IntendanceGuid='" + IntendanceGuid + "'"; IntendanceMaster master = new IntendanceMaster(); DataSet set = publicDbOpClass.DataSetQuary(str.ToString()); if (set.Tables[0].Rows.Count <= 0) { return(null); } if (set.Tables[0].Rows[0]["IntendanceGuid"].ToString() != "") { master.IntendanceGuid = new Guid(set.Tables[0].Rows[0]["IntendanceGuid"].ToString()); } if (set.Tables[0].Rows[0]["prjGuid"].ToString() != "") { master.PrjGuid = new Guid(set.Tables[0].Rows[0]["prjGuid"].ToString()); } if (set.Tables[0].Rows[0]["QuestionTitle"].ToString() != "") { master.QuestionTitle = set.Tables[0].Rows[0]["QuestionTitle"].ToString(); } if (set.Tables[0].Rows[0]["BookInDate"].ToString() != "") { master.BookInDate = Convert.ToDateTime(set.Tables[0].Rows[0]["BookInDate"].ToString()); } if (set.Tables[0].Rows[0]["SettleState"].ToString() != "") { master.SettleState = int.Parse(set.Tables[0].Rows[0]["SettleState"].ToString()); } if (set.Tables[0].Rows[0]["QuestionTypeId"].ToString() != "") { master.QuestionTypeId = int.Parse(set.Tables[0].Rows[0]["QuestionTypeId"].ToString()); } if (set.Tables[0].Rows[0]["SettleYhdm"].ToString() != "") { master.SettleYhdm = set.Tables[0].Rows[0]["SettleYhdm"].ToString(); } if (set.Tables[0].Rows[0]["SettleToPerson"].ToString() != "") { master.SettleToPerson = set.Tables[0].Rows[0]["SettleToPerson"].ToString(); } if (set.Tables[0].Rows[0]["OpYhdm"].ToString() != "") { master.OpYhdm = set.Tables[0].Rows[0]["OpYhdm"].ToString(); } if (set.Tables[0].Rows[0]["QuestionTag"].ToString() != "") { master.QuestionTag = int.Parse(set.Tables[0].Rows[0]["QuestionTag"].ToString()); } return(master); }
protected void DataBindToPage() { IntendanceMaster intendanceMaster = this.intendanceMasterAction.GetIntendanceMaster(this.IntendanceGuid); EPM_IntendanceInfo model = this.IntendanceInfoAction.GetModel(this.IntendanceGuid); this.txtQuestionTitle.Text = intendanceMaster.QuestionTitle; this.txtDate.Text = intendanceMaster.BookInDate.ToString("yyyy-MM-dd"); this.lbltype.Text = this.intendanceMasterAction.GetQuestionNameById(intendanceMaster.QuestionTypeId); new userManageDb(); string userNamesComma = WebUtil.GetUserNamesComma(intendanceMaster.SettleYhdm); this.txtPerson.Text = userNamesComma; this.hdfusercode.Value = intendanceMaster.SettleToPerson; this.txtQuestion.Text = model.QuestionExplain; if (this.flag == 0) { this.txtSettleExplain.Text = model.SettleExplain; if (!string.IsNullOrEmpty(intendanceMaster.SettleToPerson)) { this.txtToPerson.Value = WebUtil.GetUserNamesComma(intendanceMaster.SettleToPerson); } } else { this.txtSettleExplain.Visible = false; this.lblSettleExplain.Visible = true; this.txtToCause.Visible = false; this.lblToCause.Visible = true; this.txtToPerson.Visible = false; this.lblToPerson.Visible = true; this.Img3.Visible = false; if (!string.IsNullOrEmpty(intendanceMaster.SettleToPerson)) { this.lblToPerson.Text = WebUtil.GetUserNamesComma(intendanceMaster.SettleToPerson); } this.lblSettleExplain.Text = model.SettleExplain; this.lblToCause.Text = model.ToCause; this.lbl1.Text = userNamesComma + "解决问题的回复时间 " + model.SettleDate; } this.InfoGuid = model.NoteId; }
public int Update(IntendanceMaster intendanceMaster) { StringBuilder builder = new StringBuilder(); builder.Append(" Begin "); builder.Append("update OPM_EPCM_IntendanceMaster set "); Guid intendanceGuid = intendanceMaster.IntendanceGuid; builder.Append("IntendanceGuid='" + intendanceMaster.IntendanceGuid + "',"); Guid prjGuid = intendanceMaster.PrjGuid; builder.Append("PrjGuid='" + intendanceMaster.PrjGuid + "',"); if (intendanceMaster.QuestionTitle != null) { builder.Append("QuestionTitle='" + intendanceMaster.QuestionTitle + "',"); } int questionTypeId = intendanceMaster.QuestionTypeId; builder.Append("QuestionTypeId='" + intendanceMaster.QuestionTypeId + "',"); if (intendanceMaster.SettleYhdm != null) { builder.Append("SettleYhdm='" + intendanceMaster.SettleYhdm + "',"); } if (intendanceMaster.SettleToPerson != null) { builder.Append("SettleToPerson='" + intendanceMaster.SettleToPerson + "',"); } DateTime bookInDate = intendanceMaster.BookInDate; builder.Append("BookInDate='" + intendanceMaster.BookInDate + "',"); int settleState = intendanceMaster.SettleState; builder.Append("SettleState=" + intendanceMaster.SettleState); builder.Append(" where IntendanceGuid='" + intendanceMaster.IntendanceGuid + "'"); builder.Append(" end "); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
public int Add(IntendanceMaster intendanceMaster, string userCode) { StringBuilder builder = new StringBuilder(); builder.Append(" Begin "); StringBuilder builder2 = new StringBuilder(); StringBuilder builder3 = new StringBuilder(); Guid intendanceGuid = intendanceMaster.IntendanceGuid; builder2.Append("IntendanceGuid,"); builder3.Append("'" + intendanceMaster.IntendanceGuid + "',"); Guid prjGuid = intendanceMaster.PrjGuid; builder2.Append("PrjGuid,"); builder3.Append("'" + intendanceMaster.PrjGuid + "',"); if (intendanceMaster.QuestionTitle != null) { builder2.Append("QuestionTitle,"); builder3.Append("'" + intendanceMaster.QuestionTitle + "',"); } DateTime bookInDate = intendanceMaster.BookInDate; builder2.Append("BookInDate,"); builder3.Append("'" + intendanceMaster.BookInDate + "',"); int questionTypeId = intendanceMaster.QuestionTypeId; builder2.Append("QuestionTypeId,"); builder3.Append("'" + intendanceMaster.QuestionTypeId + "',"); if (intendanceMaster.SettleYhdm != null) { builder2.Append("SettleYhdm,"); builder3.Append("'" + intendanceMaster.SettleYhdm + "',"); } if (intendanceMaster.SettleToPerson != null) { builder2.Append("SettleToPerson,"); builder3.Append("'" + intendanceMaster.SettleToPerson + "',"); } if (intendanceMaster.OpYhdm != null) { builder2.Append("OpYhdm,"); builder3.Append("'" + intendanceMaster.OpYhdm + "',"); } int settleState = intendanceMaster.SettleState; builder2.Append("SettleState,"); builder3.Append(intendanceMaster.SettleState + ","); int questionTag = intendanceMaster.QuestionTag; builder2.Append("QuestionTag,"); builder3.Append("'" + intendanceMaster.QuestionTag + "',"); builder.Append("insert into OPM_EPCM_IntendanceMaster("); builder.Append(builder2.ToString().Remove(builder2.Length - 1)); builder.Append(")"); builder.Append(" values ("); builder.Append(builder3.ToString().Remove(builder3.Length - 1)); builder.Append(")"); builder.Append(";select @@IDENTITY "); builder.Append(" end "); return(publicDbOpClass.ExecSqlString(builder.ToString())); }