示例#1
0
 /// <summary>
 /// 修改流程
 /// </summary>
 public FineOffice.Modules.OA_Flow Update(FineOffice.Modules.OA_Flow model)
 {
     dal.Initialization();
     FineOffice.Entity.OA_Flow entity = new Entity.OA_Flow
     {
         ID              = model.ID,
         FlowNO          = model.FlowNO,
         FlowName        = model.FlowName,
         PinyinCode      = model.PinyinCode,
         AllowAttachment = model.AllowAttachment,
         Creator         = model.Creator,
         FlowDesc        = model.FlowDesc,
         SortID          = model.SortID,
         IsFreedom       = model.IsFreedom,
         Stop            = model.Stop,
         AllowRecall     = model.AllowRecall,
         AllowRevoke     = model.AllowRevoke,
         FormID          = model.FormID,
         Version         = model.Version,
         Remark          = model.Remark,
         XML             = model.XML,
         CreateDate      = model.CreateDate,
     };
     entity.OA_FlowAuthority.AddRange(from temp in model.OA_FlowAuthorityList
                                      select new FineOffice.Entity.OA_FlowAuthority
     {
         ID           = temp.ID,
         PersonnelID  = temp.PersonnelID,
         DepartmentID = temp.DepartmentID,
         FlowID       = temp.FlowID,
     });
     dal.Update(entity);
     dal.Dispose();
     return(null);
 }
示例#2
0
 public void Delete(Modules.OA_Flow model)
 {
     dal.Initialization();
     FineOffice.Entity.OA_Flow entity = new Entity.OA_Flow
     {
         ID = model.ID,
     };
     dal.Delete(entity);
     dal.Dispose();
 }
示例#3
0
 /// <summary>
 /// 更改流程明细列表
 /// </summary>
 public FineOffice.Modules.OA_Flow UpdateProcess(FineOffice.Modules.OA_Flow model)
 {
     FineOffice.Entity.OA_Flow entity = new Entity.OA_Flow
     {
         ID              = model.ID,
         FlowNO          = model.FlowNO,
         FlowName        = model.FlowName,
         PinyinCode      = model.PinyinCode,
         AllowAttachment = model.AllowAttachment,
         Creator         = model.Creator,
         FlowDesc        = model.FlowDesc,
         SortID          = model.SortID,
         AllowRecall     = model.AllowRecall,
         AllowRevoke     = model.AllowRevoke,
         FormID          = model.FormID,
         IsFreedom       = model.IsFreedom,
         Stop            = model.Stop,
         Version         = model.Version,
         Remark          = model.Remark,
         XML             = model.XML,
         CreateDate      = model.CreateDate,
     };
     entity.OA_FlowProcess.AddRange(from temp in model.OA_FlowProcessList
                                    select new FineOffice.Entity.OA_FlowProcess
     {
         AllowGoBack       = temp.AllowGoBack,
         AllowRefuse       = temp.AllowRefuse,
         Remind            = temp.Remind,
         TimeLimit         = temp.TimeLimit,
         AllowSync         = temp.AllowSync,
         Feedback          = temp.Feedback,
         FlowID            = temp.FlowID,
         ID                = temp.ID,
         Version           = temp.Version,
         IsEnd             = temp.IsEnd,
         IsStart           = temp.IsStart,
         MailTo            = temp.MailTo,
         MessageTo         = temp.MessageTo,
         Next              = temp.Next,
         ProcessDepartment = temp.ProcessDepartment,
         ProcessPersonnel  = temp.ProcessPersonnel,
         ProcessName       = temp.ProcessName,
         Remark            = temp.Remark,
         ProcessRole       = temp.ProcessRole,
         Serial            = temp.Serial,
         TopDefault        = temp.TopDefault
     });
     dal.UpdateProcess(entity);
     return(null);
 }
示例#4
0
        public override void Delete(Entity.OA_Flow entity)
        {
            List <CommandInfo> transation = new List <CommandInfo>();

            SqlParameter[] flowAuthority = { new SqlParameter("@FlowID", SqlDbType.Int, 4) };
            flowAuthority[0].Value = entity.ID;

            CommandInfo flowAuthorityInfo = new CommandInfo("delete from OA_FlowAuthority where FlowID=@FlowID", flowAuthority);

            transation.Add(flowAuthorityInfo);

            SqlParameter[] deleteParam = { new SqlParameter("@ID", SqlDbType.Int, 4) };
            deleteParam[0].Value = entity.ID;
            CommandInfo deleteInfo = new CommandInfo("delete from OA_Flow where ID=@ID", deleteParam);

            transation.Add(deleteInfo);
            DbHelperSQL.ExecuteSqlTran(transation);
        }
示例#5
0
        public override Entity.OA_Flow Update(Entity.OA_Flow entity)
        {
            using (DataContext cxt = ContextFactory.CreateContext())
            {
                Table <FineOffice.Entity.OA_Flow>          flow          = cxt.GetTable <FineOffice.Entity.OA_Flow>();
                Table <FineOffice.Entity.OA_FlowAuthority> flowAuthority = cxt.GetTable <FineOffice.Entity.OA_FlowAuthority>();

                try
                {
                    flow.Attach(entity, true);
                    flowAuthority.DeleteAllOnSubmit(flowAuthority.Where(f => f.FlowID == entity.ID));
                    flowAuthority.InsertAllOnSubmit(entity.OA_FlowAuthority);
                    cxt.SubmitChanges();
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
                return(flow.Where(f => f.ID == entity.ID).FirstOrDefault());
            }
        }