protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            EWF_Task_Job Job = new EWF_Task_JobBLL((int)gv_List.DataKeys[e.Row.RowIndex]["CurrentJobID"]).Model;
            if (Job == null) return;

            EWF_Flow_Process p = new EWF_Flow_ProcessBLL(Job.CurrentProcess).Model;
            if (p == null) return;

            if (p.Type == 3)
            {
                EWF_Flow_ProcessDecision Process = new EWF_Flow_ProcessDecisionBLL(Job.CurrentProcess).Model;
                if (Process == null) return;

                if (Process.CanBatchApprove == "N")
                {
                    CheckBox cb_Check = (CheckBox)e.Row.FindControl("cb_Check");

                    if (cb_Check != null)
                    {
                        cb_Check.Checked = false;
                        cb_Check.Visible = false;
                    }
                }
            }

        }
    }
Exemplo n.º 2
0
    //绑定执行数据库环节详细信息
    private void BindDataBaseProcessInfo(int JobID)
    {
        EWF_Task_JobBLL             job     = new EWF_Task_JobBLL(JobID);
        EWF_Flow_ProcessDataBaseBLL process = new EWF_Flow_ProcessDataBaseBLL(job.Model.CurrentProcess);

        this.lbl_DSN.Text           = process.Model.DSN;
        this.lbl_StoreProcName.Text = process.Model.StoreProcName;
        this.gv_List_ParamList.BindGrid <EWF_Flow_DataBaseParam>(process.GetParamsList());
    }
Exemplo n.º 3
0
    private void GetEWFCount()
    {
        DataTable dt = EWF_Task_JobBLL.GetMyJobCount((int)Session["UserID"]);

        if (dt != null && dt.Rows.Count > 0)
        {
            ViewState["JobDecisionCount"]        = dt.Rows[0]["JobDecisionCount"];
            ViewState["JobDecisionCount_Agency"] = dt.Rows[0]["JobDecisionCount_Agency"];
            ViewState["JobInviteConsultCount"]   = dt.Rows[0]["JobInviteConsultCount"];
            ViewState["JobCCCount"] = dt.Rows[0]["JobCCCount"];
            ViewState["MyInitTask"] = dt.Rows[0]["MyInitTask"];
        }
    }
    private void BindGrid()
    {
        DataTable dt = EWF_Task_JobBLL.GetJobToDecision(int.Parse(Session["UserID"].ToString()));

        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 + "%'";
        }
        string CantApproveAlone_EWF = ConfigHelper.GetConfigString("CantApproveAlone_EWF");
        if (!string.IsNullOrEmpty(CantApproveAlone_EWF))
        {
            condition += " AND AppCode NOT IN (" + CantApproveAlone_EWF + ")";
        }
        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();
        cb_SelectAll.Checked = false;
    }
Exemplo n.º 5
0
    //绑定条件判断环节详细信息
    private void BindConditionProcessInfo(int JobID)
    {
        EWF_Task_JobBLL job  = new EWF_Task_JobBLL(JobID);
        EWF_TaskBLL     task = new EWF_TaskBLL(job.Model.Task);
        EWF_Flow_ProcessConditionBLL process    = new EWF_Flow_ProcessConditionBLL(job.Model.CurrentProcess);
        EWF_Flow_DataObjectBLL       dataobject = new EWF_Flow_DataObjectBLL(process.Model.DataObject);

        this.lbl_DataObjectName.Text        = dataobject.Model.Name;
        this.lbl_DataObjectDisPlayName.Text = dataobject.Model.DisplayName;

        this.lbl_DataObjectValue.Text  = task.GetDataObjectValue()[dataobject.Model.Name];;
        this.lbl_OperatorTypeName.Text = DictionaryBLL.GetDicCollections("EWF_Flow_OperatorType")[process.Model.OperatorType.ToString()].Name;

        this.lbl_Value1.Text = process.Model.Value1;
        this.lbl_Value2.Text = process.Model.Value2;
    }
Exemplo n.º 6
0
    //选择某个Job,查看详细信息
    protected void gv_List_JobList_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        int                 JobID   = (int)this.gv_List_JobList.DataKeys[e.NewSelectedIndex]["ID"];
        EWF_Task_JobBLL     job     = new EWF_Task_JobBLL(JobID);
        EWF_Flow_ProcessBLL process = new EWF_Flow_ProcessBLL(job.Model.CurrentProcess);

        this.tr_RecipientProcess.Visible = false;
        this.tr_ConditionProcess.Visible = false;
        this.tr_DataBaseProcess.Visible  = false;
        this.tr_SendMailProcess.Visible  = false;
        this.tr_CCProcess.Visible        = false;

        switch (process.Model.Type)
        {
        case 1:    //开始环节
            break;

        case 2:    //结束环节
            break;

        case 3:    //人员审批环节
        case 10:   //人员会审环节
            this.tr_RecipientProcess.Visible = true;
            BindRecipientProcessInfo(JobID);
            break;

        case 4:    //条件判断环节
            this.tr_ConditionProcess.Visible = true;
            BindConditionProcessInfo(JobID);
            break;

        case 5:    //执行数据库环节
            this.tr_DataBaseProcess.Visible = true;
            BindDataBaseProcessInfo(JobID);
            break;

        case 6:    //发送邮件环节
            this.tr_SendMailProcess.Visible = true;
            BindSendMailProcessInfo(JobID);
            break;

        case 9:     //抄送环节
            tr_CCProcess.Visible = true;
            BindCCProcessInfo(JobID);
            break;
        }
    }
Exemplo n.º 7
0
    private void BindDession()
    {
        GetEWFCount();

        DataTable dt        = EWF_Task_JobBLL.GetJobToDecision(int.Parse(Session["UserID"].ToString()));
        string    condition = ConfigHelper.GetConfigString("Desktop_EWF_GetDessionCondition");

        if (!string.IsNullOrEmpty(condition))
        {
            dt.DefaultView.RowFilter = condition;
        }

        gv_Decission.DataSource = dt.DefaultView;
        gv_Decission.DataBind();

        hy_ApproveFeeApplySummary.Visible = dt.Select("AppCode Like 'FNA_FeeApplyFlow%'").Length > 0;
    }
    protected void DoApprove(bool ApproveFlag)
    {
        #region 仅查看待我审批的工资申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);



        foreach (string taskid in TaskIDs)
        {
            int             jobid = EWF_TaskBLL.StaffCanApproveTask(int.Parse(taskid), (int)Session["UserID"]);
            EWF_Task_JobBLL job   = new EWF_Task_JobBLL(jobid);
            if (job.Model != null)
            {
                int decision = job.StaffCanDecide((int)Session["UserID"]);
                if (decision > 0)
                {
                    if (ApproveFlag)
                    {
                        job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                    }
                    else
                    {
                        job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                    }
                }
            }
        }

        BindGrid();
        MessageBox.Show(this, ApproveFlag ? "审批成功!" : "已成功将选择区域的申请单,设为批复未通过!");
        return;
    }
