Esempio n. 1
0
        /// <summary>
        /// 更新处理意见
        /// </summary>
        /// <param name="upFlowOperate"></param>
        public static void UpdateFlowOperateOpinion(Model.ProjectData_FlowOperate flowOperate)
        {
            Model.SUBHSSEDB db            = Funs.DB;
            var             upFlowOperate = from x in db.ProjectData_FlowOperate
                                            where x.MenuId == flowOperate.MenuId && x.DataId == flowOperate.DataId && (x.IsClosed == false || !x.IsClosed.HasValue)
                                            select x;

            if (upFlowOperate.Count() > 0)
            {
                foreach (var item in upFlowOperate)
                {
                    item.OperaterId   = flowOperate.OperaterId;
                    item.OperaterTime = flowOperate.OperaterTime;
                    item.State        = flowOperate.State;
                    item.Opinion      = flowOperate.Opinion;
                    item.IsClosed     = flowOperate.IsClosed;
                    Funs.DB.SubmitChanges();
                }
            }
            else
            {
                Model.ProjectData_FlowOperate newFlowOperate = new Model.ProjectData_FlowOperate
                {
                    MenuId       = flowOperate.MenuId,
                    DataId       = flowOperate.DataId,
                    OperaterId   = flowOperate.OperaterId,
                    OperaterTime = flowOperate.OperaterTime,
                    State        = flowOperate.State,
                    Opinion      = flowOperate.Opinion,
                    IsClosed     = flowOperate.IsClosed
                };
                AddProjectData_FlowOperate(newFlowOperate);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 删除项目单据流程
 /// </summary>
 /// <param name="flowSetId"></param>
 public static void DeleteFlowSetByFlowSetId(string flowSetId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.ProjectData_FlowOperate flowSet = db.ProjectData_FlowOperate.FirstOrDefault(e => e.FlowOperateId == flowSetId);
     if (flowSet != null)
     {
         db.ProjectData_FlowOperate.DeleteOnSubmit(flowSet);
         db.SubmitChanges();
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 根据菜单id和步骤序号得到下一个流程
        /// </summary>
        /// <param name="menuId"></param>
        /// <param name="sortIndex"></param>
        /// <returns></returns>
        public static Model.ProjectData_FlowOperate GetNextProjectData_FlowOperate(string dataId)
        {
            Model.ProjectData_FlowOperate flowSet = new Model.ProjectData_FlowOperate();
            var flowSets = from x in Funs.DB.ProjectData_FlowOperate
                           where x.DataId == dataId && (!x.IsClosed.HasValue || x.IsClosed == false)
                           orderby x.SortIndex
                           select x;

            if (flowSets.Count() > 0)
            {
                int?index = flowSets.Select(x => x.SortIndex).Min();
                if (index.HasValue)
                {
                    flowSet = flowSets.FirstOrDefault(x => x.SortIndex == index);
                }
            }

            return(flowSet);
        }
Esempio n. 4
0
        /// <summary>
        /// 增加项目单据流程
        /// </summary>
        /// <param name="FlowSetName"></param>
        /// <param name="def"></param>
        public static void AddProjectData_FlowOperate(Model.ProjectData_FlowOperate flowSet)
        {
            Model.SUBHSSEDB db = Funs.DB;
            Model.ProjectData_FlowOperate newFlowOperate = new ProjectData_FlowOperate
            {
                FlowOperateId = SQLHelper.GetNewID(typeof(Model.ProjectData_FlowOperate)),
                MenuId        = flowSet.MenuId,
                DataId        = flowSet.DataId
            };
            int newSortIndex = getFlowSetMaxSortIndexByMenuId(flowSet.MenuId, flowSet.DataId);

            newFlowOperate.SortIndex    = newSortIndex;
            newFlowOperate.OperaterId   = flowSet.OperaterId;
            newFlowOperate.OperaterTime = flowSet.OperaterTime;
            newFlowOperate.State        = flowSet.State;
            newFlowOperate.Opinion      = flowSet.Opinion;
            newFlowOperate.IsClosed     = flowSet.IsClosed;
            db.ProjectData_FlowOperate.InsertOnSubmit(newFlowOperate);
            db.SubmitChanges();
        }