protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] > 0)
        {
            JN_WorkingPlanBLL bll = new JN_WorkingPlanBLL((int)ViewState["ID"]);

            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("Position", new Org_StaffBLL(bll.Model.Staff).Model.Position.ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("TotalCost", bll.Model["TotalCost"]);

            string title = select_PlanStaff.SelectText + " 开始日期:" + tbx_begindate.Text + "至" + tbx_enddate.Text + bll.Model.Title;

            int TaskID = EWF_TaskBLL.NewTask("JN_WorkingPlan_Apply", (int)Session["UserID"], title, "~/SubModule/OA/Journal/WorkingPlan_CalendarList.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            #endregion

            if (TaskID > 0)
            {
                bll.Submit((int)Session["UserID"], TaskID);
            }

            Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
        }
    }
Пример #2
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, "审批成功!");
 }
Пример #3
0
    private void BindMyTask()
    {
        IList <EWF_Task> list = EWF_TaskBLL.GetByInitiator(Guid.Empty, (int)Session["UserID"],
                                                           DateTime.Now.AddMonths(-6), DateTime.Now, 3, 0);

        gv_MyTaskList.BindGrid <EWF_Task>(list);
    }
Пример #4
0
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] != 0)
        {
            bt_Save_Click(null, null);

            ORD_OrderApplyBLL bll = new ORD_OrderApplyBLL((int)ViewState["ID"]);

            if (bll.Items.Count == 0)
            {
                MessageBox.Show(this, "对不起,定单请购明细不能为空!");
                return;
            }
            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("TotalFee", lb_TotalCost.Text);
            dataobjects.Add("IsSpecial", bll.Model["IsSpecial"]);
            dataobjects.Add("ProductType", bll.Model["ProductType"]);
            dataobjects.Add("ProductBrand", bll.Model["ProductBrand"]);
            int TaskID;
            TaskID = EWF_TaskBLL.NewTask("Product_Apply", (int)Session["UserID"], "订单产品申请流程,订单号:" + bll.Model.SheetCode, "~/SubModule/Logistics/Order/OrderProductApplyDetail.aspx?ID=" + ViewState["ID"].ToString() + "&Type=1", dataobjects);
            new EWF_TaskBLL(TaskID).Start();
            #endregion

            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model.State     = 2;
            bll.Update();
            Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
        }
    }
Пример #5
0
    //Bind Basic Info
    private void BindData()
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        //绑定流程信息
        lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName;
        lbl_AppName.Text = new EWF_Flow_AppBLL(task.Model.App).Model.Name;
        tbx_Topic.Text = task.Model.Title;

        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 = "未结束";

        if (task.Model.RelateURL != "")
        {
            hyl_RelateURL.NavigateUrl = task.Model.RelateURL;
            hyl_RelateURL.Visible = true;
        }
        else
            hyl_RelateURL.Visible = false;

        //Bind the dataobject info
        NameValueCollection dataobjects = task.GetDataObjectValue();
        pl_dataobjectinfo.BindData(dataobjects);
    }