Exemplo n.º 9
0
 private int DoApproveTask(int TaskID, int DessionResult, string DessionComment)
 {
     if (TaskID > 0)
     {
         int jobid = EWF_TaskBLL.StaffCanApproveTask(TaskID, (int)Session["UserID"]);
         if (jobid > 0)
         {
             EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
             if (job != null)
             {
                 int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                 if (decisionid > 0)
                 {
                     return(job.Decision(decisionid, (int)Session["UserID"], DessionResult, DessionComment));
                 }
             }
         }
     }
     return(-1);
 }
Exemplo n.º 10
0
    private void Approve(int state)
    {
        int userid = (int)Session["UserID"];

        foreach (GridViewRow row in gv_List.Rows)
        {
            Object cbx = row.FindControl("chk_ID");
            if (cbx != null && ((CheckBox)cbx).Checked)
            {
                Object tbx    = row.FindControl("tbx_Remark");
                string Remark = "";
                if (tbx != null && !string.IsNullOrEmpty(((TextBox)tbx).Text))
                {
                    Remark = ((TextBox)tbx).Text;
                }
                else
                {
                    Remark = state == 2 ? "汇总单批量审批通过!" : "汇总单批量审批不通过!";
                }
                int            contractid = (int)gv_List.DataKeys[row.RowIndex]["ID"];
                CM_ContractBLL con        = new CM_ContractBLL(contractid);
                int            taskid     = con.Model.ApproveTask;
                if (taskid > 0)
                {
                    int jobid = EWF_TaskBLL.StaffCanApproveTask(taskid, userid);
                    if (jobid > 0)
                    {
                        EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                        if (job != null)
                        {
                            int decisionid = job.StaffCanDecide(userid);
                            if (decisionid > 0)
                            {
                                job.Decision(decisionid, userid, state, Remark);
                            }
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 11
0
    protected int DoApprove(bool ApproveFlag)
    {
        int counts = 0;

        foreach (GridViewRow row in gv_DetailList.Rows)
        {
            if (row.RowType == DataControlRowType.DataRow)
            {
                CheckBox cbx = row.FindControl("cb_Selected") as CheckBox;
                if (cbx.Checked)
                {
                    int taskid = (int)gv_DetailList.DataKeys[row.RowIndex]["FNA_FeeApply_ApproveTask"];
                    int jobid  = EWF_TaskBLL.StaffCanApproveTask(taskid, (int)Session["UserID"]);
                    if (jobid > 0)
                    {
                        EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                        if (job != null)
                        {
                            int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                            if (decisionid > 0)
                            {
                                if (ApproveFlag)
                                {
                                    job.Decision(decisionid, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                                }
                                else
                                {
                                    job.Decision(decisionid, (int)Session["UserID"], 3, "汇总单批量审批不通过!");       //3:审批不通过
                                }
                                counts++;
                            }
                        }
                    }
                }
            }
        }
        return(counts);
    }
    protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            EWF_Task_Job Job = new EWF_Task_JobBLL((int)gv_List.DataKeys[e.Row.RowIndex]["CurrentJobID"]).Model;
            if (Job == null)
            {
                return;
            }

            EWF_Flow_Process p = new EWF_Flow_ProcessBLL(Job.CurrentProcess).Model;
            if (p == null)
            {
                return;
            }

            if (p.Type == 3)
            {
                EWF_Flow_ProcessDecision Process = new EWF_Flow_ProcessDecisionBLL(Job.CurrentProcess).Model;
                if (Process == null)
                {
                    return;
                }

                if (Process.CanBatchApprove == "N")
                {
                    CheckBox cb_Check = (CheckBox)e.Row.FindControl("cb_Check");

                    if (cb_Check != null)
                    {
                        cb_Check.Checked = false;
                        cb_Check.Visible = false;
                    }
                }
            }
        }
    }
    private string GetNeedMeApproveTaskIDs()
    {
        string taskids = "";

        DataTable dt = EWF_Task_JobBLL.GetJobToDecision(int.Parse(Session["UserID"].ToString()));

        dt.DefaultView.RowFilter = "AppCode='FNA_FeeWriteoffFlow'";
        if (dt.DefaultView.Count == 0)
        {
            return("");
        }

        for (int i = 0; i < dt.DefaultView.Count; i++)
        {
            taskids += dt.DefaultView[i]["TaskID"].ToString() + ",";
        }

        if (taskids.EndsWith(","))
        {
            taskids = taskids.Substring(0, taskids.Length - 1);
        }

        return(taskids);
    }
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        int ApproveCount=0, UnApproveCount=0,errcount=0;
        if (txt_UnApproveContractID.Text.Trim() != "")
        {
            string[] UnApproveID = Regex.Split(txt_UnApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);

            if (txt_ApproveContractID.Text.Trim() != "")
            {
                string[] ApproveID = Regex.Split(txt_ApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);
                foreach (string contractid in UnApproveID)
                {
                    if (ApproveID.Contains(contractid))
                    {
                        MessageBox.Show(this, "ID为【" + contractid + "】的返利协议同时出现在了【审批通过】与【审批不通过】编辑框中!");
                        return;
                    }
                }
            }
        }
        if (txt_ApproveContractID.Text.Trim() != "")
        {
            string[] ApproveID = Regex.Split(txt_ApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);
            CM_ContractBLL _bll;
            StringBuilder approvebuild = new StringBuilder("");

            for (int i = 0; i < ApproveID.Length; i++)
            {
                int ContractID;
                if (!ApproveID[i].Trim().Equals("") && int.TryParse(ApproveID[i].Trim(), out ContractID))
                {
                    _bll = new CM_ContractBLL(ContractID);
                    if (_bll.Model != null)
                    {
                        int jobid = EWF_TaskBLL.StaffCanApproveTask(_bll.Model.ApproveTask, 7394);
                        if (jobid > 0)
                        {
                            EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                            if (job != null)
                            {
                                int decisionid = job.StaffCanDecide(7394);
                                if (decisionid > 0)
                                {
                                    ApproveCount++;
                                    job.Decision(decisionid, (int)Session["UserID"], 2, "批量审批通过!");       //2:审批已通过
                                    approvebuild.Append("ID为【" + ContractID.ToString() + "】的返利协议审批通过  ");

                                }
                            }
                        }
                        else
                        {
                            approvebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未到客服确认环节   </span>");
                            errcount++;
                        }

                    }
                    else
                    {
                        approvebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未能在系统中找到  </span> ");
                        errcount++;
                    }

                }
                else if (!ApproveID[i].Trim().Equals("") && !int.TryParse(ApproveID[i].Trim(), out ContractID))
                {
                    approvebuild.Append("<span style='color: Red'>【" + ContractID.ToString() + "】不是一个有效的返利协议ID  </span> ");
                    errcount++;
                }
                if (i % 5 == 0&&i!=0) approvebuild.Append("<br/>");
            }
            lb_ApproveErrorInfo.Text = approvebuild.ToString();
        }
        if (txt_UnApproveContractID.Text.Trim() != "")
        {
            string[] UnApproveID = Regex.Split(txt_UnApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);
            CM_ContractBLL _bll;
            StringBuilder unapprovebuild = new StringBuilder("");
            for (int i = 0; i < UnApproveID.Length; i++)
            {
                int ContractID;
                if (!UnApproveID[i].Trim().Equals("") && int.TryParse(UnApproveID[i].Trim(), out ContractID))
                {
                    _bll = new CM_ContractBLL(ContractID);
                    if (_bll.Model != null)
                    {
                        int jobid = EWF_TaskBLL.StaffCanApproveTask(_bll.Model.ApproveTask, 7394);
                        if (jobid > 0)
                        {
                            EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                            if (job != null)
                            {
                                int decisionid = job.StaffCanDecide(7394);
                                if (decisionid > 0)
                                {
                                    UnApproveCount++;
                                    job.Decision(decisionid, (int)Session["UserID"], 3, "批量审批不通过!");       //3:审批不通过
                                    unapprovebuild.Append("ID为【" + ContractID.ToString() + "】的返利协议审批未通过  ");
                                }
                            }
                        }
                        else
                        {
                            unapprovebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未到客服确认环节  </span>");
                            errcount++;
                        }
                    }
                    else
                    {
                        errcount++;
                        unapprovebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未能在系统中找到  </span>");
                    }

                }
                else if (!UnApproveID[i].Trim().Equals("") && !int.TryParse(UnApproveID[i].Trim(), out ContractID))
                {
                    unapprovebuild.Append("<span style='color: Red'>【" + ContractID.ToString() + "】不是一个有效的返利协议ID  </span>");
                    errcount++;
                }
                if (i % 5 == 0 && i != 0) unapprovebuild.Append("<br/>");

            }
            lb_UnApproveErrorInfo.Text = unapprovebuild.ToString();
        }

        MessageBox.Show(this, "审批通过协议个数:" + ApproveCount.ToString() +   @"\n审批未通过协议个数:" + UnApproveCount.ToString() +
            @"\n未能导入协议个数:" + errcount.ToString()  );
        return;
    }
Exemplo n.º 15
0
    //绑定邮件发送环节详细信息
    private void BindSendMailProcessInfo(int JobID)
    {
        EWF_Task_JobBLL job = new EWF_Task_JobBLL(JobID);
        EWF_Flow_ProcessEmailBLL process = new EWF_Flow_ProcessEmailBLL(job.Model.CurrentProcess);

        this.lbl_ReciverRoleName.Text = new EWF_RoleBLL(process.Model.RecipientRole).Model.Name;
        this.lbl_MailSubject.Text = process.Model.Subject;
        this.lbl_MailContent.Text = process.Model.Content;
    }
    //绑定基本信息
    private void BindTaskData()
    {
        #region 绑定当前工作项
        EWF_Task_InviteConsultBLL InviteConsultBLL = new EWF_Task_InviteConsultBLL((int)ViewState["InviteConsult"]);
        if (InviteConsultBLL.Model == null || InviteConsultBLL.Model.RecipientStaff != (int)Session["UserID"])
        {
            Response.Redirect("~/SubModule/DeskTop.aspx");
            return;
        }

        if (InviteConsultBLL.Model.ReadFlag != "Y")
        {
            InviteConsultBLL.SetReadFlag("Y");
        }

        EWF_Task_JobBLL JobBLL = new EWF_Task_JobBLL(InviteConsultBLL.Model.Job);
        if (JobBLL.Model.Status != 3)
        {
            MessageBox.Show(this, "该流程已不在等待邀请协助审批状态!");
            bt_SaveDecisionComment.Visible = false;
            tbx_DecisionComment.Visible = false;
        }
        //绑定当前邀审相关信息
        lbl_CurrentJobName.Text = new EWF_Flow_ProcessBLL(JobBLL.Model.CurrentProcess).Model.Name;
        lbl_InvitedStaff.Text = new Org_StaffBLL(InviteConsultBLL.Model.InvitedStaff).Model.RealName;
        lbl_InvitedTime.Text = InviteConsultBLL.Model.InvitedTime.ToString("yyyy-MM-dd HH:mm");
        lb_DecisionComment.Text = InviteConsultBLL.Model.ConsultComment;
        #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();
        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.º 17
0
    //绑定开始环节详细信息
    private void BindTaskInfo()
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        #region 如果任务在待审批状态,且正好是待当前人审批,则直接切换到审批页面
        if (task.Model.Status == 3)
        {
            int job = EWF_TaskBLL.StaffCanApproveTask(task.Model.ID, (int)Session["UserID"]);
            if (job > 0)
            {
                Response.Redirect("Recipient.aspx?CurrentJobID=" + job.ToString() + "&TaskID=" + task.Model.ID.ToString());
            }
        }
        #endregion

        EWF_Flow_App app = new EWF_Flow_AppBLL(task.Model.App).Model;

        #region 绑定流程信息
        lbl_ID.Text      = task.Model.ID.ToString();
        lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName;
        lbl_AppName.Text = app.Name;

        lbl_Applyer_Position.Text = new Org_PositionBLL(new Org_StaffBLL(task.Model.Initiator).Model.Position).Model.Name;

        lbl_Title.Text = task.Model.Title;
        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();
        }
        else
        {
            lb_EndTime.Text = "未结束";
        }

        lt_Remark.Text = task.Model.Remark;

        #region 绑定流程当前环节信息
        if (task.Model.Status < 5)
        {
            IList <EWF_Task_Job> jobs = EWF_Task_JobBLL.GetModelList("Task=" + task.Model.ID.ToString() + " ORDER BY StartTime DESC");
            if (jobs.Count > 0)
            {
                EWF_Flow_Process process = new EWF_Flow_ProcessBLL(jobs[0].CurrentProcess).Model;
                if (process != null)
                {
                    lb_CurrentJobInfo.Text = process.Name;
                    if (process.Type == 3)
                    {
                        lb_CurrentJobInfo.Text += " 等待审批人:";
                        foreach (EWF_Task_JobDecision decision in EWF_Task_JobDecisionBLL.GetModelList("Job=" + jobs[0].ID.ToString()))
                        {
                            MCSFramework.Model.Org_Staff staff = new Org_StaffBLL(decision.RecipientStaff).Model;
                            if (staff != null)
                            {
                                lb_CurrentJobInfo.Text += staff.RealName + "   ";
                            }
                        }
                    }
                }
            }
        }
        else
        {
            tr_CurrentProcessInfo.Visible = false;
        }
        #endregion

        #endregion

        #region 控制流程状态
        if (task.Model.Initiator == (int)Session["UserID"])
        {
            //只有流程发起的本人,才可控制流程状态

            if (task.Model.Status == 6)
            {
                MessageBox.Show(this, "您的流程因故停止流转,请尽快联系系统管理员排查原因,或点击“继续执行”按钮以重新启动流程的流转!");
                bt_Restart.Visible = true;
            }

            if (task.Model.Status == 4)
            {
                MessageBox.Show(this, "您的流程被最后一审批人设为了待处理状态,请补充相关信息附件后,或点击“继续执行”按钮以重新启动流程的流转!");
                bt_Restart.Visible = true;
            }

            if (task.Model.Status == 1)
            {
                MessageBox.Show(this, "您的流程还没正式发起申请,请尽快点击“确定发起”按钮以发起流程!");
                btn_Start.Visible = true;
            }

            if (task.Model.Status != 5)
            {
                //未完成
                if (app.RelateBusiness == "N")
                {
                    bt_Cancel.Visible = true;
                }
                tr_UploadAtt.Visible = true;
            }
        }
        #endregion

        #region 显示申请详细信息IFrame
        //显示申请详细信息IFrame
        if (!string.IsNullOrEmpty(task.Model.RelateURL))
        {
            hyl_RelateURL.NavigateUrl = task.Model.RelateURL;
            tr_RelateUrl.Visible      = true;
            string url = this.ResolveClientUrl(task.Model.RelateURL);
            if (url.IndexOf('?') >= 0)
            {
                url += "&ViewFramework=False";
            }
            else
            {
                url += "?ViewFramework=False";
            }
            frame_relateurl.Attributes.Add("src", url);
        }
        else
        {
            tr_RelateUrl.Visible  = false;
            hyl_RelateURL.Visible = false;
        }
        #endregion


        //Bind the dataobject info
        pl_dataobjectinfo.BindData(task.Model.DataObjectValues);
        if (task.Model.Status > 1)
        {
            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;
            }
        }

        //绑定环节列表
        gv_List_JobList.BindGrid <EWF_Task_Job>(task.GetJobList());
    }
    protected void gv_List_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName != "Approved" && e.CommandName != "UnApproved")
        {
            BindGrid();
            return;
        }
        #region 仅查看待我审批的费用申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        int organizecity = int.Parse(e.CommandArgument.ToString());
        string condition = " FNA_FeeWriteOff.State = 2 ";

        #region 组织明细记录的查询条件
        //管理片区及所有下属管理片区
        if (organizecity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(organizecity);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "") orgcitys += ",";
            orgcitys += organizecity.ToString();

            condition += " AND FNA_FeeWriteOff.OrganizeCity IN (" + orgcitys + ")";
        }

        //会计月条件
        condition += " AND FNA_FeeWriteOff.AccountMonth = " + ddl_Month.SelectedValue;

        #endregion
        if (e.CommandName == "Approved")
        {

            IList<FNA_FeeWriteOff> lists = FNA_FeeWriteOffBLL.GetModelList(condition);
            foreach (FNA_FeeWriteOff fee in lists)
            {
                if (TaskIDs.Contains(fee.ApproveTask.ToString()))
                {
                    int jobid = EWF_TaskBLL.StaffCanApproveTask(fee.ApproveTask, (int)Session["UserID"]);
                    EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                    if (job.Model != null)
                    {
                        int decision = job.StaffCanDecide((int)Session["UserID"]);
                        if (decision > 0)
                            job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                    }
                }
            }

            BindGrid();
            MessageBox.Show(this, "审批成功!");
        }
        else if (e.CommandName == "UnApproved")
        {

            IList<FNA_FeeWriteOff> lists = FNA_FeeWriteOffBLL.GetModelList(condition);
            foreach (FNA_FeeWriteOff fee in lists)
            {
                if (TaskIDs.Contains(fee.ApproveTask.ToString()))
                {
                    int jobid = EWF_TaskBLL.StaffCanApproveTask(fee.ApproveTask, (int)Session["UserID"]);
                    EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                    if (job.Model != null)
                    {
                        int decision = job.StaffCanDecide((int)Session["UserID"]);
                        if (decision > 0)
                            job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                    }
                }
            }

            BindGrid();
            MessageBox.Show(this, "已成功将选择区域的申请单,设为批复未通过!");
        }
    }
 private int Decision(int result, int CurrentJobID, int DecisionID)
 {
     EWF_Task_JobBLL job = new EWF_Task_JobBLL(CurrentJobID);
     return job.Decision(DecisionID, (int)Session["UserID"], result, "批量审核");
 }
