Beispiel #1
0
        /// <summary>
        /// 增加阅办处理记录
        /// </summary>
        /// <param name="applyId">申请单ID</param>
        /// <param name="userIdList">流程用户ID列表</param>
        /// <returns></returns>
        public bool AddReadRecord(string applyId, string userIdList)
        {
            if (string.IsNullOrEmpty(applyId) || string.IsNullOrEmpty(userIdList))
            {
                return(false);
            }

            string[] userIdArray = userIdList.Split(',');
            if (userIdArray == null || userIdArray.Length == 0)
            {
                return(false);
            }

            IApplyRead dal = baseDal as IApplyRead;

            foreach (string userId in userIdArray)
            {
                if (!string.IsNullOrEmpty(userId))
                {
                    var applyUserInfo = new ApplyUserInfo(applyId, Convert.ToInt32(userId));
                    BLLFactory <ApplyUser> .Instance.Insert(applyUserInfo);

                    ApplyReadInfo readInfo = new ApplyReadInfo(applyId, Convert.ToInt32(userId));
                    baseDal.Insert(readInfo);
                }
            }

            return(true);
        }
Beispiel #2
0
        public bool AddUserBaseInfo(ApplyUserInfo userinfo)
        {
            string sql = "insert into BaseInfor ( UserName,WorkUnitID,WorkUnitName,Sex,Birthdate,Degree,JobTitle,UnitPosition,MainResearch,\r\nCardNo,OfficePhones,MobilePhone,EMail,UnitID,UnitName,UnitIDCard,UnitNormal,UnitContacts,UnitAddress,UnitForORG,UnitProperties,UnitContactsPhone)\r\nvalues ( @UserName,@WorkUnit,@Sex,@Birthdate,@Degree,@JobTitle,@UnitPosition,@MainResearch,@CardNo,@OfficePhones,\r\n@MobilePhone,@EMail,@Unit,@UnitNormal,@UnitSchool,@UnitContacts,@UnitAddress,@UnitForORG,@UnitProperties,@UnitContactsPhone)";

            SQLiteParameter[] parameters = new SQLiteParameter[]
            {
                new SQLiteParameter("@UserName", userinfo.ApplyUserName),
                new SQLiteParameter("@WorkUnitID", userinfo.WorkUnitID),
                new SQLiteParameter("@WorkUnitName", userinfo.WorkUnitName),
                new SQLiteParameter("@Sex", userinfo.Sex),
                new SQLiteParameter("@Birthdate", userinfo.Birthday),
                new SQLiteParameter("@Degree", userinfo.Degree),
                new SQLiteParameter("@JobTitle", userinfo.JobTitle),
                new SQLiteParameter("@UnitPosition", userinfo.UnitPosition),
                new SQLiteParameter("@MainResearch", userinfo.MainResearch),
                new SQLiteParameter("@CardNo", userinfo.CardNo),
                new SQLiteParameter("@OfficePhones", userinfo.OfficePhones),
                new SQLiteParameter("@MobilePhone", userinfo.MobilePhone),
                new SQLiteParameter("@EMail", userinfo.EMail),
                new SQLiteParameter("@UnitID", userinfo.UnitID),
                new SQLiteParameter("@UnitName", userinfo.UnitName),
                new SQLiteParameter("@UnitIDCard", userinfo.UnitIDCard),
                new SQLiteParameter("@UnitNormal", userinfo.UnitNormal),
                new SQLiteParameter("@UnitSchool", userinfo.UnitSchool),
                new SQLiteParameter("@UnitContacts", userinfo.UnitContacts),
                new SQLiteParameter("@UnitAddress", userinfo.UnitAddress),
                new SQLiteParameter("@UnitForORG", userinfo.UnitForORG),
                new SQLiteParameter("@UnitProperties", userinfo.UnitProperties),
                new SQLiteParameter("@UnitContactsPhone", userinfo.UnitContactsPhone)
            };
            string text = "";

            base.ExecuteNonQuery(sql, parameters, out text);
            return(true);
        }