Пример #6
0
    //Bind Basic Info
    private void BindData()
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        //绑定流程信息
        lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName;
        lbl_AppName.Text = new EWF_Flow_AppBLL(task.Model.App).Model.Name;
        tbx_Topic.Text   = task.Model.Title;

        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 = "未结束";
        }

        if (task.Model.RelateURL != "")
        {
            hyl_RelateURL.NavigateUrl = task.Model.RelateURL;
            hyl_RelateURL.Visible     = true;
        }
        else
        {
            hyl_RelateURL.Visible = false;
        }

        //Bind the dataobject info
        NameValueCollection dataobjects = task.GetDataObjectValue();

        pl_dataobjectinfo.BindData(dataobjects);
    }
    protected void bt_RevocationApply_Click(object sender, EventArgs e)
    {
        CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

        if (PM_PromotorInRetailerBLL.GetModelList("Client=" + bll.Model.ID.ToString() + " AND EXISTS(SELECT 1 FROM MCS_Promotor.dbo.PM_Promotor WHERE PM_Promotor.ID=PM_PromotorInRetailer.Promotor AND Dimission=1 AND ApproveFlag=1)").Count > 0)
        {
            MessageBox.Show(this, "该门店还有关联的导购,请转移或解除与该门店的关系!");
            return;
        }

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", ViewState["ClientID"].ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("ClientName", bll.Model.FullName.ToString());
        dataobjects.Add("Channel", bll.Model["RTChannel"]);
        dataobjects.Add("CloseTime", DateTime.Now.ToShortDateString());
        dataobjects.Add("Remark", "门店终止合作");
        dataobjects.Add("IsKeyClient", bll.Model["IsKeyClient"].ToString());


        int TaskID = EWF_TaskBLL.NewTask("Revocation_Retailer", (int)Session["UserID"], "撤销门店,名称:" + bll.Model.FullName, "~/SubModule/CM/RT/RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);

        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"]  = "2";
            bll.Update();
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
Пример #8
0
    private void BindAttachmentList()
    {
        //绑定附件
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        gv_List_Attachment.BindGrid <EWF_Task_Attachment>(task.GetAttachmentsList());
    }
    protected void btn_Apply_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["PriceID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }

        PDT_StandardPriceBLL bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]);

        if (bll.GetApplyCityDetail().Count == 0)
        {
            MessageBox.Show(this, "请点击【适用区域】按钮,选择该标准价表适用于的区域!");
            return;
        }

        bt_CompareStdPrice_Click(null, null);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", bll.Model.ID.ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("FullName", bll.Model.FullName);
        dataobjects.Add("MaxRate", ((decimal)ViewState["MaxRate"] * 100).ToString());

        int TaskID = EWF_TaskBLL.NewTask("PDT_StandardPrice_Apply", (int)Session["UserID"], "标准价表名称:" + bll.Model.FullName, "~/SubModule/Product/PDT_StandardPriceDetail.aspx?PriceID=" + ViewState["PriceID"].ToString(), dataobjects);

        if (TaskID > 0)
        {
            bll.Model.TaskID = TaskID;
            bll.Update();
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }
        Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
    }
    protected void bt_AddApply_Click(object sender, EventArgs e)
    {
        bt_OK_Click(null, null);
        if (CM_LinkManBLL.GetModelList("ClientID=" + ViewState["ClientID"].ToString()).Count == 0)
        {
            MessageBox.Show(this, "对不起,请至少提供一名客户联系人!");
            return;
        }
        CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", bll.Model.ID.ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("ClientName", bll.Model.FullName);
        dataobjects.Add("Channel", bll.Model["RTChannel"]);
        dataobjects.Add("StoreAnalysis", bll.Model["Store_Analysis"]);
        dataobjects.Add("IsACClient", bll.Model["IsACClient"]);

        int TaskID = EWF_TaskBLL.NewTask("Add_Retailer", (int)Session["UserID"], "终端门店名称:" + bll.Model.FullName, "~/SubModule/CM/RT/RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);

        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"]  = "2";
            bll.Update();
            //new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
Пример #11
0
    protected void bt_AddApply_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }

        Org_StaffBLL bll = new Org_StaffBLL((int)ViewState["ID"]);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", ViewState["ID"].ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("Position", bll.Model.Position.ToString());
        dataobjects.Add("SalaryFlag", bll.Model["SalaryFlag"].ToString());
        dataobjects.Add("StaffName", bll.Model.RealName.ToString());

        int TaskID = EWF_TaskBLL.NewTask("Add_Staff", (int)Session["UserID"], "人员入职流程,姓名:" + bll.Model.RealName, "~/SubModule/StaffManage/StaffDetail.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);

        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"]  = "2";
            bll.Update();
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
    protected void bt_Approve_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ForcastID"] != 0)
        {
            string wftitle = "经销商销量预估流程申请ID:";
            Save();
            if ((int)ViewState["ClientType"] == 3)
            {
                wftitle = "零售商销量预估流程申请ID:";
            }

            Org_StaffBLL        bll         = new Org_StaffBLL((int)Session["UserID"]);
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ForcastID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("ApplyFee", SVM_ClassifyForcastBLL.GetForcastSumPrice((int)ViewState["ForcastID"]).ToString());
            int TaskID = EWF_TaskBLL.NewTask("SVM_ClassifyForcast_Approve", (int)Session["UserID"], wftitle + ViewState["ForcastID"].ToString(), "~/SubModule/SVM/ClassifyForcastDetail.aspx?ClientID=" + ViewState["ClientID"].ToString() + "&ForcastID=" + ViewState["ForcastID"].ToString(), dataobjects);
            if (TaskID > 0)
            {
                SVM_ClassifyForcastBLL.Submit((int)ViewState["ForcastID"], TaskID);
                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }
            bt_Approve.Enabled = false;
            Response.Redirect("~/SubModule/SVM/ClassifyForcast.aspx");
        }
    }
Пример #13
0
    //取消执行
    protected void bt_Cancel_Click(object sender, EventArgs e)
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        task.Cancel();
        MessageBox.ShowAndRedirect(this, "流程已被取消执行!!", "../desktop.aspx");
    }