Exemplo n.º 20
0
    private int Decision(int result)
    {
        string          decisionComment = tbx_DecisionComment.Text.Trim() == "" ? "已阅" : tbx_DecisionComment.Text.Trim();
        EWF_Task_JobBLL job             = new EWF_Task_JobBLL((int)ViewState["CurrentJobID"]);
        int             ret             = 0;

        if (result != 1)
        {
            ret = job.Decision((int)ViewState["DecisionID"], (int)Session["UserID"], result, decisionComment);
        }
        else
        {
            decisionComment += "<br/>------" + Session["UserRealName"].ToString() + " 于 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "批注意见-----<br/>";
            ret              = job.SaveDecisionComment((int)ViewState["DecisionID"], (int)Session["UserID"], decisionComment);
        }

        #region 通知任务发起人
        if (cbx_NotifyInitiator.Checked || result == 4)
        {
            string remark = "审批时间:<b><font color=blue>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</font></b> ";
            remark += "审批人:<b><font color=blue>" + Session["UserRealName"].ToString() + "</font></b> ";

            if (ViewState["PrincipalStaff"] != null)
            {
                remark += " <b><font color=red>授权人:" + ViewState["PrincipalStaff"].ToString() + "</font></b> ";
            }

            switch (result)
            {
            case 1:
                remark += " 审批结果:<b><font color=blue>暂挂审批</font></b>";
                break;

            case 2:
                remark += " 审批结果:<b><font color=blue>审批通过</font></b>";
                break;

            case 3:
                remark += " 审批结果:<b><font color=blue>审批不通过</font></b>";
                break;

            case 4:
                remark += " 审批结果:<b><font color=blue>审批待处理</font></b>";
                break;

            default:
                break;
            }
            remark += " 审批意见:<b><font color=blue>" + decisionComment + "</font></b><br/> ";

            EWF_TaskBLL taskbll = new EWF_TaskBLL(job.Model.Task);

            string _content = "<b><font color=blue>工作流处理通知!</font></b><br/>";
            _content += "工作流:<font color=blue>" + lbl_AppName.Text + "</font><br/>";
            _content += "主题:<font color=blue>" + lbl_Title.Text + "</font><br/><br/>";
            _content += decisionComment;

            _content += "<br/><a href='" + this.ResolveUrl("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + job.Model.Task.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

        return(ret);
    }
Exemplo n.º 21
0
    //绑定基本信息
    private void BindTaskData()
    {
        #region 绑定当前工作项
        EWF_Task_JobBLL job = new EWF_Task_JobBLL((int)ViewState["CurrentJobID"]);

        int decisionid = job.StaffCanDecide((int)Session["UserID"]);
        if (decisionid <= 0)
        {
            MessageBox.ShowAndRedirect(this, "对不起,你无权审批当前工作流申请!", "../desktop.aspx");
            return;
        }
        ViewState["DecisionID"] = decisionid;
        ViewState["TaskID"]     = job.Model.Task;

        //绑定当前审批人相关信息
        EWF_Flow_Process _CurrentProcess = new EWF_Flow_ProcessBLL(job.Model.CurrentProcess).Model;
        lbl_CurrentJobName.Text = _CurrentProcess.Name;
        if (_CurrentProcess.Type == 10)
        {
            //人员会审环节 无待处理选项
            btn_WaitProcess.Visible = false;
        }

        EWF_Task_JobDecisionBLL decision = new EWF_Task_JobDecisionBLL(decisionid);
        if (decision.Model.ReadFlag != "Y")
        {
            decision.SetReadFlag("Y");
        }
        lb_DecisionComment.Text = decision.Model.DecisionComment;

        this.lbl_RecipientStaff.Text = new Org_StaffBLL(decision.Model.RecipientStaff).Model.RealName;
        this.lbl_RecipientTime.Text  = DateTime.Now.ToString();

        if (decision.Model.RecipientStaff != (int)Session["UserID"])
        {
            ViewState["PrincipalStaff"] = lbl_RecipientStaff.Text;
            MessageBox.Show(this, "请注意,当前申请是由【" + lbl_RecipientStaff.Text + "】授权您来批复!");
        }
        #endregion

        #region 绑定流程信息
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        if (task.Model.Status == 5)
        {
            Response.Redirect("TaskDetail.aspx?TaskID=" + task.Model.ID.ToString());
            return;
        }

        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();
        }
        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

        ddl_App.SelectedValue = task.Model.App.ToString();

        ViewState["PageIndex"] = 0;
        BindGrid_OtherTask();
        BindGrid_InviteConsult();
    }
 private void DoApprove(int State, string remark)
 {
     foreach (GridViewRow gr in gv_List.Rows)
     {
         if (((CheckBox)gr.FindControl("chk_ID")).Checked)
         {
             int taskid = (int)gv_List.DataKeys[gr.RowIndex][0];
             if (taskid > 0)
             {
                 int jobid = EWF_TaskBLL.StaffCanApproveTask(taskid, (int)Session["UserID"]);
                 if (jobid > 0)
                 {
                     EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                     if (job != null)
                     {
                         int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                         if (decisionid > 0)
                         {
                             if (State == 2)
                                 job.Decision(decisionid, (int)Session["UserID"], 2, "汇总单批量审批通过!");         //2:审批已通过
                             else
                                 job.Decision(decisionid, (int)Session["UserID"], 3, "汇总单批量审批不通过!");       //3:审批不通过
                         }
                     }
                 }
             }
         }
     }
     BindGrid();
     MessageBox.Show(this, "审批成功!");
 }
    private void DoApprove(bool ApproveFlag)
    {
        foreach (GridViewRow row in gv_Summary.Rows)
        {
            CheckBox cbx = (CheckBox)row.FindControl("cbx");
            if (cbx != null && cbx.Checked)
            {
                string key = gv_Summary.DataKeys[row.RowIndex]["Key"].ToString();
                string[] tasks = GetApproveTaskIDsByKey(key).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (string taskid in tasks)
                {
                    int jobid = EWF_TaskBLL.StaffCanApproveTask(int.Parse(taskid), (int)Session["UserID"]);
                    if (jobid > 0)
                    {
                        EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                        if (job != null)
                        {
                            int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                            if (decisionid > 0)
                            {
                                if (ApproveFlag)
                                    job.Decision(decisionid, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                                else
                                    job.Decision(decisionid, (int)Session["UserID"], 3, "汇总单批量审批不通过!");     //3:审批不通过
                            }
                        }
                    }
                }
            }

        }
    }
 private void Approve(int state)
 {
     int userid = (int)Session["UserID"];
     foreach (GridViewRow row in gv_List.Rows)
     {
         Object cbx = row.FindControl("chk_ID");
         if (cbx != null && ((CheckBox)cbx).Checked)
         {
             Object tbx = row.FindControl("tbx_Remark");
             string Remark = "";
             if (tbx != null && !string.IsNullOrEmpty(((TextBox)tbx).Text))
                 Remark = ((TextBox)tbx).Text;
             else Remark = state == 2 ? "汇总单批量审批通过!" : "汇总单批量审批不通过!";
             int contractid = (int)gv_List.DataKeys[row.RowIndex]["ID"];
             CM_ContractBLL con = new CM_ContractBLL(contractid);
             int taskid = con.Model.ApproveTask;
             if (taskid > 0)
             {
                 int jobid = EWF_TaskBLL.StaffCanApproveTask(taskid, userid);
                 if (jobid > 0)
                 {
                     EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                     if (job != null)
                     {
                         int decisionid = job.StaffCanDecide(userid);
                         if (decisionid > 0)
                             job.Decision(decisionid, userid, state, Remark);
                     }
                 }
             }
         }
     }
 }
    protected void gv_List_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName != "Approved" && e.CommandName != "UnApproved")
        {
            BindGrid();
            return;
        }
        #region 仅查看待我审批的费用申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        int    organizecity = int.Parse(e.CommandArgument.ToString());
        string condition    = " FNA_FeeWriteOff.State = 2 ";

        #region 组织明细记录的查询条件
        //管理片区及所有下属管理片区
        if (organizecity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(organizecity);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "")
            {
                orgcitys += ",";
            }
            orgcitys += organizecity.ToString();

            condition += " AND FNA_FeeWriteOff.OrganizeCity IN (" + orgcitys + ")";
        }

        //会计月条件
        condition += " AND FNA_FeeWriteOff.AccountMonth = " + ddl_Month.SelectedValue;

        #endregion
        if (e.CommandName == "Approved")
        {
            IList <FNA_FeeWriteOff> lists = FNA_FeeWriteOffBLL.GetModelList(condition);
            foreach (FNA_FeeWriteOff fee in lists)
            {
                if (TaskIDs.Contains(fee.ApproveTask.ToString()))
                {
                    int             jobid = EWF_TaskBLL.StaffCanApproveTask(fee.ApproveTask, (int)Session["UserID"]);
                    EWF_Task_JobBLL job   = new EWF_Task_JobBLL(jobid);
                    if (job.Model != null)
                    {
                        int decision = job.StaffCanDecide((int)Session["UserID"]);
                        if (decision > 0)
                        {
                            job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                        }
                    }
                }
            }

            BindGrid();
            MessageBox.Show(this, "审批成功!");
        }
        else if (e.CommandName == "UnApproved")
        {
            IList <FNA_FeeWriteOff> lists = FNA_FeeWriteOffBLL.GetModelList(condition);
            foreach (FNA_FeeWriteOff fee in lists)
            {
                if (TaskIDs.Contains(fee.ApproveTask.ToString()))
                {
                    int             jobid = EWF_TaskBLL.StaffCanApproveTask(fee.ApproveTask, (int)Session["UserID"]);
                    EWF_Task_JobBLL job   = new EWF_Task_JobBLL(jobid);
                    if (job.Model != null)
                    {
                        int decision = job.StaffCanDecide((int)Session["UserID"]);
                        if (decision > 0)
                        {
                            job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                        }
                    }
                }
            }


            BindGrid();
            MessageBox.Show(this, "已成功将选择区域的申请单,设为批复未通过!");
        }
    }
 protected int DoApprove(bool ApproveFlag)
 {
     int counts = 0;
     foreach(GridViewRow row in gv_DetailList.Rows)
     {
         if (row.RowType == DataControlRowType.DataRow)
         {
             CheckBox cbx = row.FindControl("cb_Selected") as CheckBox;
             if (cbx.Checked)
             {
                 int taskid = (int)gv_DetailList.DataKeys[row.RowIndex]["FNA_FeeApply_ApproveTask"];
                 int jobid = EWF_TaskBLL.StaffCanApproveTask(taskid, (int)Session["UserID"]);
                 if (jobid > 0)
                 {
                     EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                     if (job != null)
                     {
                         int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                         if (decisionid > 0)
                         {
                             if (ApproveFlag)
                                 job.Decision(decisionid, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                             else
                                 job.Decision(decisionid, (int)Session["UserID"], 3, "汇总单批量审批不通过!");       //3:审批不通过
                             counts++;
                         }
                     }
                 }
             }
         }
     }
     return counts;
 }
Exemplo n.º 27
0
    protected void DoApprove(bool ApproveFlag)
    {
        #region 仅查看待我审批的工资申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        int    organizecity = int.Parse(tr_OrganizeCity.SelectValue);
        string condition    = " PM_Salary.State = 2 ";

        #region 组织明细记录的查询条件
        //管理片区及所有下属管理片区
        if (organizecity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(organizecity);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "")
            {
                orgcitys += ",";
            }
            orgcitys += organizecity.ToString();

            condition += " AND PM_Salary.OrganizeCity IN (" + orgcitys + ")";
        }

        if (ddl_SalaryClassify.SelectedValue != "0")
        {
            condition += "AND MCS_SYS.dbo.UF_Spilt2('MCS_Promotor.dbo.PM_Salary',PM_Salary.ExtPropertys,'PMClassfiy')=" + ddl_SalaryClassify.SelectedValue;
        }
        //会计月条件
        condition += " AND PM_Salary.AccountMonth = " + ddl_Month.SelectedValue;

        IList <PM_Salary> lists = PM_SalaryBLL.GetModelList(condition);
        #endregion

        foreach (PM_Salary salary in lists)
        {
            if (TaskIDs.Contains(salary["TaskID"]))
            {
                int             jobid = EWF_TaskBLL.StaffCanApproveTask(int.Parse(salary["TaskID"]), (int)Session["UserID"]);
                EWF_Task_JobBLL job   = new EWF_Task_JobBLL(jobid);
                if (job.Model != null)
                {
                    int decision = job.StaffCanDecide((int)Session["UserID"]);
                    if (decision > 0)
                    {
                        if (ApproveFlag)
                        {
                            job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                        }
                        else
                        {
                            job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                        }
                    }
                }
            }
        }

        BindGrid();
        MessageBox.Show(this, ApproveFlag ? "审批成功!" : "已成功将选择区域的申请单,设为批复未通过!");
        return;
    }
    private void DoApprove(bool ApproveFlag)
    {
        int month = int.Parse(ddl_Month.SelectedValue);
        int organizecity = int.Parse(tr_OrganizeCity.SelectValue);
        int state = 1;
        int RTChannel = 0;
        DataTable dtSummary = FNA_FeeApplyBLL.GetRTChannelFLFee
            (month, organizecity, state, int.Parse(Session["UserID"].ToString()), RTChannel);

        if (dtSummary != null)
        {
            string TaskColumnName = "";
            foreach (DataColumn c in dtSummary.Columns)
            {
                if (c.ColumnName.EndsWith("→审批工作流"))
                {
                    TaskColumnName = c.ColumnName;
                    break;
                }
            }
            if (TaskColumnName == "")
            {
                MessageBox.Show(this, "未找到列名[审批工作流]的数据列!");
                return;
            }

            IList<int> TaskIDs = new List<int>();
            foreach (DataRow row in dtSummary.Rows)
            {
                int taskid = (int)row[TaskColumnName];
                if (TaskIDs.Contains(taskid)) continue;

                TaskIDs.Add(taskid);

                int jobid = EWF_TaskBLL.StaffCanApproveTask(taskid, (int)Session["UserID"]);
                if (jobid > 0)
                {
                    EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                    if (job != null)
                    {
                        int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                        if (decisionid > 0)
                        {
                            if (ApproveFlag)
                                job.Decision(decisionid, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                            else
                                job.Decision(decisionid, (int)Session["UserID"], 3, "汇总单批量审批不通过!");       //3:审批不通过
                        }
                    }
                }
            }
        }

        BindGrid();
    }
Exemplo n.º 29
0
    //绑定审批环节详细信息
    private void BindRecipientProcessInfo(int JobID)
    {
        EWF_Task_JobBLL bll = new EWF_Task_JobBLL(JobID);

        gv_JobDecision.BindGrid <EWF_Task_JobDecision>(bll.GetDecisionList());
    }
    //绑定基本信息
    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
    }
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        int ApproveCount = 0, UnApproveCount = 0, errcount = 0;

        if (txt_UnApproveContractID.Text.Trim() != "")
        {
            string[] UnApproveID = Regex.Split(txt_UnApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);

            if (txt_ApproveContractID.Text.Trim() != "")
            {
                string[] ApproveID = Regex.Split(txt_ApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);
                foreach (string contractid in UnApproveID)
                {
                    if (ApproveID.Contains(contractid))
                    {
                        MessageBox.Show(this, "ID为【" + contractid + "】的返利协议同时出现在了【审批通过】与【审批不通过】编辑框中!");
                        return;
                    }
                }
            }
        }
        if (txt_ApproveContractID.Text.Trim() != "")
        {
            string[]       ApproveID = Regex.Split(txt_ApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);
            CM_ContractBLL _bll;
            StringBuilder  approvebuild = new StringBuilder("");

            for (int i = 0; i < ApproveID.Length; i++)
            {
                int ContractID;
                if (!ApproveID[i].Trim().Equals("") && int.TryParse(ApproveID[i].Trim(), out ContractID))
                {
                    _bll = new CM_ContractBLL(ContractID);
                    if (_bll.Model != null)
                    {
                        int jobid = EWF_TaskBLL.StaffCanApproveTask(_bll.Model.ApproveTask, 7394);
                        if (jobid > 0)
                        {
                            EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                            if (job != null)
                            {
                                int decisionid = job.StaffCanDecide(7394);
                                if (decisionid > 0)
                                {
                                    ApproveCount++;
                                    job.Decision(decisionid, (int)Session["UserID"], 2, "批量审批通过!");       //2:审批已通过
                                    approvebuild.Append("ID为【" + ContractID.ToString() + "】的返利协议审批通过  ");
                                }
                            }
                        }
                        else
                        {
                            approvebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未到客服确认环节   </span>");
                            errcount++;
                        }
                    }
                    else
                    {
                        approvebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未能在系统中找到  </span> ");
                        errcount++;
                    }
                }
                else if (!ApproveID[i].Trim().Equals("") && !int.TryParse(ApproveID[i].Trim(), out ContractID))
                {
                    approvebuild.Append("<span style='color: Red'>【" + ContractID.ToString() + "】不是一个有效的返利协议ID  </span> ");
                    errcount++;
                }
                if (i % 5 == 0 && i != 0)
                {
                    approvebuild.Append("<br/>");
                }
            }
            lb_ApproveErrorInfo.Text = approvebuild.ToString();
        }
        if (txt_UnApproveContractID.Text.Trim() != "")
        {
            string[]       UnApproveID = Regex.Split(txt_UnApproveContractID.Text.Trim(), "\r\n", RegexOptions.IgnoreCase);
            CM_ContractBLL _bll;
            StringBuilder  unapprovebuild = new StringBuilder("");
            for (int i = 0; i < UnApproveID.Length; i++)
            {
                int ContractID;
                if (!UnApproveID[i].Trim().Equals("") && int.TryParse(UnApproveID[i].Trim(), out ContractID))
                {
                    _bll = new CM_ContractBLL(ContractID);
                    if (_bll.Model != null)
                    {
                        int jobid = EWF_TaskBLL.StaffCanApproveTask(_bll.Model.ApproveTask, 7394);
                        if (jobid > 0)
                        {
                            EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                            if (job != null)
                            {
                                int decisionid = job.StaffCanDecide(7394);
                                if (decisionid > 0)
                                {
                                    UnApproveCount++;
                                    job.Decision(decisionid, (int)Session["UserID"], 3, "批量审批不通过!");       //3:审批不通过
                                    unapprovebuild.Append("ID为【" + ContractID.ToString() + "】的返利协议审批未通过  ");
                                }
                            }
                        }
                        else
                        {
                            unapprovebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未到客服确认环节  </span>");
                            errcount++;
                        }
                    }
                    else
                    {
                        errcount++;
                        unapprovebuild.Append("<span style='color: Red'>ID为【" + ContractID.ToString() + "】的返利协议未能在系统中找到  </span>");
                    }
                }
                else if (!UnApproveID[i].Trim().Equals("") && !int.TryParse(UnApproveID[i].Trim(), out ContractID))
                {
                    unapprovebuild.Append("<span style='color: Red'>【" + ContractID.ToString() + "】不是一个有效的返利协议ID  </span>");
                    errcount++;
                }
                if (i % 5 == 0 && i != 0)
                {
                    unapprovebuild.Append("<br/>");
                }
            }
            lb_UnApproveErrorInfo.Text = unapprovebuild.ToString();
        }

        MessageBox.Show(this, "审批通过协议个数:" + ApproveCount.ToString() + @"\n审批未通过协议个数:" + UnApproveCount.ToString() +
                        @"\n未能导入协议个数:" + errcount.ToString());
        return;
    }
    protected void DoApprove(bool ApproveFlag)
    {
        #region 仅查看待我审批的工资申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        int organizecity = int.Parse(tr_OrganizeCity.SelectValue);
        string condition = " PM_Salary.State = 2 ";

        #region 组织明细记录的查询条件
        //管理片区及所有下属管理片区
        if (organizecity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(organizecity);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "") orgcitys += ",";
            orgcitys += organizecity.ToString();

            condition += " AND PM_Salary.OrganizeCity IN (" + orgcitys + ")";
        }

        if (ddl_SalaryClassify.SelectedValue != "0")
        {
            condition += "AND MCS_SYS.dbo.UF_Spilt2('MCS_Promotor.dbo.PM_Salary',PM_Salary.ExtPropertys,'PMClassfiy')=" + ddl_SalaryClassify.SelectedValue;
        }
        //会计月条件
        condition += " AND PM_Salary.AccountMonth = " + ddl_Month.SelectedValue;

        IList<PM_Salary> lists = PM_SalaryBLL.GetModelList(condition);
        #endregion

        foreach (PM_Salary salary in lists)
        {
            if (TaskIDs.Contains(salary["TaskID"]))
            {
                int jobid = EWF_TaskBLL.StaffCanApproveTask(int.Parse(salary["TaskID"]), (int)Session["UserID"]);
                EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                if (job.Model != null)
                {
                    int decision = job.StaffCanDecide((int)Session["UserID"]);
                    if (decision > 0)
                    {
                        if (ApproveFlag)
                        {
                            job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                        }
                        else
                        {
                            job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                        }
                    }
                }
            }
        }

        BindGrid();
        MessageBox.Show(this, ApproveFlag ? "审批成功!" : "已成功将选择区域的申请单,设为批复未通过!");
        return;
    }
    protected void DoApprove(bool ApproveFlag)
    {
        #region 仅查看待我审批的工资申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        foreach (string taskid in TaskIDs)
        {

            int jobid = EWF_TaskBLL.StaffCanApproveTask(int.Parse(taskid), (int)Session["UserID"]);
            EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
            if (job.Model != null)
            {
                int decision = job.StaffCanDecide((int)Session["UserID"]);
                if (decision > 0)
                {
                    if (ApproveFlag)
                    {
                        job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                    }
                    else
                    {
                        job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                    }
                }
            }

        }

        BindGrid();
        MessageBox.Show(this, ApproveFlag ? "审批成功!" : "已成功将选择区域的申请单,设为批复未通过!");
        return;
    }
