示例#1
0
文件: TaskOpt.cs 项目: radtek/EMIP
        public virtual JObject Public(HttpContext context)
        {
            YZRequest request = new YZRequest(context);

            this.ApproveCheck(context);

            int     taskid   = request.GetInt32("TaskID");
            JObject jPost    = request.GetPostData <JObject>();
            string  comments = (string)jPost["comments"];
            BPMObjectNameCollection accounts = jPost["uids"].ToObject <BPMObjectNameCollection>();

            UserCollection users = new UserCollection();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                foreach (string account in accounts)
                {
                    User user = BPMTask.Public(cn, taskid, account);
                    users.Add(user);
                }

                JObject rv = new JObject();
                rv[YZJsonProperty.success] = true;
                rv["UserNameList"]         = YZStringHelper.GetUserNameListString(users);

                return(rv);
            }
        }
示例#2
0
        public virtual JObject Remind(HttpContext context)
        {
            YZRequest      request  = new YZRequest(context);
            JObject        jPost    = request.GetPostData <JObject>();
            string         comments = (string)jPost["comments"];
            JArray         jTargets = (JArray)jPost["targets"];
            UserCollection users    = new UserCollection();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                foreach (JObject jTarget in jTargets)
                {
                    int stepid = (int)jTarget["stepid"];
                    BPMObjectNameCollection uids = jTarget["uids"].ToObject <BPMObjectNameCollection>();
                    users.Append(BPMProcStep.Remind(cn, stepid, uids, comments));
                }
            }

            JObject rv = new JObject();

            rv[YZJsonProperty.success] = true;
            rv["UserNameList"]         = YZStringHelper.GetUserNameListString(users);

            return(rv);
        }
示例#3
0
文件: TaskOpt.cs 项目: radtek/EMIP
        public virtual JObject InviteIndicate(HttpContext context)
        {
            YZRequest request = new YZRequest(context);

            this.ApproveCheck(context);

            int     taskid   = request.GetInt32("TaskID");
            JObject jPost    = request.GetPostData <JObject>();
            string  comments = (string)jPost["comments"];
            BPMObjectNameCollection accounts = jPost["uids"].ToObject <BPMObjectNameCollection>();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                BPMTask        task  = BPMTask.Load(cn, taskid);
                UserCollection users = BPMTask.InviteIndicate(cn, taskid, accounts, comments);

                JObject rv = new JObject();
                rv[YZJsonProperty.success] = true;
                rv["SN"]           = task.SerialNum;
                rv["UserNameList"] = YZStringHelper.GetUserNameListString(users);

                return(rv);
            }
        }
示例#4
0
    public static string GetPostResultDisplayStringShort(PostResult postResult)
    {
        //获得处理结果
        string message;

        string customMessage = postResult.CustomMessage;

        if (!String.IsNullOrEmpty(customMessage))
        {
            customMessage = "[" + customMessage + "]";
        }

        switch (postResult.PostResultType)
        {
        case PostResultType.HasSentToOtherUsers:
            message = String.Format(Resources.YZStrings.Aspx_PostResult_HasSentToOtherUsers1, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
            break;

        case PostResultType.InWaitingOtherUsers:
            message = String.Format(Resources.YZStrings.Aspx_PostResult_InWaitingOtherUsers1, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
            break;

        case PostResultType.TaskInWaiting:
            message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskInWaiting1, customMessage);
            break;

        case PostResultType.TaskFinishedApproved:
            message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskFinishedApproved1, customMessage);
            break;

        case PostResultType.TaskFinishedRejected:
            message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskFinishedRejected1, customMessage);
            break;

        case PostResultType.RecedeRestarted:
            message = String.Format(Resources.YZStrings.Aspx_PostResult_RecedeRestarted1, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
            break;

        default:
            message = String.Empty;
            break;
        }

        return(message);
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (String.Compare(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowMaintenancePage"], "true", true) == 0)
        {
            Response.Redirect("~/YZSoft/Maintenance/Default.aspx");
        }

        Guid itemguid = new Guid(Request.QueryString["ItemGuid"]);

        BPMConnection cn = new BPMConnection();

        try
        {
            //连接
            cn.WebOpenAnonymous(this.Page);

            //提交处理请求
            PostResult postResult = BPMTask.ClickToProcess(cn, itemguid);

            //获得处理结果
            string message;

            string customMessage = postResult.CustomMessage;
            if (!String.IsNullOrEmpty(customMessage))
            {
                customMessage = "\n[" + customMessage + "]";
            }

            switch (postResult.PostResultType)
            {
            case PostResultType.HasSentToOtherUsers:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_HasSentToOtherUsers, postResult.SN, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
                break;

            case PostResultType.InWaitingOtherUsers:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_InWaitingOtherUsers, postResult.SN, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
                break;

            case PostResultType.TaskInWaiting:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskInWaiting, postResult.SN, customMessage);
                break;

            case PostResultType.TaskFinishedApproved:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskFinishedApproved, postResult.SN, customMessage);
                break;

            case PostResultType.TaskFinishedRejected:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_TaskFinishedRejected, postResult.SN, customMessage);
                break;

            case PostResultType.RecedeRestarted:
                message = String.Format(Resources.YZStrings.Aspx_PostResult_RecedeRestarted, postResult.SN, YZStringHelper.GetUserNameListString(postResult.Recipients), customMessage);
                break;

            default:
                message = String.Empty;
                break;
            }

            //输出处理结果
            Response.Write(message);
        }
        catch (Exception exp)
        {
            Response.Write(exp.Message);
        }
        finally
        {
            cn.Close();
        }
    }