Beispiel #3
0
        public bool UpdateUserBaseInfo(ApplyUserInfo userinfo)
        {
            string sql = "update BaseInfor set  UserName=@UserName,WorkUnitID=@WorkUnitID,WorkUnitName=@WorkUnitName,Sex=@Sex,Birthdate=@Birthdate,\r\nDegree=@Degree,JobTitle=@JobTitle,UnitPosition=@UnitPosition,MainResearch=@MainResearch,\r\nCardNo=@CardNo,OfficePhones=@OfficePhones,MobilePhone=@MobilePhone,EMail=@EMail,UnitID=@UnitID,UnitName=@UnitName,UnitIDCard=@UnitIDCard,UnitNormal=@UnitNormal,UnitSchool=@UnitSchool,UnitContacts=@UnitContacts,\r\nUnitAddress=@UnitAddress,UnitForORG=@UnitForORG,UnitProperties=@UnitProperties,UnitContactsPhone=@UnitContactsPhone";

            SQLiteParameter[] parameters = new SQLiteParameter[]
            {
                new SQLiteParameter("@UserName", userinfo.ApplyUserName),
                new SQLiteParameter("@WorkUnitID", userinfo.WorkUnitID),
                new SQLiteParameter("@WorkUnitName", userinfo.WorkUnitName),
                new SQLiteParameter("@Sex", userinfo.Sex),
                new SQLiteParameter("@Birthdate", userinfo.Birthday),
                new SQLiteParameter("@Degree", userinfo.Degree),
                new SQLiteParameter("@JobTitle", userinfo.JobTitle),
                new SQLiteParameter("@UnitPosition", userinfo.UnitPosition),
                new SQLiteParameter("@MainResearch", userinfo.MainResearch),
                new SQLiteParameter("@CardNo", userinfo.CardNo),
                new SQLiteParameter("@OfficePhones", userinfo.OfficePhones),
                new SQLiteParameter("@MobilePhone", userinfo.MobilePhone),
                new SQLiteParameter("@EMail", userinfo.EMail),
                new SQLiteParameter("@UnitID", userinfo.UnitID),
                new SQLiteParameter("@UnitName", userinfo.UnitName),
                new SQLiteParameter("@UnitIDCard", userinfo.UnitIDCard),
                new SQLiteParameter("@UnitNormal", userinfo.UnitNormal),
                new SQLiteParameter("@UnitSchool", userinfo.UnitSchool),
                new SQLiteParameter("@UnitContacts", userinfo.UnitContacts),
                new SQLiteParameter("@UnitAddress", userinfo.UnitAddress),
                new SQLiteParameter("@UnitForORG", userinfo.UnitForORG),
                new SQLiteParameter("@UnitProperties", userinfo.UnitProperties),
                new SQLiteParameter("@UnitContactsPhone", userinfo.UnitContactsPhone)
            };
            string text = "";

            base.ExecuteNonQuery(sql, parameters, out text);
            return(true);
        }
    public void SetDetailInfo(NewGuildWarDetailInfoDlg.eSTATE eState)
    {
        this.InitControl();
        if (this.m_i64GuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID())
        {
            this.m_lbGuildName.SetText(NrTSingleton <NewGuildManager> .Instance.GetGuildName());
        }
        else
        {
            this.m_lbGuildName.SetText(NrTSingleton <GuildWarManager> .Instance.GuildWarGuildName);
        }
        if (0L < this.m_i64GuildID)
        {
            string guildPortraitURL = NrTSingleton <NkCharManager> .Instance.GetGuildPortraitURL(this.m_i64GuildID);

            WebFileCache.RequestImageWebFile(guildPortraitURL, new WebFileCache.ReqTextureCallback(this.ReqWebImageCallback), null);
        }
        int           num           = 0;
        ApplyUserInfo applyUserInfo = this.GetApplyUserInfo(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_PersonID);

        if (applyUserInfo == null)
        {
            applyUserInfo = this.GetApplyUserInfoLeader();
        }
        if (applyUserInfo != null)
        {
            num = (int)applyUserInfo.GetRaidBattlePos();
        }
        this.m_iCurSelectIndex = num;
        this.m_iOldSelectIndex = num;
        this.LoadEffect();
        this.SetDetailInfoSub(num);
        if (this.m_i64GuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID())
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strText, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2595"),
                "targetname",
                NrTSingleton <NewGuildManager> .Instance.GetGuildName(),
                "count",
                (int)(this.m_iRaidUnique + 1)
            });
        }
        else
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strText, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2595"),
                "targetname",
                NrTSingleton <GuildWarManager> .Instance.GuildWarGuildName,
                "count",
                (int)(this.m_iRaidUnique + 1)
            });
        }
        this.m_lbGuildWarInfo.SetText(this.m_strText);
    }