Exemplo n.º 34
0
    protected void gv_List_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        #region 仅查看待我审批的费用申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        int    organizecity = (int)gv_List.DataKeys[e.RowIndex]["ID"];
        string condition    = " FNA_FeeApply.State = 2 ";

        #region 组织明细记录的查询条件
        //管理片区及所有下属管理片区
        if (organizecity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(organizecity);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "")
            {
                orgcitys += ",";
            }
            orgcitys += organizecity.ToString();

            condition += " AND FNA_FeeApply.OrganizeCity IN (" + orgcitys + ")";
        }

        //会计月条件
        condition += " AND FNA_FeeApply.AccountMonth = " + ddl_Month.SelectedValue;

        //费用类型
        if (ddl_FeeType.SelectedValue != "0")
        {
            condition += " AND FNA_FeeApply.FeeType = " + ddl_FeeType.SelectedValue;
        }
        #endregion

        IList <FNA_FeeApply> lists = FNA_FeeApplyBLL.GetModelList(condition);
        foreach (FNA_FeeApply fee in lists)
        {
            if (TaskIDs.Contains(fee.ApproveTask.ToString()))
            {
                int             jobid = EWF_TaskBLL.StaffCanApproveTask(fee.ApproveTask, (int)Session["UserID"]);
                EWF_Task_JobBLL job   = new EWF_Task_JobBLL(jobid);
                if (job.Model != null)
                {
                    int decision = job.StaffCanDecide((int)Session["UserID"]);
                    if (decision > 0)
                    {
                        job.Decision(decision, (int)Session["UserID"], 3, "汇总单批量未能审批通过!");    //3:审批未通过
                    }
                }
            }
        }


        BindGrid();
        MessageBox.Show(this, "已成功将选择区域的申请单,设为批复未通过!");
    }
 private int DoApproveTask(int TaskID, int DessionResult, string DessionComment)
 {
     if (TaskID > 0)
     {
         int jobid = EWF_TaskBLL.StaffCanApproveTask(TaskID, (int)Session["UserID"]);
         if (jobid > 0)
         {
             EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
             if (job != null)
             {
                 int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                 if (decisionid > 0)
                 {
                     return job.Decision(decisionid, (int)Session["UserID"], DessionResult, DessionComment);
                 }
             }
         }
     }
     return -1;
 }