Пример #14
0
    protected void bt_Cancel_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] != 0)
        {
            FNA_FeeApplyBLL bll = new FNA_FeeApplyBLL((int)ViewState["ID"]);

            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("FeeType", bll.Model.FeeType.ToString());

            #region 组合审批任务主题
            string title = "费用取消" + ",申请备案号:" + bll.Model.SheetCode;
            #endregion

            int TaskID = EWF_TaskBLL.NewTask("FNA_FeeApplyFlow_Cancel", (int)Session["UserID"], title, "~/SubModule/FNA/FeeApply/FeeApplyDetail3.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
            if (TaskID <= 0)
            {
                MessageBox.Show(this, "对不起,工作流发起失败,请与管理员联系!");
                return;
            }
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            #endregion

            MessageBox.ShowAndRedirect(this, "取消费用申请单成功!", "FeeApplyList.aspx");
        }
    }
    protected void bt_DIUP_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ClientID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }
        bt_OK_Click(null, null);

        CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", ViewState["ClientID"].ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("ClientName", bll.Model.FullName.ToString());
        dataobjects.Add("OperateClassify", bll.Model["OperateClassify"]);
        dataobjects.Add("DIClassify", bll.Model["DIClassify"]);


        int TaskID = EWF_TaskBLL.NewTask("Distributor_Upgrade", (int)Session["UserID"], "分经销商转经销商,经销商名称:" + bll.Model.FullName, "~/SubModule/CM/DI/DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);

        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"]  = "2";
            bll.Update();
            //new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] != 0)
        {
            bt_OK_Click(null, null);

            FNA_BudgetExtraApplyBLL bll = new FNA_BudgetExtraApplyBLL((int)ViewState["ID"]);

            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("ExtraAmount", bll.Model.ExtraAmount.ToString("0.##"));
            dataobjects.Add("FeeType", bll.Model.FeeType.ToString());
            dataobjects.Add("ExtraType", bll.Model["ExtraType"]);
            dataobjects.Add("SupportOrganizeCity", bll.Model["SupportOrganizeCity"]);

            #region 组合审批任务主题
            string title = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", bll.Model.OrganizeCity) + " 申请扩增预算额度,申请扩增额度:" + bll.Model.ExtraAmount.ToString("0.##");
            #endregion

            int TaskID = EWF_TaskBLL.NewTask("FNA_BudgetExtraApplyFlow", (int)Session["UserID"], title, "~/SubModule/FNA/Budget/BudgetExtraApplyDetail.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
            if (TaskID <= 0)
            {
                MessageBox.Show(this, "对不起,工作流发起失败,请与管理员联系!");
                return;
            }
            bll.Submit((int)Session["UserID"], TaskID);
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            #endregion

            MessageBox.ShowAndRedirect(this, "预算扩增提交成功!", Page.ResolveClientUrl("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString()));
        }
    }
Пример #17
0
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] > 0)
        {
            bt_Save_Click(null, null);

            PM_SalaryBLL bll = new PM_SalaryBLL((int)ViewState["ID"]);

            #region 判断预算余额是否够工单申请(暂不使用)
            //int feetype = ConfigHelper.GetConfigInt("SalaryFeeType");

            //decimal budgetbalance = FNA_BudgetBLL.GetUsableAmount((int)ViewState["ApplyMonth"], bll.Model.OrganizeCity, feetype) +
            //    FNA_BudgetBLL.GetUsableAmount((int)ViewState["ApplyMonth"], bll.Model.OrganizeCity, 0);
            //if (budgetbalance < bll.GetSumSalary())
            //{
            //    MessageBox.Show(this, "对不起,您当前的预算余额不够申请此导购员工资申请,您当前的预算余额为:" + budgetbalance.ToString());
            //    return;
            //}
            #endregion

            #region 判断导购是否有销量
            //if(new PM_SalaryBLL((int)ViewState["ID"]).Items.Sum(p=>p.ActSalesVolume)==0)
            //{
            //     MessageBox.Show(this, "该工资单中所有导购的销量均为零,请确认是否异常!");

            //     return;
            //}
            #endregion

            if (bll.Model["TaskID"] != "" && bll.Model.State == 2)
            {
                MessageBox.ShowAndRedirect(this, "该工资单已提交,请勿重复提交!", "PM_SalaryDetailList.aspx?ID=" + ViewState["ID"].ToString());
                return;
            }

            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("ApplyCost", lb_TotalCost.Text);
            dataobjects.Add("PromotorNum", bll.Items.Count.ToString());

            //组合审批任务主题
            Addr_OrganizeCity _city = new Addr_OrganizeCityBLL(bll.Model.OrganizeCity).Model;
            string            title = _city.Name + ",导购员工资总额:" + lb_TotalCost.Text + ",人数:" + bll.Items.Count.ToString();

            int TaskID = EWF_TaskBLL.NewTask("PM_SalaryApplyFlow", (int)Session["UserID"], title, "~/SubModule/PM/PM_SalaryDetailList.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
            if (TaskID > 0)
            {
                bll.Submit((int)Session["UserID"], TaskID, 0);
                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }
            #endregion

            MessageBox.ShowAndRedirect(this, "导购员工资提交申请成功!", "../EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
        }
    }
Пример #18
0
    public string GetDataObjectValue(Guid DataObjectID)
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        if (DataObjectID != Guid.Empty)
            return task.GetDataObjectValue()[new EWF_Flow_DataObjectBLL(DataObjectID).Model.Name];
        else
            return "";
    }
Пример #19
0
    //确定发起
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        if (task.Start() >= 0)
        {
            MessageBox.ShowAndRedirect(this, "流程已成功发起!!", "TaskDetail.aspx?TaskID=" + task.Model.ID.ToString());
        }
        else
        {
            MessageBox.Show(this, "对不起,流程发起失败,请确认该申请流程有开始环节!");
        }
    }