Beispiel #5
0
        /// <summary>
        /// 重置申请表为处理中状态,并增加当前审批人和记录日志
        /// </summary>
        /// <param name="userInfo">用户、部门、公司对象</param>
        /// <param name="applyId">申请单ID</param>
        /// <param name="flowInfo">流程信息</param>
        private void InitApplyUserAndLog(LoginUserInfo userInfo, string applyId, ApplyFlowInfo flowInfo)
        {
            //删除当前审批人
            BLLFactory <ApplyUser> .Instance.DeleteByApplyId(applyId);

            ApplyInfo applyInfo = BLLFactory <Apply> .Instance.FindByID(applyId);

            if (applyInfo != null)
            {
                //如果指定了用户,则使用指定的,否则使用流程用户
                var procUsers = flowInfo.ProcUser;

                #region 更新申请表单的状态及信息

                applyInfo.ProcUser   = procUsers;
                applyInfo.ProcType   = flowInfo.ProcType;
                applyInfo.MustSelect = false;
                applyInfo.Status     = ApplyStatus.处理中;
                applyInfo.ProcTime   = "";
                applyInfo.WhyCancel  = "";
                BLLFactory <Apply> .Instance.Update(applyInfo, applyId);

                #endregion

                #region 增加新的流程处理人ApplyUser

                if (!string.IsNullOrEmpty(procUsers))
                {
                    var userList = procUsers.ToDelimitedList <string>(",");
                    foreach (string userId in userList)
                    {
                        var applyUserInfo = new ApplyUserInfo(applyInfo.ID, userId.Trim().ToInt32());
                        BLLFactory <ApplyUser> .Instance.Insert(applyUserInfo);
                    }
                }
                #endregion

                #region 申请单日志记录

                var content = string.Format("创建流程环节[{0}]的处理人信息。", flowInfo.FlowName);
                BLLFactory <ApplyLog> .Instance.AddApplyLog(applyId, userInfo.ID.ToInt32(), content);

                #endregion
            }
        }
Beispiel #6
0
        /// <summary>
        /// 增加会签处理记录
        /// </summary>
        /// <param name="applyId">申请单ID</param>
        /// <param name="userIdList">流程用户ID列表</param>
        /// <returns></returns>
        public bool AddSignRecord(string applyId, string userIdList)
        {
            if (string.IsNullOrEmpty(applyId) || string.IsNullOrEmpty(userIdList))
            {
                return(false);
            }

            string[] userIdArray = userIdList.Split(',');
            if (userIdArray == null || userIdArray.Length == 0)
            {
                return(false);
            }

            //获取当前流程ID
            string flowId          = "";
            var    currentFlowInfo = BLLFactory <ApplyFlow> .Instance.GetFirstUnHandledFlow(applyId);

            if (currentFlowInfo != null)
            {
                flowId = currentFlowInfo.ID;
            }

            //删除当前审批人
            BLLFactory <ApplyUser> .Instance.DeleteByApplyId(applyId);

            foreach (string userId in userIdArray)
            {
                if (!string.IsNullOrEmpty(userId))
                {
                    //写入流程处理人记录
                    var applyUserInfo = new ApplyUserInfo(applyId, Convert.ToInt32(userId));
                    BLLFactory <ApplyUser> .Instance.Insert(applyUserInfo);

                    //写入会签记录信息(初始化)
                    ApplySignInfo signInfo = new ApplySignInfo(applyId, Convert.ToInt32(userId), flowId);
                    baseDal.Insert(signInfo);
                }
            }

            return(true);
        }