Exemplo n.º 36
0
    //选择某个Job,查看详细信息
    protected void gv_List_JobList_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        int JobID = (int)this.gv_List_JobList.DataKeys[e.NewSelectedIndex]["ID"];
        EWF_Task_JobBLL job = new EWF_Task_JobBLL(JobID);
        EWF_Flow_ProcessBLL process = new EWF_Flow_ProcessBLL(job.Model.CurrentProcess);

        this.tr_RecipientProcess.Visible = false;
        this.tr_ConditionProcess.Visible = false;
        this.tr_DataBaseProcess.Visible = false;
        this.tr_SendMailProcess.Visible = false;
        this.tr_CCProcess.Visible = false;

        switch (process.Model.Type)
        {
            case 1://开始环节
                break;
            case 2://结束环节
                break;
            case 3://人员审批环节
            case 10:   //人员会审环节
                this.tr_RecipientProcess.Visible = true;
                BindRecipientProcessInfo(JobID);
                break;
            case 4://条件判断环节
                this.tr_ConditionProcess.Visible = true;
                BindConditionProcessInfo(JobID);
                break;
            case 5://执行数据库环节
                this.tr_DataBaseProcess.Visible = true;
                BindDataBaseProcessInfo(JobID);
                break;
            case 6://发送邮件环节
                this.tr_SendMailProcess.Visible = true;
                BindSendMailProcessInfo(JobID);
                break;
            case 9: //抄送环节
                tr_CCProcess.Visible = true;
                BindCCProcessInfo(JobID);
                break;
        }
    }
    private int Decision(int result, int CurrentJobID, int DecisionID)
    {
        EWF_Task_JobBLL job = new EWF_Task_JobBLL(CurrentJobID);

        return(job.Decision(DecisionID, (int)Session["UserID"], result, "批量审核"));
    }
