/// <summary>
 /// 更新存放由用户指定的下一步处理人{存放由用户指定的下一步处理人}对象(即:一条记录
 /// </summary>
 public int Update(InstanceStepNextstepUser instanceStepNextstepUser)
 {
     using (var dbContext = UnitOfWork.Get(Unity.ContainerName))
     {
         return(new InstanceStepNextstepUserRepository(dbContext).Update(instanceStepNextstepUser));
     }
 }
예제 #2
0
        protected R <string> SaveNextUsers(DealStepDTO dto, InstanceFlow AInstanceFlow, InstanceStepDTO AInstanceStep)
        {
            R <string> vResMsg = new R <string>();

            vResMsg.Code = 1;
            //如果是空,则以正确方式结束
            if (dto.NextUserList == null || dto.NextUserList.Count <= 0)
            {
                return(vResMsg);
            }

            //删除步骤下已存在的下一步处理人信息
            vResMsg = RemoveNextUsers(AInstanceStep);
            if (vResMsg.Code != 0)
            {
                return(vResMsg);
            }

            //加入下一步处理人信息
            foreach (USERINFO vUser in dto.NextUserList)
            {
                if (AInstanceStep.InstanceStep.InstanceStepNextstepUsers.Exists(AItem => AItem.UserCode.Equals(vUser.UserCode)))
                {
                    continue;
                }

                InstanceStepNextstepUser vNextStepUser = new InstanceStepNextstepUser();
                vNextStepUser.Fid            = Guid.NewGuid().ToString();
                vNextStepUser.InstanceStepId = AInstanceStep.InstanceStep.Fid;
                vNextStepUser.UserCode       = vUser.UserCode;
                vNextStepUser.UserType       = vUser.UserType;
                vNextStepUser.Creator        = dto.UserCode;
                vNextStepUser.CreateDate     = DateTime.Now;
                vNextStepUser.Editor         = vNextStepUser.Creator;
                vNextStepUser.EditDate       = vNextStepUser.CreateDate;

                //vNextStepUser.SetMultiple(false);
                var result = _instanceStepNextstepUserService.Add(vNextStepUser);
                //vResMsg = vNextStepUser.Insert();
                if (result > 1)
                {
                    AInstanceStep.InstanceStep.InstanceStepNextstepUsers.Add(vNextStepUser);
                    vResMsg.Code = 0;
                }
                else
                {
                    break;
                }
            }

            return(vResMsg);
        }
 /// <summary>
 /// 更新存放由用户指定的下一步处理人{存放由用户指定的下一步处理人}对象(即:一条记录
 /// </summary>
 public int Update(InstanceStepNextstepUser instanceStepNextstepUser)
 {
     return(Update <InstanceStepNextstepUser>(instanceStepNextstepUser));
 }
 /// <summary>
 /// 添加存放由用户指定的下一步处理人{存放由用户指定的下一步处理人}对象(即:一条记录
 /// </summary>
 public long Add(InstanceStepNextstepUser instanceStepNextstepUser)
 {
     return(Add <InstanceStepNextstepUser>(instanceStepNextstepUser));
 }