Пример #20
0
    public string GetDataObjectValue(Guid DataObjectID)
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        if (DataObjectID != Guid.Empty)
        {
            return(task.GetDataObjectValue()[new EWF_Flow_DataObjectBLL(DataObjectID).Model.Name]);
        }
        else
        {
            return("");
        }
    }
Пример #21
0
    //确定发起
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        if (task.Start() >= 0)
        {
            MessageBox.ShowAndRedirect(this, "流程已成功发起!!", "TaskDetail.aspx?TaskID=" + task.Model.ID.ToString());
        }
        else
        {
            MessageBox.Show(this, "对不起,流程发起失败,请确认该申请流程有开始环节!");
        }
    }
Пример #22
0
    private void BindGrid()
    {
        string condition = "(StartTime BETWEEN '" + tbx_begin.Text + "' AND '" + tbx_end.Text + " 23:59:59')";

        condition += " AND Status=" + MCSTabControl1.SelectedTabItem.Value.ToString();

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


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

                condition += " AND Initiator IN (SELECT ID FROM MCS_SYS.dbo.Org_Staff WHERE OrganizeCity IN (" + orgcitys + "))";
            }
            #endregion
        }
        if (tbx_KeyWords.Text != "")
        {
            condition += " AND (Title like '%" + tbx_KeyWords.Text +
                         "%' OR  CAST (ID AS VARCHAR)='" + tbx_KeyWords.Text + "')";
        }

        if (ddl_FinishStatus.SelectedValue != "0")
        {
            condition += " AND FinishStatus = " + ddl_FinishStatus.SelectedValue;
        }

        //condition += " ORDER BY ID desc";
        gv_List.PageIndex = (int)ViewState["PageIndex"];
        IList <EWF_Task> tasks = EWF_TaskBLL.GetModelList(condition);
        gv_List.BindGrid <EWF_Task>(tasks);
    }