Exemplo n.º 38
0
    //绑定条件判断环节详细信息
    private void BindConditionProcessInfo(int JobID)
    {
        EWF_Task_JobBLL job = new EWF_Task_JobBLL(JobID);
        EWF_TaskBLL task = new EWF_TaskBLL(job.Model.Task);
        EWF_Flow_ProcessConditionBLL process = new EWF_Flow_ProcessConditionBLL(job.Model.CurrentProcess);
        EWF_Flow_DataObjectBLL dataobject = new EWF_Flow_DataObjectBLL(process.Model.DataObject);

        this.lbl_DataObjectName.Text = dataobject.Model.Name;
        this.lbl_DataObjectDisPlayName.Text = dataobject.Model.DisplayName;

        this.lbl_DataObjectValue.Text = task.GetDataObjectValue()[dataobject.Model.Name]; ;
        this.lbl_OperatorTypeName.Text = DictionaryBLL.GetDicCollections("EWF_Flow_OperatorType")[process.Model.OperatorType.ToString()].Name;

        this.lbl_Value1.Text = process.Model.Value1;
        this.lbl_Value2.Text = process.Model.Value2;
    }
Exemplo n.º 39
0
    //绑定执行数据库环节详细信息
    private void BindDataBaseProcessInfo(int JobID)
    {
        EWF_Task_JobBLL job = new EWF_Task_JobBLL(JobID);
        EWF_Flow_ProcessDataBaseBLL process = new EWF_Flow_ProcessDataBaseBLL(job.Model.CurrentProcess);

        this.lbl_DSN.Text = process.Model.DSN;
        this.lbl_StoreProcName.Text = process.Model.StoreProcName;
        this.gv_List_ParamList.BindGrid<EWF_Flow_DataBaseParam>(process.GetParamsList());
    }
