/// <summary>
 /// 返回一个model
 /// </summary>
 /// <returns></returns>
 public FineOffice.Modules.OA_FlowRunProcess GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.OA_FlowRunProcess, bool> > expression)
 {
     dal.Initialization();
     FineOffice.Modules.OA_FlowRunProcess model =
         (from entity in dal.GetListAll()
          select new FineOffice.Modules.OA_FlowRunProcess
     {
         AcceptID = entity.AcceptID,
         AcceptTime = entity.AcceptTime,
         HandleTime = entity.HandleTime,
         ID = entity.ID,
         Pattern = entity.Pattern,
         PreviousID = entity.PreviousID,
         ProcessID = entity.ProcessID,
         Remark = entity.Remark,
         RunID = entity.RunID,
         SendID = entity.SendID,
         IsEntrance = entity.IsEntrance,
         State = entity.State,
         Next = entity.OA_FlowProcess.Next,
         IsStart = entity.OA_FlowProcess.IsStart,
         TransmitAdvice = entity.TransmitAdvice,
         Version = entity.Version.ToArray(),
         ProcessName = entity.OA_FlowProcess.ProcessName,
         WorkName = entity.OA_FlowRun.WorkName,
         WorkNO = entity.OA_FlowRun.WorkNO,
         CreateName = entity.OA_FlowRun.HR_Personnel.Name,
         WorkCreateTime = entity.OA_FlowRun.CreateTime,
     }).Where(expression).FirstOrDefault();
     dal.Dispose();
     return(model);
 }
示例#2
0
        /// <summary>
        /// 增加
        /// </summary>
        public FineOffice.Modules.OA_FlowRun Add(FineOffice.Modules.OA_FlowRun model)
        {
            dal.Initialization();
            FineOffice.Entity.OA_FlowRun entity = new Entity.OA_FlowRun
            {
                CreateTime = model.CreateTime,
                Creator    = model.Creator,
                FlowID     = model.FlowID,
                ID         = model.ID,
                WorkNO     = model.WorkNO,
                State      = model.State,
                Remark     = model.Remark,
                WorkName   = model.WorkName
            };

            for (int i = 0; i < model.OA_FlowRunProcessList.Count; i++)
            {
                FineOffice.Modules.OA_FlowRunProcess f          = model.OA_FlowRunProcessList[i];
                FineOffice.Entity.OA_FlowRunProcess  runProcess = new Entity.OA_FlowRunProcess
                {
                    ID             = f.ID,
                    ProcessID      = f.ProcessID,
                    Remark         = f.Remark,
                    AcceptID       = f.AcceptID,
                    AcceptTime     = f.AcceptTime,
                    HandleTime     = f.HandleTime,
                    Pattern        = f.Pattern,
                    IsEntrance     = f.IsEntrance,
                    PreviousID     = f.PreviousID,
                    SendID         = f.SendID,
                    Version        = f.Version,
                    TransmitAdvice = f.TransmitAdvice,
                    RunID          = f.RunID,
                    State          = f.State
                };
                entity.OA_FlowRunProcess.Add(runProcess);
            }
            dal.Add(entity);
            dal.Dispose();
            return(this.GetModel(f => f.ID == entity.ID));
        }
 /// <summary>
 /// 修改
 /// </summary>
 public FineOffice.Modules.OA_FlowRunProcess Update(FineOffice.Modules.OA_FlowRunProcess model)
 {
     dal.Initialization();
     FineOffice.Entity.OA_FlowRunProcess entity = new Entity.OA_FlowRunProcess
     {
         AcceptID       = model.AcceptID,
         AcceptTime     = model.AcceptTime,
         HandleTime     = model.HandleTime,
         ID             = model.ID,
         Pattern        = model.Pattern,
         PreviousID     = model.PreviousID,
         ProcessID      = model.ProcessID,
         Remark         = model.Remark,
         RunID          = model.RunID,
         IsEntrance     = model.IsEntrance,
         SendID         = model.SendID,
         State          = model.State,
         TransmitAdvice = model.TransmitAdvice,
         Version        = model.Version,
     };
     dal.Update(entity);
     dal.Dispose();
     return(this.GetModel(p => p.ID == model.ID));
 }