Пример #23
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;
    }
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        CM_ContractBLL _bll   = new CM_ContractBLL((int)ViewState["ContractID"]);
        CM_Client      client = new CM_ClientBLL(_bll.Model.Client).Model;

        if (_bll.Items.Count == 0)
        {
            MessageBox.Show(this, "对不起,物业租赁合同必须要录入合同具体的付款科目才能提交申请!");
            return;
        }
        decimal applycost = _bll.Items.Sum(p => p.ApplyLimit);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", _bll.Model.ID.ToString());
        dataobjects.Add("Classify", _bll.Model.Classify.ToString());
        dataobjects.Add("ApplyCost", applycost.ToString("0.##"));

        dataobjects.Add("OrganizeCityID", client.OrganizeCity.ToString());
        dataobjects.Add("PDClassify", client["PDClassify"]);        //物业类别

        #region 组织任务标题
        string _title    = "";
        Label  lb_Client = (Label)pl_detail.FindControl("CM_Contract_Client");
        if (lb_Client != null)
        {
            _title += "物业名称:" + lb_Client.Text;
        }

        if (_bll.Model.ContractCode != "")
        {
            _title += " 合同编码:" + _bll.Model.ContractCode;
        }
        #endregion

        int TaskID = EWF_TaskBLL.NewTask("CM_Contract_Flow", (int)Session["UserID"], _title,
                                         "~/SubModule/CM/PD/PropertyDetail.aspx?ClientID=" + _bll.Model.Client.ToString(), dataobjects);
        if (TaskID > 0)
        {
            _bll.Model.State       = 2;
            _bll.Model.ApproveTask = TaskID;
            _bll.Update();
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }

        Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
    }