Beispiel #7
0
        /// <summary>
        /// 为最后的流程增加阅办步骤(根据selprocuser增加1~n步)
        /// </summary>
        /// <param name="applyId">申请单ID</param>
        /// <param name="selprocuser">流程用户ID字符串,如:1,2,3</param>
        /// <returns></returns>
        public bool AddReadAppFlow(string applyId, string selprocuser)
        {
            if (string.IsNullOrEmpty(applyId) || string.IsNullOrEmpty(selprocuser))
            {
                return(false);
            }

            IApplyFlow    dal             = baseDal as IApplyFlow;
            ApplyFlowInfo currentFlowInfo = dal.GetLastCompletedFlow(applyId);
            int           orderno         = currentFlowInfo.OrderNo + 1;

            #region 为流程中每个用户创建一个阅办流程, 并增加流程处理人ApplyUser信息

            string[] userArray = selprocuser.Split(',');
            foreach (string userId in userArray)
            {
                ApplyFlowInfo addFlowInfo = new ApplyFlowInfo();
                addFlowInfo.ApplyId  = applyId;
                addFlowInfo.FlowName = "阅办";
                addFlowInfo.IsAdd    = 1;
                addFlowInfo.ProcType = (int)ProcType.阅办; //阅办
                addFlowInfo.ProcUser = userId;           //该步骤的处理人
                addFlowInfo.OrderNo  = orderno++;

                baseDal.Insert(addFlowInfo);
            }

            foreach (string userId in userArray)
            {
                var userInfo = new ApplyUserInfo(applyId, Convert.ToInt32(userId.Trim()));
                BLLFactory <ApplyUser> .Instance.Insert(userInfo);
            }

            #endregion

            return(true);
        }
