Esempio n. 1
0
 /// <summary>
 /// 修改
 /// </summary>
 public FineOffice.Modules.OA_FlowRun Update(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,
     };
     dal.Update(entity);
     dal.Dispose();
     return(null);
 }
Esempio n. 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));
        }
Esempio n. 3
0
 /// <summary>
 /// 返回一个model
 /// </summary>
 /// <returns></returns>
 public FineOffice.Modules.OA_FlowRun GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.OA_FlowRun, bool> > expression)
 {
     dal.Initialization();
     FineOffice.Modules.OA_FlowRun model =
         (from entity in dal.GetListAll()
          select new FineOffice.Modules.OA_FlowRun
     {
         CreateTime = entity.CreateTime,
         Creator = entity.Creator,
         FlowID = entity.FlowID,
         ID = entity.ID,
         WorkNO = entity.WorkNO,
         State = entity.State,
         Remark = entity.Remark,
         WorkName = entity.WorkName,
         OA_FlowRunProcessList = (from s in entity.OA_FlowRunProcess
                                  select new FineOffice.Modules.OA_FlowRunProcess
         {
             ID = s.ID,
             ProcessID = s.ProcessID,
             Remark = s.Remark,
             AcceptID = s.AcceptID,
             AcceptTime = s.AcceptTime,
             HandleTime = s.HandleTime,
             Pattern = s.Pattern,
             PreviousID = s.PreviousID,
             SendID = s.SendID,
             IsEntrance = s.IsEntrance,
             Version = s.Version.ToArray(),
             TransmitAdvice = s.TransmitAdvice,
             RunID = s.RunID,
             State = s.State
         }).ToTrackingList(),
     }).Where(expression).FirstOrDefault();
     dal.Dispose();
     return(model);
 }