Exemplo n.º 1
0
    private void BindEWFCC()
    {
        DataTable dt = EWF_Task_JobCCBLL.GetListByRecipientStaff((int)Session["UserID"], DateTime.Now.AddDays(-7), DateTime.Now);

        dt.DefaultView.RowFilter = "ReadFlag='N' OR (ReadTime>'" + DateTime.Today + "')";
        gv_EWFCCList.DataSource  = dt.DefaultView;
        gv_EWFCCList.DataBind();
    }
Exemplo n.º 2
0
    private void BindGrid()
    {
        DateTime dtBegin = DateTime.Parse(tbx_begin.Text);
        DateTime dtEnd   = DateTime.Parse(tbx_end.Text).AddDays(1);

        DataTable dt = EWF_Task_JobCCBLL.GetListByRecipientStaff((int)Session["UserID"], dtBegin, dtEnd);

        string condition = " 1 = 1 ";

        if (ddl_App.SelectedValue != "0")
        {
            condition += " AND App = '" + ddl_App.SelectedValue + "'";
        }
        if (tbx_MessageSubject.Text != "")
        {
            condition += " AND (Title LIKE '%" + tbx_MessageSubject.Text + "%' OR MessageSubject LIKE '%" + tbx_MessageSubject.Text + "%')";
        }

        #region 判断当前可查询的范围
        string orgcitys = "";
        if (tr_OrganizeCity.SelectValue != "1" && tr_OrganizeCity.SelectValue != "0")
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue), true);
            orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "")
            {
                orgcitys += ",";
            }
            orgcitys += tr_OrganizeCity.SelectValue;

            condition += " AND OrganizeCity IN (" + orgcitys + ")";
        }
        #endregion

        if (tbx_InitiatorStaffName.Text != "")
        {
            condition += " AND ApplyStaffName LIKE '%" + tbx_InitiatorStaffName.Text + "%'";
        }

        if (ddl_ReadFlag.SelectedValue != "0")
        {
            condition += "AND ReadFlag='" + ddl_ReadFlag.SelectedValue + "'";
        }

        dt.DefaultView.RowFilter = condition;
        dt.DefaultView.Sort      = " TaskID desc ";
        gv_List.DataSource       = dt.DefaultView;
        gv_List.TotalRecordCount = dt.DefaultView.Count;
        gv_List.PageIndex        = (int)ViewState["PageIndex"];
        gv_List.DataBind();
    }
    //暂存意见
    protected void bt_SaveComment_Click(object sender, EventArgs e)
    {
        if (tbx_Comment.Text == "")
        {
            MessageBox.Show(this, "批复意见必填");
            return;
        }

        string comment = tbx_Comment.Text.Trim();

        comment += "<br/>------" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "-------<br/>";

        EWF_Task_JobCCBLL JobCCBLL = new EWF_Task_JobCCBLL((int)ViewState["JobCCID"]);

        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>" + tbx_Comment.Text + "</font></b> ";
        remark += "<br/>";

        EWF_TaskBLL taskbll = new EWF_TaskBLL((int)ViewState["TaskID"]);
        taskbll.AppendRemark(remark);

        if (cbx_NotifyInitiator.Checked)
        {
            string _content = "<b><font color=red>工作流处理通知!您发起的工作流有了批注信息!</font></b><br/>";
            _content += "工作流:<font color=red>" + lbl_AppName.Text + "</font><br/>";
            _content += "主题:<font color=red>" + lbl_Title.Text + "</font><br/><br/>";
            _content += remark;

            _content += "<br/><a href='" + this.ResolveUrl("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + ViewState["TaskID"].ToString()) + "' target='_blank'><font color=blue>点击查看工作流详细情况</font></a><br/>";

            DataTable _users = new Org_StaffBLL(taskbll.Model.Initiator).GetUserList();
            foreach (DataRow dr_user in _users.Rows)
            {
                SendSM(dr_user["UserName"].ToString(), _content);
            }
        }
        #endregion

        MessageBox.ShowAndRedirect(this, "保存成功!", "TaskList_CC.aspx");
    }
    //暂存意见
    protected void bt_SaveComment_Click(object sender, EventArgs e)
    {
        if (tbx_Comment.Text == "")
        {
            MessageBox.Show(this, "批复意见必填");
            return;
        }

        string comment = tbx_Comment.Text.Trim();
        comment += "<br/>------" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "-------<br/>";

        EWF_Task_JobCCBLL JobCCBLL = new EWF_Task_JobCCBLL((int)ViewState["JobCCID"]);
        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>" + tbx_Comment.Text + "</font></b> ";
        remark += "<br/>";

        EWF_TaskBLL taskbll = new EWF_TaskBLL((int)ViewState["TaskID"]);
        taskbll.AppendRemark(remark);

        if (cbx_NotifyInitiator.Checked)
        {
            string _content = "<b><font color=red>工作流处理通知!您发起的工作流有了批注信息!</font></b><br/>";
            _content += "工作流:<font color=red>" + lbl_AppName.Text + "</font><br/>";
            _content += "主题:<font color=red>" + lbl_Title.Text + "</font><br/><br/>";
            _content += remark;

            _content += "<br/><a href='" + this.ResolveUrl("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + ViewState["TaskID"].ToString()) + "' target='_blank'><font color=blue>点击查看工作流详细情况</font></a><br/>";

            DataTable _users = new Org_StaffBLL(taskbll.Model.Initiator).GetUserList();
            foreach (DataRow dr_user in _users.Rows)
            {
                SendSM(dr_user["UserName"].ToString(), _content);
            }
        }
        #endregion

        MessageBox.ShowAndRedirect(this, "保存成功!", "TaskList_CC.aspx");
    }
Exemplo n.º 5
0
    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();
    }
    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
    }
Exemplo n.º 8
0
 private void BindCCProcessInfo(int JobID)
 {
     gv_JobCC.BindGrid <EWF_Task_JobCC>(EWF_Task_JobCCBLL.GetModelList("Job=" + JobID.ToString()));
 }
    //绑定基本信息
    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
    }