Beispiel #8
0
        public ApplyUserInfo GetUserBaseInfo()
        {
            string        querystring   = "select UserName,WorkUnitID,WorkUnitName,Sex,Birthdate,Degree,JobTitle,UnitPosition,MainResearch,\r\nCardNo,OfficePhones,MobilePhone,EMail,UnitID,UnitName,UnitIDCard,UnitNormal,UnitSchool,UnitContacts,UnitAddress,UnitForORG,UnitProperties,UnitContactsPhone from BaseInfor";
            string        text          = "";
            DataTable     data          = base.GetData(querystring, out text);
            ApplyUserInfo applyUserInfo = null;

            if (data != null && data.Rows.Count > 0)
            {
                applyUserInfo = new ApplyUserInfo();
                applyUserInfo.ApplyUserName     = ((data.Rows[0]["UserName"] == DBNull.Value) ? "" : data.Rows[0]["UserName"].ToString());
                applyUserInfo.Sex               = ((data.Rows[0]["Sex"] == DBNull.Value) ? "" : data.Rows[0]["Sex"].ToString());
                applyUserInfo.Birthday          = ((data.Rows[0]["Birthdate"] == DBNull.Value) ? DateTime.Now.ToLongDateString() : data.Rows[0]["Birthdate"].ToString());
                applyUserInfo.BirInDB           = ((data.Rows[0]["Birthdate"] == DBNull.Value) ? "" : data.Rows[0]["Birthdate"].ToString());
                applyUserInfo.Degree            = ((data.Rows[0]["Degree"] == DBNull.Value) ? "" : data.Rows[0]["Degree"].ToString());
                applyUserInfo.JobTitle          = ((data.Rows[0]["JobTitle"] == DBNull.Value) ? "" : data.Rows[0]["JobTitle"].ToString());
                applyUserInfo.UnitPosition      = ((data.Rows[0]["UnitPosition"] == DBNull.Value) ? "" : data.Rows[0]["UnitPosition"].ToString());
                applyUserInfo.MainResearch      = ((data.Rows[0]["MainResearch"] == DBNull.Value) ? "" : data.Rows[0]["MainResearch"].ToString());
                applyUserInfo.CardNo            = ((data.Rows[0]["CardNo"] == DBNull.Value) ? "" : data.Rows[0]["CardNo"].ToString());
                applyUserInfo.OfficePhones      = ((data.Rows[0]["OfficePhones"] == DBNull.Value) ? "" : data.Rows[0]["OfficePhones"].ToString());
                applyUserInfo.MobilePhone       = ((data.Rows[0]["MobilePhone"] == DBNull.Value) ? "" : data.Rows[0]["MobilePhone"].ToString());
                applyUserInfo.EMail             = ((data.Rows[0]["EMail"] == DBNull.Value) ? "" : data.Rows[0]["EMail"].ToString());
                applyUserInfo.WorkUnitID        = ((data.Rows[0]["WorkUnitID"] == DBNull.Value) ? "" : data.Rows[0]["WorkUnitID"].ToString());
                applyUserInfo.WorkUnitName      = ((data.Rows[0]["WorkUnitName"] == DBNull.Value) ? "" : data.Rows[0]["WorkUnitName"].ToString());
                applyUserInfo.UnitID            = ((data.Rows[0]["UnitID"] == DBNull.Value) ? "" : data.Rows[0]["UnitID"].ToString());
                applyUserInfo.UnitName          = ((data.Rows[0]["UnitName"] == DBNull.Value) ? "" : data.Rows[0]["UnitName"].ToString());
                applyUserInfo.UnitIDCard        = ((data.Rows[0]["UnitIDCard"] == DBNull.Value) ? "" : data.Rows[0]["UnitIDCard"].ToString());
                applyUserInfo.UnitNormal        = ((data.Rows[0]["UnitNormal"] == DBNull.Value) ? "" : data.Rows[0]["UnitNormal"].ToString());
                applyUserInfo.UnitSchool        = ((data.Rows[0]["UnitSchool"] == DBNull.Value) ? "" : data.Rows[0]["UnitSchool"].ToString());
                applyUserInfo.UnitContacts      = ((data.Rows[0]["UnitContacts"] == DBNull.Value) ? "" : data.Rows[0]["UnitContacts"].ToString());
                applyUserInfo.UnitForORG        = ((data.Rows[0]["UnitForORG"] == DBNull.Value) ? "" : data.Rows[0]["UnitForORG"].ToString());
                applyUserInfo.UnitProperties    = ((data.Rows[0]["UnitProperties"] == DBNull.Value) ? "" : data.Rows[0]["UnitProperties"].ToString());
                applyUserInfo.UnitContactsPhone = ((data.Rows[0]["UnitContactsPhone"] == DBNull.Value) ? "" : data.Rows[0]["UnitContactsPhone"].ToString());
                applyUserInfo.UnitAddress       = ((data.Rows[0]["UnitAddress"] == DBNull.Value) ? "" : data.Rows[0]["UnitAddress"].ToString());
            }
            return(applyUserInfo);
        }
 public void RefeshDetailInfo(GS_GUILDWAR_APPLY_MILITARY_INFO_ACK ACK, NkDeserializePacket kDeserializePacket)
 {
     this.m_ApplyInfo.Clear();
     this.m_i64GuildID  = ACK.i64GuildID;
     this.m_iRaidUnique = ACK.ui8RaidUnique;
     for (int i = 0; i < (int)ACK.i16UserInfoCount; i++)
     {
         GUILDWAR_APPLY_MILITARY_USER_INFO packet = kDeserializePacket.GetPacket <GUILDWAR_APPLY_MILITARY_USER_INFO>();
         ApplyInfo item = new ApplyInfo(packet);
         this.m_ApplyInfo.Add(item);
     }
     for (int i = 0; i < (int)ACK.i16DetailInfoCount; i++)
     {
         GUILDWAR_APPLY_MILITARY_DETAIL_INFO packet2 = kDeserializePacket.GetPacket <GUILDWAR_APPLY_MILITARY_DETAIL_INFO>();
         this.AddDetailInfo(packet2);
     }
     NewGuildWarDetailInfoDlg.eSTATE eSTATE;
     if (ACK.i64GuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID())
     {
         ApplyUserInfo applyUserInfo = this.GetApplyUserInfo(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_PersonID);
         if (applyUserInfo != null && applyUserInfo.GetLeader() == 1)
         {
             eSTATE = NewGuildWarDetailInfoDlg.eSTATE.eSTATE_RAID_LEADER;
         }
         else
         {
             eSTATE = NewGuildWarDetailInfoDlg.eSTATE.eSTATE_RAID_MEMBER;
         }
     }
     else
     {
         eSTATE = NewGuildWarDetailInfoDlg.eSTATE.eSTATE_ENEMY_INFO;
     }
     this.SetLayerInfo(eSTATE);
     this.SetDetailInfo(eSTATE);
 }
 public bool UpdateUserBaseInfo(ApplyUserInfo userinfo)
 {
     return(this._applyUserBaseInfoDao.UpdateUserBaseInfo(userinfo));
 }
