/// **************************************************************************** /// <summary> /// 数据加载 /// </summary> /// **************************************************************************** private void LoadData() { try { WorkFlowActStrategyBuilder sb = new WorkFlowActStrategyBuilder(); sb.AddStrategy(new Strategy(DAL.QueryStrategy.WorkFlowActStrategyName.ActCode, this.ActCode)); string sql = sb.BuildMainQueryString(); QueryAgent QA = new QueryAgent(); EntityData entity = QA.FillEntityData("WorkFlowAct", sql); this.ViewState["_CaseCode"] = entity.CurrentRow["CaseCode"].ToString(); QA.Dispose(); entity.Dispose(); WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.ViewState["_CaseCode"].ToString()); this.ViewState["_ApplicationCode"] = workCase.ApplicationCode; Act currentAct = workCase.GetAct(this.ActCode); Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true); this.ViewState["_ProcedureCode"] = procedure.ProcedureCode; Task currentTask = procedure.GetTask(currentAct.ToTaskCode); this.contentspan.InnerHtml = WriteOpinion(workCase, currentTask, currentAct); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); } }
// ***************************************************************************** /// **************************************************************************** /// <summary> /// 提交意见按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// **************************************************************************** protected void btnSubmitOpinion_ServerClick(object sender, System.EventArgs e) { try { WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.ViewState["_CaseCode"].ToString()); Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true); Act currentAct = workCase.GetAct(this.ActCode); Task currentTask = procedure.GetTask(currentAct.ToTaskCode); Rms.WorkFlow.WorkCaseManager.SaveSignOpinionText(workCase, currentAct, currentTask, this.IUser.UserCode, this.HiddenOption.Value); BLL.WorkFlowRule.SaveWorkFlowCase(workCase); //WorkFlowSaveClick(this,EventArgs.Empty); Response.Write(Rms.Web.JavaScript.ScriptStart); Response.Write(Rms.Web.JavaScript.OpenerReload(false)); Response.Write(Rms.Web.JavaScript.WinClose(false)); Response.Write(Rms.Web.JavaScript.ScriptEnd); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); } }
protected void Button3_Click(object sender, EventArgs e) { try { WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.TxtCaseCode.Value.Trim()); Procedure procedure = DefinitionManager.GetProcedureDifinition(this.TxtProcedure.Value.Trim(), true); DataSet ds = Rms.WorkFlow.DefinitionManager.SaveProcedureDefinitionData(procedure); /////////////////创建属性表/////////////////// DataTable PropertyTable = BLL.WorkFlowRule.GetPropertyTable(workCase, procedure); if (PropertyTable.Select(this.textareasql.Value.Trim()).Length >= 0) { this.Response.Write("<script>window.alert('语法正确!')</script>"); } } catch (System.Exception ec) { this.Response.Write("<script>window.alert('语法错误!" + ec.Message + "')</script>"); } }
private void SaveCasePropertyValue(string PropertyName, string PropertyValue, string ProcedureCode) { string PropertyCode = ""; string WorkFlowCasePropertyCode = ""; Procedure procedure = DefinitionManager.GetProcedureDifinition(ProcedureCode, true); System.Collections.IDictionaryEnumerator ie = procedure.GetPropertyEnumerator(); while (ie.MoveNext()) { Property PropertyCase = (Property)ie.Value; if (PropertyCase.ProcedurePropertyName == PropertyName) { PropertyCode = PropertyCase.WorkFlowProcedurePropertyCode; } } if (this.CaseCode + "" != "") { WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.CaseCode); ie = workCase.GetCasePropertyEnumerator(); while (ie.MoveNext()) { CaseProperty CasePropertyCase = (CaseProperty)ie.Value; if (CasePropertyCase.ProcedurePropertyCode == PropertyCode) { WorkFlowCasePropertyCode = CasePropertyCase.WorkFlowCasePropertyCode; } } } if (PropertyCode != "") { CaseProperty CasePropertyCaseM = new CaseProperty(); CasePropertyCaseM.WorkFlowCasePropertyCode = WorkFlowCasePropertyCode; CasePropertyCaseM.CaseCode = this.CaseCode; CasePropertyCaseM.ProcedurePropertyCode = PropertyCode; CasePropertyCaseM.ProcedurePropertyValue = PropertyValue; RmsPM.BLL.WorkFlowRule.SaveCaseProperty(CasePropertyCaseM); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { /////////////////////////////////////////////////// string code = Request["ApplicationCode"] + ""; string caseCode = Request["CaseCode"] + ""; string procedureCode = Request["ProcedureCode"] + ""; string procedureName = Request["ProcedureName"] + ""; string userCode = Request["UserCode"] + ""; string unitCode = Request["UnitCodeCode"] + ""; this.ProjectCode = Request["ProjectCode"] + ""; //if (procedureCode == "") // procedureCode = BLL.WorkFlowRule.GetProcedureCodeByName(procedureName); bool isNew = (caseCode == ""); Procedure procedure = DefinitionManager.GetProcedureDifinition(procedureCode, true); string currentActCode = Request["ActCode"] + ""; Act currentAct = null; string actCode = ""; WorkCase workCase = null; if (isNew) { workCase = Rms.WorkFlow.WorkCaseManager.StartNewWorkCase(code, procedureCode, userCode, unitCode, ref actCode, "", ""); currentAct = (Act)(WorkCaseManager.GetActivityAct(workCase)[0]); } else { workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode); currentAct = workCase.GetAct(Request["ActCode"] + ""); } this.txtCurrentActCode.Value = currentAct.ActCode; Task currentTask = procedure.GetTask(currentAct.ToTaskCode); /////////////////////////////////////////////////// if (currentTask.CanManual == 1) { this.SendTable.Visible = false; this.SendTitle.Visible = false; this.CopyTable.Visible = false; this.CopyTitle.Visible = false; this.OpinionTitle.Visible = false; this.OpinionTable.Visible = false; this.MessageTitle.Visible = false; this.MessageTable.Visible = false; this.ButtonTable.Visible = false; this.pwdcheckdiv.Visible = true; } else { InitPageState(); } BLL.TemplateOpinion to = new BLL.TemplateOpinion(); to.UserCode = ((User)Session["User"]).UserCode; DataTable dt = to.GetTemplateOpinions(); if (dt.Rows.Count == 0) { this.sltTemplateOpinion.Visible = false; } else { this.sltTemplateOpinion.Visible = true; this.sltTemplateOpinion.DataSource = dt; this.sltTemplateOpinion.DataTextField = "Name"; this.sltTemplateOpinion.DataValueField = "Center"; this.sltTemplateOpinion.DataBind(); ListItem li = new ListItem(); li.Text = "--常用意见--"; li.Value = ""; li.Selected = true; this.sltTemplateOpinion.Items.Add(li); this.sltTemplateOpinion.Attributes["onchange"] = "javascript:document.all('FlowOpinion').value = this.value;"; } this.rdoCheck.Visible = (Request["IsAudit"] + "" == "1"); } }
private void LoadData() { string code = Request["ApplicationCode"] + ""; string caseCode = Request["CaseCode"] + ""; string procedureCode = Request["ProcedureCode"] + ""; string procedureName = Request["ProcedureName"] + ""; //if ( procedureCode == "" ) // procedureCode = BLL.WorkFlowRule.GetProcedureCodeByName(procedureName); bool isNew = (caseCode == ""); string userCode = Request["UserCode"] + ""; string unitCode = Request["UnitCodeCode"] + ""; Procedure procedure = DefinitionManager.GetProcedureDifinition(procedureCode, true); string currentActCode = Request["ActCode"] + ""; Act currentAct = null; string actCode = ""; WorkCase workCase = null; if (isNew) { workCase = Rms.WorkFlow.WorkCaseManager.StartNewWorkCase(code, procedureCode, userCode, unitCode, ref actCode, "", ""); currentAct = (Act)(WorkCaseManager.GetActivityAct(workCase)[0]); if (currentAct.ApplicationSubject != null) { this.rdoCheck.SelectedValue = currentAct.ApplicationSubject.ToString(); } } else { workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode); currentAct = workCase.GetAct(Request["ActCode"] + ""); if (currentAct.ApplicationSubject != null) { this.rdoCheck.SelectedValue = currentAct.ApplicationSubject.ToString(); } } //this.ChkShow.Checked = (currentAct.IsSleep == 1); System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator(); while (ie.MoveNext()) { Opinion Flowopinion = (Opinion)ie.Value; if (Flowopinion.ApplicationCode == currentAct.ActCode) { this.FlowOpinion.Value = Flowopinion.OpinionText; switch (this.up_sPMName.ToLower()) { case "shimaopm": if (Flowopinion.OpinionText.Trim() == "") { Task firstTask = DefinitionManager.GetFirstTask(procedure); if (currentAct.ToTaskCode == firstTask.TaskCode) { this.FlowOpinion.Value = ""; } else { this.FlowOpinion.Value = "同意"; } } break; } } } this.txtCurrentActCode.Value = currentAct.ActCode; Task currentTask = procedure.GetTask(currentAct.ToTaskCode); //是否需要等待 this.WaitForFlag.Checked = (currentTask.CanEdit == 1); this.CopyName.InnerHtml = currentTask.TaskActorType; FillCopyUserSelect(workCase, procedure, currentTask); if (Request["Work"] + "" == "Send") { FillSendCopyUserSelect(workCase, procedure, currentTask); } this.txtProcedureCode.Value = procedureCode; this.txtCurrentTaskCode.Value = currentTask.TaskCode; if (currentTask.Copy != 1) { this.CopyTable.Visible = false; this.CopyTitle.Visible = false; } // 填充路由rbl DataSet ds = Rms.WorkFlow.DefinitionManager.SaveProcedureDefinitionData(procedure); DataView dv = new DataView(ds.Tables["WorkFlowRouter"], String.Format(" FromTaskCode='{0}' ", currentTask.TaskCode), "SortID", DataViewRowState.CurrentRows); /////////////////创建属性表/////////////////// DataTable PropertyTable = BLL.WorkFlowRule.GetPropertyTable(workCase, procedure); if (Request["Debug"] + "" == "1") { this.DataGrid1.DataSource = PropertyTable; this.DataGrid1.DataBind(); } //PropertyTable.Rows.Add(PropertyRow); for (int i = 0; i < dv.Table.Rows.Count; i++) { System.Collections.IDictionaryEnumerator iecondition = procedure.GetRouter((string)dv.Table.Rows[i]["RouterCode"]).GetConditionEnumerator(); if (iecondition.MoveNext()) { Condition condition = (Condition)iecondition.Value; if (PropertyTable.Select(condition.Description).Length == 0) { dv.Table.Rows.Remove(dv.Table.Rows[i]); i--; } } } if (Request["Debug"] + "" == "1") { this.DataGrid2.DataSource = dv.Table; this.DataGrid2.DataBind(); } /////////////////////////////////// int iCount = dv.Count; for (int i = 0; i < iCount; i++) { string routerCode = (String)dv[i].Row["RouterCode"]; string description = (String)dv[i].Row["Description"]; //Router router = (Router)ar[i]; if (procedure.GetTask(procedure.GetRouter(routerCode).ToTaskCode).TaskType != 2) { this.rblSelectRouter.Items.Add(new ListItem(description, routerCode)); } } if (this.rblSelectRouter.Items.Count > 0) { this.rblSelectRouter.SelectedIndex = 0; this.txtSelectRouterCode.Value = this.rblSelectRouter.SelectedItem.Value; FillUserSelect(workCase, this.rblSelectRouter.SelectedValue); } Session["WorkCaseApplicationTemp"] = workCase; }
private void LoadData() { string caseCode = Request["CaseCode"] + ""; string actCode = Request["ActCode"] + ""; this.ProjectCode = Request["ProjectCode"] + ""; WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode); Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true); Act currentAct = workCase.GetAct(Request["ActCode"] + ""); //this.ChkShow.Checked = (currentAct.IsSleep == 1); this.FlowOpinion.Value = "不同意"; System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator(); while (ie.MoveNext()) { Opinion Flowopinion = (Opinion)ie.Value; if (Flowopinion.ApplicationCode == currentAct.ActCode) { this.FlowOpinion.Value = Flowopinion.OpinionText; switch (this.up_sPMName.ToLower()) { case "shimaopm": if (Flowopinion.OpinionText.Trim() == "") { this.FlowOpinion.Value = "不同意"; } break; } } } Task currentTask = procedure.GetTask(currentAct.ToTaskCode); DataSet ds = Rms.WorkFlow.WorkCaseManager.SaveWorkCaseData(workCase); //BLL.ConvertRule.DataTableDistinctRow(ds.Tables["WorkFlowAct"],"FromTaskCode"); //BLL.ConvertRule.DataTableDistinctRow(ds.Tables["WorkFlowAct"],"FromTaskCode"); //DataView dv = new DataView( ds.Tables["WorkFlowAct"],String.Format(" FromTaskCode<>'{0}' and ActType <> 1 and Copy <> 1",currentTask.TaskCode),"",DataViewRowState.CurrentRows); //clm修改 日期:2006-11-2 DataView dv = new DataView(ds.Tables["WorkFlowAct"], String.Format(" FromTaskCode<>'{0}' and Copy <> 1", currentTask.TaskCode), "", DataViewRowState.CurrentRows); dv = BLL.ConvertRule.GetDistinct(dv, "FromTaskCode"); //BLL.ConvertRule.DataViewDistinctRow(dv,"FromTaskCode"); if (Request["Debug"] + "" == "1") { this.DataGrid1.DataSource = dv; this.DataGrid1.DataBind(); } int iCount = dv.Count; for (int i = 0; i < iCount; i++) { string FromTaskCode = (String)dv[i].Row["FromTaskCode"]; string FromTaskName = "退回给" + procedure.GetTask(FromTaskCode).TaskName; if (procedure.GetTask(FromTaskCode).TaskType != 1) { this.rblSelectRouter.Items.Add(new ListItem(FromTaskName, FromTaskCode)); } } if (this.rblSelectRouter.Items.Count > 0) { this.rblSelectRouter.SelectedIndex = 0; this.txtSelectRouterCode.Value = this.rblSelectRouter.SelectedItem.Value; FillUserSelect(workCase, this.rblSelectRouter.SelectedValue); } Session["WorkCaseApplicationTemp"] = workCase; }
private void LoadData() { string code = Request["ApplicationCode"] + ""; string caseCode = Request["CaseCode"] + ""; string procedureCode = Request["ProcedureCode"] + ""; string procedureName = Request["ProcedureName"] + ""; string userCode = Request["UserCode"] + ""; string unitCode = Request["UnitCodeCode"] + ""; this.ProjectCode = Request["ProjectCode"] + ""; WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode); Act currentAct = workCase.GetAct(Request["ActCode"] + ""); //this.ChkShow.Checked = (currentAct.IsSleep == 1); Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true); DataSet dsp = Rms.WorkFlow.DefinitionManager.SaveProcedureDefinitionData(procedure); DataView dvt = new DataView(dsp.Tables["WorkFlowTask"], String.Format(" TaskType=1 "), "", DataViewRowState.CurrentRows); DataView dvr = new DataView(dsp.Tables["WorkFlowRouter"], String.Format(" FromTaskCode='{0}' ", dvt[0].Row["TaskCode"].ToString()), "", DataViewRowState.CurrentRows); string FromTaskCode = dvr[0].Row["ToTaskCode"].ToString(); string FromTaskName = procedure.GetTask(FromTaskCode).TaskName; this.rblSelectRouter.Items.Add(new ListItem(FromTaskName, FromTaskCode)); if (this.rblSelectRouter.Items.Count > 0) { this.rblSelectRouter.SelectedIndex = 0; this.txtSelectRouterCode.Value = this.rblSelectRouter.SelectedItem.Value; } string userCodes = ""; System.Collections.IDictionaryEnumerator ieact = workCase.GetActEnumerator(); while (ieact.MoveNext()) { Act act = (Act)ieact.Value; if (act.FromTaskCode == dvt[0].Row["TaskCode"].ToString()) { userCodes = act.ActUserCode;//+",taskActorName=,,undefined;"; this.txtTaskActorIDs.Value += userCodes + ","; } } this.FlowOpinion.Value = "不同意"; System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator(); while (ie.MoveNext()) { Opinion Flowopinion = (Opinion)ie.Value; if (Flowopinion.ApplicationCode == currentAct.ActCode) { this.FlowOpinion.Value = Flowopinion.OpinionText; switch (this.up_sPMName.ToLower()) { case "shimaopm": if (Flowopinion.OpinionText.Trim() == "") { this.FlowOpinion.Value = "不同意"; } break; } } } this.txtCurrentActCode.Value = currentAct.ActCode; this.tdSelectTaskActors.InnerHtml = ""; StringBuilder sb = new StringBuilder(); string UserName = RmsPM.BLL.SystemRule.GetUserNameByProjectCode(userCodes, this.ProjectCode, null); sb.Append("<table border=0 cellpadding=0 cellspace=0>"); sb.Append("<tr>"); sb.Append(" <td nowrap> <input "); sb.Append(" checked "); sb.Append(" type=checkbox name=sta" + userCodes + " id=sta" + userCodes + " userName="******" value=" + userCodes + " taskActorID=" + userCodes + " taskActorName=" + " >"); sb.Append(UserName); sb.Append("</td>"); sb.Append("</tr>"); sb.Append("</table>"); this.tdSelectTaskActors.InnerHtml = sb.ToString(); Session["WorkCaseApplicationTemp"] = workCase; }
/// **************************************************************************** /// <summary> /// 执行 sql 语句将查询结果帮定显示。 /// </summary> /// **************************************************************************** private void LoadData1() { string sql = (string)this.ViewState["SqlString"]; QueryAgent qa = new QueryAgent(); EntityData entity = qa.FillEntityData("WorkFlowAct", sql); qa.Dispose(); //流程意见 DataColumn Opinion = new DataColumn(); Opinion.ColumnName = "Opinion"; Opinion.DefaultValue = ""; Opinion.DataType = System.Type.GetType("System.String"); //流程同意否决项 DataColumn Opinion1 = new DataColumn(); Opinion1.ColumnName = "OpinionConfirm"; Opinion1.DefaultValue = ""; Opinion1.DataType = System.Type.GetType("System.String"); //增加流程角色名 DataColumn Opinion2 = new DataColumn(); Opinion2.ColumnName = "RoleName"; Opinion2.DefaultValue = ""; Opinion2.DataType = System.Type.GetType("System.String"); //结束 DataColumn Opinion3 = new DataColumn(); Opinion3.ColumnName = "IsEnd"; Opinion3.DefaultValue = "1"; Opinion3.DataType = System.Type.GetType("System.String"); entity.CurrentTable.Columns.Add(Opinion); entity.CurrentTable.Columns.Add(Opinion1); entity.CurrentTable.Columns.Add(Opinion2); entity.CurrentTable.Columns.Add(Opinion3); WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.ViewState["_CaseCode"].ToString()); System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator(); string TaskCode = ""; if (this.ActCode != "" && !this.Scout) { Act act = workCase.GetAct(this.ActCode); TaskCode = act.ToTaskCode; } while (ie.MoveNext()) { Opinion Flowopinion = (Opinion)ie.Value; foreach (DataRow dr in entity.CurrentTable.Rows) { //获取当前辅助控制的状态 ModuleState moduleState = this.Toobar.GetModuleState(WorkFlowRule.GetTaskOpinionTypeByActCode(dr["ActCode"].ToString())); //加载意见标题项 Procedure procedure = DefinitionManager.GetProcedureDifinition(dr["ProcedureCode"].ToString(), true); Task task = procedure.GetTask(dr["ToTaskCode"].ToString()); string IsCopy = dr["Copy"].ToString(); //判断是否为结束 if (task.TaskType == 2) { dr["IsEnd"] = "0"; } if (task != null) { if (dr["TaskActorID"].ToString() != "") { TaskActor taskActor = task.GetTaskActor(dr["TaskActorID"].ToString()); if (taskActor.OpinionType + "" != "") { dr["RoleName"] = taskActor.OpinionType + "意见"; } else { Role role = procedure.GetRole(taskActor.ActorCode); if (role != null) { dr["RoleName"] = role.RoleName + "意见"; } } } else { if (task.OpinionType + "" != "") { dr["RoleName"] = task.OpinionType + "意见"; } else { Role role = procedure.GetRole(task.TaskRole); if (role != null) { dr["RoleName"] = role.RoleName + "意见"; } } } } if (dr["ActCode"].ToString() == Flowopinion.ApplicationCode) { //加载同意否决项 this.LoadOpinionConfirm(dr["ApplicationSubject"].ToString(), dr); //加载默认用户 this.LoadImgSign(moduleState, dr["ActUserCode"].ToString(), dr); //当前状态为End时 if (dr["Status"].ToString() == "End") { Act tmpAct = workCase.GetAct(dr["ActCode"].ToString()); // 1为抄送并且公开;2为抄送发起人;3为抄送人自己;4为当前用户拥有监控权限 以上4种情况将允许意见的出现 if (!(tmpAct.Copy == 1 && tmpAct.IsSleep == 0) || (tmpAct.ToTaskCode == TaskCode && tmpAct.FromUserCode == this.UserCode && tmpAct.Copy == 1) || tmpAct.ActUserCode == this.UserCode || this.IsScoutPopedom) { if (moduleState != ModuleState.Sightless && moduleState != ModuleState.Other) { //获取意见项 if (Flowopinion.OpinionText.Length > 0) { //dr["Opinion"] = "<a href=\"#\" OnClick=\"javascript:WorkFlowCaseStateOpenOpinionView('" + Flowopinion.OpinionCode + "');\">" + Flowopinion.OpinionText.Substring(0, 50) + "...</a>"; dr["Opinion"] = Flowopinion.OpinionText.Replace("\n", "<br>") + " "; string tmpstr = DocumentRule.Instance().GetAttachListHtml("WorkFlowActOpinion", tmpAct.ActCode); if (tmpstr != "") { //dr["Opinion"] += " <img src=\"../Images/attach.gif\" style=\"border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none\" /></a><br>" + "附件:" + tmpstr; dr["Opinion"] += "<br>" + "附件:" + tmpstr; } } } } } } } } if (Request["Debug"] + "" == "1") { string procedureCode = entity.GetString("ProcedureCode"); Procedure procedure = DefinitionManager.GetProcedureDifinition(procedureCode, true); /////////////////创建属性表/////////////////// DataTable PropertyTable = RmsPM.BLL.WorkFlowRule.GetPropertyTable(workCase, procedure); this.DataGrid1.DataSource = entity; this.DataGrid1.DataBind(); this.DataGrid2.DataSource = PropertyTable; this.DataGrid2.DataBind(); } DataView dv; if (!((User)Session["user"]).HasOperationRight("090102")) { dv = new DataView(entity.CurrentTable, String.Format(" ActUserCode='{0}' or (FromUserCode='{0}' and Copy='1') or (Copy = '1' and IsSleep='1') or Copy='0'", UserCode), "", DataViewRowState.CurrentRows); } else { dv = new DataView(entity.CurrentTable); } this.DataGrid3.DataSource = dv; this.DataGrid3.DataBind(); foreach (DataRow dr in entity.CurrentTable.Select()) { Act tmpAct = workCase.GetAct(dr["ActCode"].ToString()); if (dr["IsEnd"].ToString() == "0" || tmpAct.Copy == 1) { entity.CurrentTable.Rows.Remove(dr); } } this.DataGrid4.DataSource = entity.CurrentTable; this.DataGrid4.DataBind(); if (dv.Count == 0) { this.Visible = false; } else { this.Visible = true; if (this.ActCode != "" && !this.Scout) { //Act act = workCase.GetAct(this.ActCode); //string TaskCode = act.ToTaskCode; for (int i = 0; i < DataGrid3.Items.Count; i++) { //DataGrid3.Items[i].Cells[10].Text.Trim() == "ActCode" && if (DataGrid3.Items[i].Cells[11].Text.Trim() == TaskCode && DataGrid3.Items[i].Cells[12].Text.Trim() == this.UserCode && DataGrid3.Items[i].Cells[13].Text.Trim() == "1") { Act tmpact = workCase.GetAct(DataGrid3.Items[i].Cells[10].Text.Trim()); ((CheckBox)DataGrid3.Items[i].FindControl("chkopinionshow")).Checked = (tmpact.IsSleep == 1); ((CheckBox)DataGrid3.Items[i].FindControl("chkopinionshow")).Visible = true; } else { ((CheckBox)DataGrid3.Items[i].FindControl("chkopinionshow")).Visible = false; Act tmpact = workCase.GetAct(DataGrid3.Items[i].Cells[10].Text.Trim()); if (tmpact.IsSleep == 1 && tmpact.Copy == 1) { DataGrid3.Items[i].Cells[9].Text = " √"; } else if (tmpact.IsSleep == 0 && tmpact.Copy == 1) { DataGrid3.Items[i].Cells[9].Text = " x"; } } } } if (this.Scout) { for (int i = 0; i < DataGrid3.Items.Count; i++) { ((CheckBox)DataGrid3.Items[i].FindControl("chkopinionshow")).Visible = false; Act tmpact = workCase.GetAct(DataGrid3.Items[i].Cells[10].Text.Trim()); if (tmpact.IsSleep == 1 && tmpact.Copy == 1) { DataGrid3.Items[i].Cells[9].Text = " √"; } else if (tmpact.IsSleep == 0 && tmpact.Copy == 1) { DataGrid3.Items[i].Cells[9].Text = " x"; } } } } entity.Dispose(); }
/// **************************************************************************** /// <summary> /// 执行 sql 语句将查询结果帮定显示。 /// </summary> /// **************************************************************************** private void LoadData() { string sql = (string)this.ViewState["SqlString"]; QueryAgent qa = new QueryAgent(); EntityData entity = qa.FillEntityData("WorkFlowAct", sql); qa.Dispose(); DataColumn Opinion = new DataColumn(); Opinion.ColumnName = "Opinion"; Opinion.DefaultValue = ""; Opinion.DataType = System.Type.GetType("System.String"); entity.CurrentTable.Columns.Add(Opinion); WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(this.ViewState["_CaseCode"].ToString()); System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator(); string TaskCode = ""; if (this.ActCode != "" && !this.Scout) { Act act = workCase.GetAct(this.ActCode); TaskCode = act.ToTaskCode; } while (ie.MoveNext()) { Opinion Flowopinion = (Opinion)ie.Value; foreach (DataRow dr in entity.CurrentTable.Rows) { if (dr["ActCode"].ToString() == Flowopinion.ApplicationCode) { if (dr["Status"].ToString() == "End") { Act tmpAct = workCase.GetAct(dr["ActCode"].ToString()); if (!(tmpAct.Copy == 1 && tmpAct.IsSleep == 0) || (tmpAct.ToTaskCode == TaskCode && tmpAct.FromUserCode == this.UserCode && tmpAct.Copy == 1) || tmpAct.ActUserCode == this.UserCode || this.IsScoutPopedom) { if (Flowopinion.OpinionText.Length > 0) { ModuleState moduleState = this.Toobar.GetModuleState(WorkFlowRule.GetTaskOpinionTypeByActCode(dr["ActCode"].ToString())); if (moduleState != ModuleState.Sightless && moduleState != ModuleState.Other) { //dr["Opinion"] = "<a href=\"#\" OnClick=\"javascript:WorkFlowCaseStateOpenOpinionView('" + Flowopinion.OpinionCode + "');\">" + Flowopinion.OpinionText.Substring(0, 50) + "...</a>"; dr["Opinion"] = Flowopinion.OpinionText.Replace("\n", "<br>") + " <a href=\"#\" OnClick=\"javascript:WorkFlowCaseStateOpenOpinionView('" + Flowopinion.OpinionCode + "');return false;\">[详细]"; string tmpstr = DocumentRule.Instance().GetAttachListHtml("WorkFlowActOpinion", tmpAct.ActCode); if (tmpstr != "") { //dr["Opinion"] += " <img src=\"../Images/attach.gif\" style=\"border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none\" /></a><br>" + "附件:" + tmpstr; dr["Opinion"] += "</a><br>" + "附件:" + tmpstr; } else { dr["Opinion"] += "</a>"; } } } } } } } } if (Request["Debug"] + "" == "1") { string procedureCode = entity.GetString("ProcedureCode"); Procedure procedure = DefinitionManager.GetProcedureDifinition(procedureCode, true); /////////////////创建属性表/////////////////// DataTable PropertyTable = RmsPM.BLL.WorkFlowRule.GetPropertyTable(workCase, procedure); this.DataGrid1.DataSource = entity; this.DataGrid1.DataBind(); this.DataGrid2.DataSource = PropertyTable; this.DataGrid2.DataBind(); } DataView dv; if (!((User)Session["user"]).HasOperationRight("090102")) { dv = new DataView(entity.CurrentTable, String.Format(" ActUserCode='{0}' or (FromUserCode='{0}' and Copy='1') or (Copy = '1' and IsSleep='1') or Copy='0'", UserCode), "", DataViewRowState.CurrentRows); } else { dv = new DataView(entity.CurrentTable); } this.dgList.DataSource = dv; this.dgList.DataBind(); if (dv.Count == 0) { this.Visible = false; } else { this.Visible = true; if (this.ActCode != "" && !this.Scout) { //Act act = workCase.GetAct(this.ActCode); //string TaskCode = act.ToTaskCode; for (int i = 0; i < dgList.Items.Count; i++) { //dgList.Items[i].Cells[10].Text.Trim() == "ActCode" && if (dgList.Items[i].Cells[8].Text.Trim() == TaskCode && dgList.Items[i].Cells[9].Text.Trim() == this.UserCode && dgList.Items[i].Cells[10].Text.Trim() == "1") { Act tmpact = workCase.GetAct(dgList.Items[i].Cells[7].Text.Trim()); ((CheckBox)dgList.Items[i].FindControl("chkopinionshow")).Checked = (tmpact.IsSleep == 1); ((CheckBox)dgList.Items[i].FindControl("chkopinionshow")).Visible = true; } else { ((CheckBox)dgList.Items[i].FindControl("chkopinionshow")).Visible = false; Act tmpact = workCase.GetAct(dgList.Items[i].Cells[7].Text.Trim()); if (tmpact.IsSleep == 1 && tmpact.Copy == 1) { dgList.Items[i].Cells[6].Text = " 公开"; } else if (tmpact.IsSleep == 0 && tmpact.Copy == 1) { dgList.Items[i].Cells[6].Text = " 未公开"; } } } } if (this.Scout) { for (int i = 0; i < dgList.Items.Count; i++) { ((CheckBox)dgList.Items[i].FindControl("chkopinionshow")).Visible = false; Act tmpact = workCase.GetAct(dgList.Items[i].Cells[7].Text.Trim()); if (tmpact.IsSleep == 1 && tmpact.Copy == 1) { dgList.Items[i].Cells[6].Text = " 公开"; } else if (tmpact.IsSleep == 0 && tmpact.Copy == 1) { dgList.Items[i].Cells[6].Text = " 未公开"; } } } } entity.Dispose(); }
private void LoadData() { string code = Request["ApplicationCode"] + ""; string caseCode = Request["CaseCode"] + ""; string procedureCode = Request["ProcedureCode"] + ""; string procedureName = Request["ProcedureName"] + ""; string userCode = Request["UserCode"] + ""; string unitCode = Request["UnitCodeCode"] + ""; WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode); Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true); if (procedure == null) { LogHelper.WriteLog("取不到对应流程"); throw new Exception("流程配置有误,取不到对应流程"); } Act currentAct = workCase.GetAct(Request["ActCode"] + ""); if (currentAct == null) { LogHelper.WriteLog("取不到当前流程节点"); throw new Exception("非法操作,取不到当前流程节点"); } /*if(Request["ActCode"]+"" != "") * { * Act act = workCase.GetAct(Request["ActCode"]+""); * if(act.Copy == 0) * this.ChkShow.Checked = (act.IsSleep == 1); * else * this.ChkShow.Visible = false; * }*/ System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator(); while (ie.MoveNext()) { Opinion Flowopinion = (Opinion)ie.Value; if (Flowopinion.ApplicationCode == Request["ActCode"] + "") { this.FlowOpinion.Value = Flowopinion.OpinionText; switch (this.up_sPMName.ToLower()) { case "shimaopm": if (Flowopinion.OpinionText.Trim() == "") { Task firstTask = DefinitionManager.GetFirstTask(procedure); if (firstTask == null) { LogHelper.WriteLog("流程取不到开始节点"); throw new Exception("流程配置有误,请检查开始节点的属性"); } if (currentAct.ToTaskCode == firstTask.TaskCode) { this.FlowOpinion.Value = ""; } else { this.FlowOpinion.Value = "同意"; } } break; } } } }