Пример #25
0
    private void BindGrid()
    {
        Guid App = Guid.Empty;

        if (ddl_App.SelectedValue != "0")
        {
            App = new Guid(ddl_App.SelectedValue);
        }
        DateTime dtBegin = DateTime.Parse(tbx_begin.Text);
        DateTime dtEnd   = DateTime.Parse(tbx_end.Text).AddDays(1);

        IList <EWF_Task> list = EWF_TaskBLL.GetByInitiator(App, (int)Session["UserID"], dtBegin, dtEnd,
                                                           int.Parse(ddl_Status.SelectedValue), int.Parse(ddl_FinishStatus.SelectedValue));

        gv_List.TotalRecordCount = list.Count;
        gv_List.PageIndex        = (int)ViewState["PageIndex"];
        gv_List.BindGrid <EWF_Task>(list);
    }
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        Save();

        if ((int)ViewState["InventoryID"] > 0)
        {
            SVM_InventoryDifferencesBLL bll = new SVM_InventoryDifferencesBLL((int)ViewState["InventoryID"]);
            if (bll.Model["TaskID"] != "" && bll.Model["SubmitFlag"] == "1")
            {
                return;
            }
            CM_Client client = new CM_ClientBLL(bll.Model.Client).Model;

            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", bll.Model.ID.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());

            dataobjects.Add("ClientID", bll.Model.Client.ToString());
            dataobjects.Add("ClientFullName", client.FullName);
            dataobjects.Add("ClientType", client.ClientType.ToString());
            dataobjects.Add("DIClassify", client["DIClassify"]);
            dataobjects.Add("RTClassify", client["RTClassify"]);
            dataobjects.Add("RTChannel", client["RTChannel"]);

            dataobjects.Add("ComputeInventory", ((decimal)ViewState["ComputeInventory"]).ToString("0.0"));
            dataobjects.Add("TotalDiffValue", ((decimal)ViewState["TotalDiffValue"]).ToString("0.0"));
            dataobjects.Add("TotalAbsDiffValue", ((decimal)ViewState["TotalAbsDiffValue"]).ToString("0.0"));
            dataobjects.Add("AbsDiffRate", ((decimal)ViewState["AbsDiffRate"]).ToString("0.00") + "%");
            dataobjects.Add("ISCXP", bll.Model["IsCXP"]);

            int TaskID = EWF_TaskBLL.NewTask("SVM_InventoryDifferences_Flow", (int)Session["UserID"], "客户名称:" + client.FullName, "~/SubModule/SVM/InventoryDifferenceInput.aspx?InventoryID=" + ViewState["InventoryID"].ToString(), dataobjects);
            if (TaskID > 0)
            {
                bt_Submit.Visible       = false;
                bll.Model["TaskID"]     = TaskID.ToString();
                bll.Model["SubmitFlag"] = "1";
                bll.Update();
                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }

            Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
        }
    }
    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;
    }
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] > 0)
        {
            bt_Save_Click(null, null);

            FNA_StaffSalaryBLL bll = new FNA_StaffSalaryBLL((int)ViewState["ID"]);

            //#region 判断预算余额是否够工单申请
            int feetype = ConfigHelper.GetConfigInt("SalaryFeeType");

            //decimal budgetbalance = FNA_BudgetBLL.GetUsableAmount(bll.Model.AccountMonth, bll.Model.OrganizeCity, feetype) +
            //    FNA_BudgetBLL.GetUsableAmount(bll.Model.AccountMonth, bll.Model.OrganizeCity, 0);
            //if (budgetbalance < bll.GetSumSalary())
            //{
            //    MessageBox.Show(this, "对不起,您当前的预算余额不够申请此工资申请,您当前的预算余额为:" + budgetbalance.ToString());
            //    return;
            //}
            //#endregion

            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("ApplyCost", lb_TotalCost.Text);
            dataobjects.Add("StaffNum", bll.Items.Count.ToString());

            //组合审批任务主题
            Addr_OrganizeCity _city = new Addr_OrganizeCityBLL(bll.Model.OrganizeCity).Model;
            string            title = _city.Name + ",员工工资总额:" + lb_TotalCost.Text + ",人数:" + bll.Items.Count.ToString();

            int TaskID = EWF_TaskBLL.NewTask("FNA_SalaryApplyFlow", (int)Session["UserID"], title, "~/SubModule/FNA/StaffSalary/StaffSalaryDetailList.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
            if (TaskID > 0)
            {
                bll.Submit((int)Session["UserID"], TaskID, feetype);

                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }
            #endregion

            MessageBox.ShowAndRedirect(this, "员工工资提交申请成功!", "../../EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
        }
    }
    //暂存意见
    protected void bt_SaveComment_Click(object sender, EventArgs e)
    {
        if (tbx_Comment.Text == "")
        {
            MessageBox.Show(this, "批复意见必填");
            return;
        }

        string comment = tbx_Comment.Text.Trim();

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

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

        JobCCBLL.SaveComment(comment);

        #region 更新任务备注信息
        string remark = "抄送批注时间:<b><font color=red>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</font></b> ";
        remark += "抄送批注人:<b><font color=red>" + Session["UserRealName"].ToString() + "</font></b> ";
        remark += " 批注意见:<b><font color=red>" + tbx_Comment.Text + "</font></b> ";
        remark += "<br/>";

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

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

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

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

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

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

        EWF_Task_InviteConsultBLL InviteConsultBLL = new EWF_Task_InviteConsultBLL((int)ViewState["InviteConsult"]);
        InviteConsultBLL.SaveConsultComment(comment);

        #region 更新任务备注信息
        string remark = "协助时间:<b><font color=red>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</font></b> ";
        remark += "协助审批人:<b><font color=red>" + Session["UserRealName"].ToString() + "</font></b> ";
        remark += " 审批意见:<b><font color=red>" + tbx_DecisionComment.Text + "</font></b> ";
        remark += "<br/>";

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

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

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

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

        MessageBox.ShowAndRedirect(this, "保存成功!", "TaskList_InviteConsult.aspx");
    }
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["TelephoneID"] != 0)
        {
            string _title = "";

            CM_PropertyInTelephoneBLL _bll        = new CM_PropertyInTelephoneBLL((int)ViewState["TelephoneID"]);
            NameValueCollection       dataobjects = new NameValueCollection();
            dataobjects.Add("ID", _bll.Model.ID.ToString());
            if (_bll.Model.Client > 0)
            {
                CM_Client _c = new CM_ClientBLL(_bll.Model.Client).Model;
                if (_c != null)
                {
                    dataobjects.Add("ClientID", _bll.Model.Client.ToString());
                    dataobjects.Add("ClientName", _c.FullName);
                    _title += _c.FullName;
                }
            }
            dataobjects.Add("TeleNumber", _bll.Model.TeleNumber.ToString());
            dataobjects.Add("TeleCost", _bll.Model.TeleCost.ToString("0.##"));
            dataobjects.Add("NetCost", _bll.Model.NetCost.ToString("0.##"));

            #region 组织任务标题

            _title += "电话号码:" + _bll.Model.TeleNumber;

            #endregion

            int TaskID = EWF_TaskBLL.NewTask("CM_PropertyInTelephone_Flow", (int)Session["UserID"], _title,
                                             "~/SubModule/CM/PD/PropertyInTelephoneDetail.aspx?TelephoneID=" + _bll.Model.ID.ToString(), dataobjects);
            if (TaskID > 0)
            {
                _bll.Model.State       = 2;
                _bll.Model.ApproveTask = TaskID;
                _bll.Update();
                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }

            Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
        }
    }