Beispiel #11
0
        /// <summary>
        /// 处理当前的流程Approve/Refuse。
        /// </summary>
        /// <param name="userInfo">用户、部门、公司对象</param>
        /// <param name="applyId">申请单ID</param>
        /// <param name="msgsendto">发送消息给谁</param>
        /// <param name="opinion">处理意见</param>
        /// <param name="is_proc">当前流程是否通过,1为通过,2为拒绝</param>
        /// <param name="selprocuser">流程处理人</param>
        private void ProcessApplyFlow(LoginUserInfo userInfo, string applyId, string msgsendto, string opinion, int is_proc, string selprocuser)
        {
            ApplyInfo applyInfo = BLLFactory <Apply> .Instance.FindByID(applyId);

            ApplyFlowInfo flowInfo = BLLFactory <ApplyFlow> .Instance.GetFirstUnHandledFlow(applyId);

            if (applyInfo != null && flowInfo != null)
            {
                #region 计算处理用时

                string last_time = applyInfo.ProcTime;
                if (string.IsNullOrEmpty(last_time))
                {
                    last_time = applyInfo.Edittime.ToString("yyyy-MM-dd HH:mm:ss");
                }
                long deltatime = (long)DateTime.Now.Subtract(Convert.ToDateTime(last_time)).TotalSeconds;

                #endregion

                int is_auth = BLLFactory <ApplyUser> .Instance.GetCountByApplyIdAndUserId(applyId, userInfo.ID.ToInt32()) > 0 ? 0 : 1;

                if (applyInfo.ProcType == (int)ProcType.会签)
                {
                    #region 会签处理
                    //更新会签记录
                    BLLFactory <ApplySign> .Instance.UpdateSignInfo(applyId, flowInfo.ID, userInfo.ID.ToInt32(), opinion, is_proc);

                    //判断是否完成会签
                    var signFinished = BLLFactory <ApplySign> .Instance.IsSignFinished(flowInfo.ID);

                    if (signFinished)
                    {
                        //判断是否全部通过会签
                        var signPassed = BLLFactory <ApplySign> .Instance.IsSignPassed(flowInfo.ID);

                        //如果全部会签流程处理完毕
                        var signMessage = signPassed ? "会签通过" : "会签不通过";
                        flowInfo.ProcTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        //在发起人未审批前,会签不完成
                        //flowInfo.IsProc = signPassed ? (int)ApplyStatus.已完成 : (int)ApplyStatus.已退回;
                        flowInfo.MsgSendTo = msgsendto;
                        flowInfo.Deltatime = Convert.ToInt32(deltatime);
                        flowInfo.Opinion   = signMessage;
                        BLLFactory <ApplyFlow> .Instance.Update(flowInfo, flowInfo.ID);

                        //更新流程状态(审批状态,未处理,让发起人审批是否提交)
                        applyInfo.Status   = ApplyStatus.处理中;
                        applyInfo.ProcType = (int)ProcType.审批;
                        BLLFactory <Apply> .Instance.Update(applyInfo, applyId);

                        var applyUserInfo = new ApplyUserInfo(applyId, applyInfo.ProcUser.ToInt32());
                        BLLFactory <ApplyUser> .Instance.Insert(applyUserInfo);

                        //保存申请单日志(系统流程日志)
                        var content = string.Format("该申请在流程环节[{0}][{1}]。", flowInfo.FlowName, signMessage);
                        BLLFactory <ApplyLog> .Instance.AddApplyLog(applyId, userInfo.ID.ToInt32(), content);
                    }
                    #endregion
                }
                //else if(applyInfo.ProcType == (int)ProcType.阅办)
                //{
                //    //阅办处理
                //}
                else
                {
                    #region 更新流程及处理单信息
                    flowInfo.ProcUid   = userInfo.ID.ToInt32();
                    flowInfo.ProcTime  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    flowInfo.IsProc    = is_proc;
                    flowInfo.MsgSendTo = msgsendto;
                    flowInfo.Deltatime = Convert.ToInt32(deltatime);
                    flowInfo.Opinion   = opinion;
                    BLLFactory <ApplyFlow> .Instance.Update(flowInfo, flowInfo.ID);

                    #endregion

                    if (is_proc == (int)ApplyIsProc.拒绝)
                    {
                        #region 拒绝流程

                        //更新流程状态
                        applyInfo.Status   = ApplyStatus.已退回;
                        applyInfo.ProcType = 0;
                        applyInfo.ProcUser = "";
                        BLLFactory <Apply> .Instance.Update(applyInfo, applyId);

                        //拒绝流程后,删除申请单的所有流程用户
                        BLLFactory <ApplyUser> .Instance.DeleteByApplyId(applyId);

                        //保存申请单日志(系统流程日志)
                        string   content  = string.Format("申请单({0})已经被退回", applyInfo.Title);
                        FormInfo formInfo = BLLFactory <Form> .Instance.FindByID(applyInfo.FormId);

                        if (formInfo != null)
                        {
                            content = string.Format("用户ID为 {0},于 {1} 创建的 {2}({3}) 已经被退回。",
                                                    applyInfo.Editor, applyInfo.Edittime, formInfo.FormName, applyInfo.Title);
                        }

                        BLLFactory <ApplyLog> .Instance.AddApplyLog(applyId, userInfo.ID.ToInt32(), content);

                        //"您已经退回了该申请。";
                        #endregion
                    }
                    else
                    {
                        #region 批准流程后续处理
                        //该申请单的下一处理流程
                        ApplyFlowInfo nextFlowInfo = BLLFactory <ApplyFlow> .Instance.GetNextUnHandledFlow(applyId, flowInfo.ID);

                        if (nextFlowInfo != null)
                        {
                            selprocuser = selprocuser.Trim();
                            if (!string.IsNullOrEmpty(selprocuser) && selprocuser != nextFlowInfo.ProcUser)
                            {
                                nextFlowInfo.ProcUser = selprocuser;
                                BLLFactory <ApplyFlow> .Instance.Update(nextFlowInfo, nextFlowInfo.ID);
                            }
                        }

                        //保存申请单日志(系统流程日志)
                        var content = string.Format("在流程环节[{0}]用户批准了申请。", flowInfo.FlowName);
                        BLLFactory <ApplyLog> .Instance.AddApplyLog(applyId, userInfo.ID.ToInt32(), content);

                        #endregion
                    }

                    //更新处理单最后处理时间
                    applyInfo.ProcTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    BLLFactory <Apply> .Instance.Update(applyInfo, applyId);
                }

                #region 记录到流程日志

                var flowLogInfo = new ApplyFlowlogInfo(applyId, flowInfo.FlowName, userInfo.ID.ToInt32(), opinion, applyInfo.ProcType);
                flowLogInfo.FlowId  = flowInfo.ID;
                flowLogInfo.OrderNo = flowInfo.OrderNo;
                BLLFactory <ApplyFlowlog> .Instance.Insert(flowLogInfo);

                #endregion
            }
        }
 public void StartProcessInstance(string WorkflowTypeName, Dictionary <string, object> dicDataFields, ApplyUserInfo ApplyUserInfo)
 {
     try
     {
         K2Client.StartProcessInstance(WorkflowTypeName, dicDataFields, ApplyUserInfo.ToJson());
     }
     catch (Exception e)
     {
         throw new CodeException(e.ToString());
     }
 }