Exemplo n.º 40
0
 //绑定审批环节详细信息
 private void BindRecipientProcessInfo(int JobID)
 {
     EWF_Task_JobBLL bll = new EWF_Task_JobBLL(JobID);
     gv_JobDecision.BindGrid<EWF_Task_JobDecision>(bll.GetDecisionList());
 }
Exemplo n.º 41
0
    protected int DoApprove(int OrganizeCity, bool ApproveFlag)
    {
        int       month     = int.Parse(ddl_Month.SelectedValue);
        int       state     = 1;    //待我审批
        int       RTChannel = 0;    //所有渠道
        DataTable dtSummary = FNA_FeeApplyBLL.GetRTChannelDiaplayFee
                                  (month, OrganizeCity, state, int.Parse(Session["UserID"].ToString()), RTChannel);

        int counts = 0;

        if (dtSummary != null)
        {
            string TaskColumnName = "";
            foreach (DataColumn c in dtSummary.Columns)
            {
                if (c.ColumnName.EndsWith("→审批工作流"))
                {
                    TaskColumnName = c.ColumnName;
                    break;
                }
            }
            if (TaskColumnName == "")
            {
                MessageBox.Show(this, "未找到列名[审批工作流]的数据列!");
                return(-1);
            }

            IList <int> TaskIDs = new List <int>();
            foreach (DataRow row in dtSummary.Rows)
            {
                int taskid = (int)row[TaskColumnName];
                if (TaskIDs.Contains(taskid))
                {
                    continue;
                }

                TaskIDs.Add(taskid);

                int jobid = EWF_TaskBLL.StaffCanApproveTask(taskid, (int)Session["UserID"]);
                if (jobid > 0)
                {
                    EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                    if (job != null)
                    {
                        int decisionid = job.StaffCanDecide((int)Session["UserID"]);
                        if (decisionid > 0)
                        {
                            if (ApproveFlag)
                            {
                                job.Decision(decisionid, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                            }
                            else
                            {
                                job.Decision(decisionid, (int)Session["UserID"], 3, "汇总单批量审批不通过!");       //3:审批不通过
                            }
                            counts++;
                        }
                    }
                }
            }
        }

        return(counts);
    }
    protected void gv_List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        #region 仅查看待我审批的费用申请单
        string taskids = "";
        if (ddl_State.SelectedValue == "1")
        {
            taskids = GetNeedMeApproveTaskIDs();

            if (taskids == "")
            {
                MessageBox.Show(this, "对不起,没有需要待您审批的费用申请单!");
                return;
            }
        }
        #endregion
        string[] TaskIDs = taskids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        int organizecity = (int)gv_List.DataKeys[e.NewSelectedIndex]["ID"];
        string condition = " FNA_FeeApply.State = 2 ";

        #region 组织明细记录的查询条件
        //管理片区及所有下属管理片区
        if (organizecity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(organizecity);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "") orgcitys += ",";
            orgcitys += organizecity.ToString();

            condition += " AND FNA_FeeApply.OrganizeCity IN (" + orgcitys + ")";
        }

        //会计月条件
        condition += " AND FNA_FeeApply.AccountMonth = " + ddl_Month.SelectedValue;

        //费用类型
        if (ddl_FeeType.SelectedValue != "0")
        {
            condition += " AND FNA_FeeApply.FeeType = " + ddl_FeeType.SelectedValue;
        }
        #endregion

        IList<FNA_FeeApply> lists = FNA_FeeApplyBLL.GetModelList(condition);
        foreach (FNA_FeeApply fee in lists)
        {
            if (TaskIDs.Contains(fee.ApproveTask.ToString()))
            {
                int jobid = EWF_TaskBLL.StaffCanApproveTask(fee.ApproveTask, (int)Session["UserID"]);
                EWF_Task_JobBLL job = new EWF_Task_JobBLL(jobid);
                if (job.Model != null)
                {
                    int decision = job.StaffCanDecide((int)Session["UserID"]);
                    if (decision > 0)
                        job.Decision(decision, (int)Session["UserID"], 2, "汇总单批量审批通过!");       //2:审批已通过
                }
            }
        }

        BindGrid();
        MessageBox.Show(this, "审批成功!");
    }