protected void btn_pass_Click(object sender, EventArgs e) { int TaskID, JobCCID; foreach (GridViewRow row in gv_List.Rows) { CheckBox cb_check = (CheckBox)row.FindControl("cb_Check"); if (cb_check.Checked) { TaskID = int.Parse(gv_List.DataKeys[row.RowIndex]["TaskID"].ToString()); JobCCID = int.Parse(gv_List.DataKeys[row.RowIndex]["ID"].ToString()); EWF_TaskBLL taskbll = new EWF_TaskBLL(TaskID); EWF_Task_JobCCBLL JobCCBLL = new EWF_Task_JobCCBLL(JobCCID); if (taskbll.Model.EndTime == new DateTime(1900, 1, 1) && JobCCBLL.Model.ReadFlag != "Y") { string comment = "已阅"; comment += "<br/>------" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "-------<br/>"; JobCCBLL.SaveComment(comment); #region 更新任务备注信息 string remark = "抄送批注时间:<b><font color=red>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</font></b> "; remark += "抄送批注人:<b><font color=red>" + Session["UserRealName"].ToString() + "</font></b> "; remark += " 批注意见:<b><font color=red>已阅</font></b> "; remark += "<br/>"; taskbll.AppendRemark(remark); #endregion } if (JobCCBLL.Model.ReadFlag != "Y") { JobCCBLL.SetReadFlag("Y"); } } } MessageBox.Show(this, "批量审阅成功!"); BindGrid(); }
//绑定基本信息 private void BindTaskData() { #region 绑定当前工作项 EWF_Task_JobCCBLL JobCCBLL = new EWF_Task_JobCCBLL((int)ViewState["JobCCID"]); if (JobCCBLL.Model == null || JobCCBLL.Model.RecipientStaff != (int)Session["UserID"]) { Response.Redirect("~/SubModule/DeskTop.aspx"); return; } if (JobCCBLL.Model.ReadFlag != "Y") { JobCCBLL.SetReadFlag("Y"); } //绑定当前抄送相关信息 lb_MessageSubject.Text = JobCCBLL.Model.MessageSubject; lb_Comment.Text = JobCCBLL.Model.Comment; EWF_Task_JobBLL JobBLL = new EWF_Task_JobBLL(JobCCBLL.Model.Job); lbl_CurrentJobName.Text = new EWF_Flow_ProcessBLL(JobBLL.Model.CurrentProcess).Model.Name; #endregion #region 绑定流程信息 EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]); ViewState["Initiator"] = task.Model.Initiator; //绑定流程信息 lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName; lbl_AppName.Text = new EWF_Flow_AppBLL(task.Model.App).Model.Name; lbl_Title.Text = task.Model.Title; hyl_RelateURL.NavigateUrl = task.Model.RelateURL; lb_Status.Text = DictionaryBLL.GetDicCollections("EWF_Task_TaskStatus")[task.Model.Status.ToString()].Name; lb_StartTime.Text = task.Model.StartTime.ToString(); if (task.Model.EndTime != new DateTime(1900, 1, 1)) { lb_EndTime.Text = task.Model.EndTime.ToString(); cbx_NotifyInitiator.Visible = false; bt_SaveComment.Visible = false; tbx_Comment.Visible = false; } else { lb_EndTime.Text = "未结束"; } lt_Remark.Text = task.Model.Remark; //显示申请详细信息IFrame if (!string.IsNullOrEmpty(task.Model.RelateURL)) { tr_RelateUrl.Visible = true; string url = this.ResolveClientUrl(task.Model.RelateURL); if (url.IndexOf('?') >= 0) { url += "&ViewFramework=false&Decision=Y"; } else { url += "?ViewFramework=false&Decision=Y"; } frame_relateurl.Attributes.Add("src", url); } else { tr_RelateUrl.Visible = false; } //Bind the dataobject info NameValueCollection dataobjects = task.GetDataObjectValue(); pl_dataobjectinfo.BindData(dataobjects); pl_dataobjectinfo.SetPanelEnable(false); TextBox tbx_ReMark = pl_dataobjectinfo.FindControl("C_Remark") != null ? (TextBox)pl_dataobjectinfo.FindControl("C_Remark") : null; if (tbx_ReMark != null) { tbx_ReMark.Enabled = true; tbx_ReMark.ReadOnly = true; } //绑定审批历史 this.gv_List_DecisionHistory.DataSource = task.GetDecisionHistory(); this.gv_List_DecisionHistory.DataBind(); //绑定附件 gv_List_Attachment.BindGrid <EWF_Task_Attachment>(task.GetAttachmentsList()); #endregion }
//绑定基本信息 private void BindTaskData() { #region 绑定当前工作项 EWF_Task_JobCCBLL JobCCBLL = new EWF_Task_JobCCBLL((int)ViewState["JobCCID"]); if (JobCCBLL.Model == null || JobCCBLL.Model.RecipientStaff != (int)Session["UserID"]) { Response.Redirect("~/SubModule/DeskTop.aspx"); return; } if (JobCCBLL.Model.ReadFlag != "Y") { JobCCBLL.SetReadFlag("Y"); } //绑定当前抄送相关信息 lb_MessageSubject.Text = JobCCBLL.Model.MessageSubject; lb_Comment.Text = JobCCBLL.Model.Comment; EWF_Task_JobBLL JobBLL = new EWF_Task_JobBLL(JobCCBLL.Model.Job); lbl_CurrentJobName.Text = new EWF_Flow_ProcessBLL(JobBLL.Model.CurrentProcess).Model.Name; #endregion #region 绑定流程信息 EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]); ViewState["Initiator"] = task.Model.Initiator; //绑定流程信息 lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName; lbl_AppName.Text = new EWF_Flow_AppBLL(task.Model.App).Model.Name; lbl_Title.Text = task.Model.Title; hyl_RelateURL.NavigateUrl = task.Model.RelateURL; lb_Status.Text = DictionaryBLL.GetDicCollections("EWF_Task_TaskStatus")[task.Model.Status.ToString()].Name; lb_StartTime.Text = task.Model.StartTime.ToString(); if (task.Model.EndTime != new DateTime(1900, 1, 1)) { lb_EndTime.Text = task.Model.EndTime.ToString(); cbx_NotifyInitiator.Visible = false; bt_SaveComment.Visible = false; tbx_Comment.Visible = false; } else lb_EndTime.Text = "未结束"; lt_Remark.Text = task.Model.Remark; //显示申请详细信息IFrame if (!string.IsNullOrEmpty(task.Model.RelateURL)) { tr_RelateUrl.Visible = true; string url = this.ResolveClientUrl(task.Model.RelateURL); if (url.IndexOf('?') >= 0) url += "&ViewFramework=false&Decision=Y"; else url += "?ViewFramework=false&Decision=Y"; frame_relateurl.Attributes.Add("src", url); } else { tr_RelateUrl.Visible = false; } //Bind the dataobject info NameValueCollection dataobjects = task.GetDataObjectValue(); pl_dataobjectinfo.BindData(dataobjects); pl_dataobjectinfo.SetPanelEnable(false); TextBox tbx_ReMark = pl_dataobjectinfo.FindControl("C_Remark") != null ? (TextBox)pl_dataobjectinfo.FindControl("C_Remark") : null; if (tbx_ReMark != null) { tbx_ReMark.Enabled = true; tbx_ReMark.ReadOnly = true; } //绑定审批历史 this.gv_List_DecisionHistory.DataSource = task.GetDecisionHistory(); this.gv_List_DecisionHistory.DataBind(); //绑定附件 gv_List_Attachment.BindGrid<EWF_Task_Attachment>(task.GetAttachmentsList()); #endregion }