Exemplo n.º 1
0
 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, "审批成功!");
 }
    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.º 3
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);
    }
Exemplo n.º 4
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.º 5
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);
                            }
                        }
                    }
                }
            }
        }
    }
    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, "批量审核");
 }
    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 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;
    }
Exemplo n.º 11
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;
    }
    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;
    }
 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);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 16
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, "已成功将选择区域的申请单,设为批复未通过!");
    }
Exemplo n.º 17
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);
    }
 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;
 }
 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;
 }
    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, "批量审核"));
    }
    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();
    }
    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.º 23
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, "审批成功!");
    }