Пример #32
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);
 }
Пример #33
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);
                            }
                        }
                    }
                }
            }
        }
    }
Пример #34
0
    //Submit the Apply
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        EWF_TaskBLL task;
        if ((int)ViewState["TaskID"] == 0)
        {
            task = new EWF_TaskBLL();
            task.Model.App = (Guid)ViewState["AppID"];
            task.Model.Initiator = (int)Session["UserID"];
            task.Model.Title = tbx_Topic.Text;
            task.Model.DataObjectValues = pl_dataobjectinfo.GetData();
            task.Add();
        }
        else
        {
            task = new EWF_TaskBLL((int)ViewState["TaskID"]);
            task.SetDataObjectValue(pl_dataobjectinfo.GetData());
        }
        task.Start();

        MessageBox.ShowAndRedirect(this, "流程已成功发起!!", "TaskDetail.aspx?TaskID=" + task.Model.ID.ToString());
    }
    protected void btn_pass_Click(object sender, EventArgs e)
    {
        int TaskID, JobCCID;
        foreach (GridViewRow row in gv_List.Rows)
        {
            CheckBox cb_check = (CheckBox)row.FindControl("cb_Check");
            if (cb_check.Checked)
            {
                TaskID = int.Parse(gv_List.DataKeys[row.RowIndex]["TaskID"].ToString());
                JobCCID = int.Parse(gv_List.DataKeys[row.RowIndex]["ID"].ToString());
                EWF_TaskBLL taskbll = new EWF_TaskBLL(TaskID);
                EWF_Task_JobCCBLL JobCCBLL = new EWF_Task_JobCCBLL(JobCCID);
                if (taskbll.Model.EndTime == new DateTime(1900, 1, 1) && JobCCBLL.Model.ReadFlag != "Y")
                {
                    string comment = "已阅";
                    comment += "<br/>------" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "-------<br/>";
                    JobCCBLL.SaveComment(comment);

                    #region 更新任务备注信息
                    string remark = "抄送批注时间:<b><font color=red>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</font></b> ";
                    remark += "抄送批注人:<b><font color=red>" + Session["UserRealName"].ToString() + "</font></b> ";
                    remark += " 批注意见:<b><font color=red>已阅</font></b> ";
                    remark += "<br/>";

                    taskbll.AppendRemark(remark);

                    #endregion

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

            }
        }
        MessageBox.Show(this, "批量审阅成功!");
        BindGrid();
    }
Пример #36
0
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        int id = (int)ViewState["BalanceID"];
        CSO_OfferBalanceBLL bll = new CSO_OfferBalanceBLL(id);

        if (bll.Model != null && bll.Model.State == 1)
        {
            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["BalanceID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("TotalFee", bll.Items.Sum(p => p.PayFee).ToString("0.##"));

            #region 组合审批任务主题
            string          title = "";
            AC_AccountMonth month = new AC_AccountMonthBLL(bll.Model.AccountMonth).Model;
            if (month != null)
            {
                title += month.Name;
            }
            title += " " + TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", bll.Model.OrganizeCity);
            title += "营养教育新客费用申请";

            #endregion

            int TaskID = EWF_TaskBLL.NewTask("CSO_OfferBalanceApply", (int)Session["UserID"], title,
                                             "~/SubModule/CSO/CSO_OfferBalanceDetail.aspx?OfferBalanceID=" + ViewState["BalanceID"].ToString(), dataobjects);
            if (TaskID > 0)
            {
                bll.Submit(TaskID, (int)Session["UserID"]);

                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }
            #endregion

            MessageBox.ShowAndRedirect(this, "结算单成功提交申请!", "CSO_OfferBalanceList.aspx");
        }
    }
    private void BindData()
    {
        int id = (int)ViewState["ID"];

        FNA_FeeApply apply = new FNA_FeeApplyBLL(id).Model;
        ViewState["AccountMonth"] = apply.AccountMonth;

        if (apply == null) Response.Redirect("FeeApplyList.aspx");

        pn_FeeApply.BindData(apply);

        Label lb_OrganizeCity = (Label)pn_FeeApply.FindControl("FNA_FeeApply_OrganizeCity");
        lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", apply.OrganizeCity);

        #region 将备注信息单独显示出来
        Label lb_remark = (Label)pn_FeeApply.FindControl("FNA_FeeApply_Remark");
        if (lb_remark != null)
        {
            lb_remark.Text = apply["Remark"].Replace("\r\n", "<br/>");
        }
        #endregion

        BindGrid();

        #region 获取流程审批意见
        int TaskID = 0;

        if (int.TryParse(apply["TaskID"], out TaskID) && TaskID > 0)
        {
            EWF_TaskBLL task = new EWF_TaskBLL(TaskID);
            if (task.Model != null)
            {
                lb_TaskApproveInfo.Text = task.Model.Remark;
            }
        }
        #endregion
    }
    //绑定基本信息
    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
    }
Пример #39
0
    //继续执行
    protected void bt_Restart_Click(object sender, EventArgs e)
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        task.ReStart();
        MessageBox.ShowAndRedirect(this, "流程已继续执行!!", "../desktop.aspx");
    }
Пример #40
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;
    }
Пример #41
0
 //绑定环节列表
 private void BindProcessList()
 {
     EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);
 }
Пример #42
0
 private void BindAttachmentList()
 {
     //绑定附件
     EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);
     gv_List_Attachment.BindGrid<EWF_Task_Attachment>(task.GetAttachmentsList());
 }
Пример #43
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());
    }