Exemplo n.º 1
0
        public override string Edit()
        {
            var taskUrl = string.Format("/Renewal/Main#/GBMemo?projectId={0}", ProjectId);

            using (var scope = new TransactionScope())
            {
                var rbdInfo = RenewalInfo.Search(e => e.ProjectId.Equals(ProjectId)).FirstOrDefault();
                if (rbdInfo == null)
                {
                    throw new Exception("Could not find the Renewal Info, please check it!");
                }
                var task = rbdInfo.GenerateTaskWork(WorkflowCode, "Renewal GBMemo", "Renewal GBMemo", taskUrl);
                task.ActivityName = NodeCode.Start;
                task.ActionName   = SetTaskActionName(ProjectId);
                TaskWork.Add(task);
                CompleteNotifyTask(ProjectId);
                AttachmentsMemoProcessInfo.UpdateNotifyDate(ProjectId, FlowCode.GBMemo, false);
                IsHistory = true;
                Update(this);

                Mapper.CreateMap <RenewalGBMemo, RenewalGBMemo>();
                var entity = Mapper.Map <RenewalGBMemo>(this);
                entity.Id         = Guid.Empty;
                entity.ProcInstID = null;
                entity.IsHistory  = false;
                entity.Comments   = null;
                entity.Save("Edit");

                CopyAppUsers(Id.ToString(), entity.Id.ToString());

                scope.Complete();
            }
            return(taskUrl);
        }
Exemplo n.º 2
0
        public static void Submit(ReopenMemo memo)
        {
            string strFlowCode      = "";
            string strInputNodeCode = "";
            string strSendNodeCode  = "";
            string strTypeCode      = "";

            if (memo.ProjectId.ToLower().IndexOf("rebuild") != -1)
            {
                strFlowCode      = FlowCode.Rebuild;
                strInputNodeCode = NodeCode.Rebuild_ReopenMemo_Input;
                strSendNodeCode  = NodeCode.Rebuild_ReopenMemo_Send;
                strTypeCode      = FlowCode.Rebuild_ReopenMemo;
            }
            else if (memo.ProjectId.ToLower().IndexOf("reimage") != -1)
            {
                strFlowCode      = FlowCode.Reimage;
                strInputNodeCode = NodeCode.Reimage_ReopenMemo_Input;
                strSendNodeCode  = NodeCode.Reimage_ReopenMemo_SendMemo;
                strTypeCode      = FlowCode.Reimage_ReopenMemo;
            }
            using (var scope = new TransactionScope())
            {
                SaveReopenMemo(memo);
                if (memo.ProjectId.ToLower().IndexOf("rebuild") != -1 ||
                    memo.ProjectId.ToLower().IndexOf("reimage") != -1)
                {
                    var task = TaskWork.GetTaskWork(memo.ProjectId, ClientCookie.UserCode, TaskWorkStatus.UnFinish, strFlowCode, strTypeCode);
                    if (task != null)
                    {
                        task.Status       = TaskWorkStatus.K2ProcessApproved;
                        task.ActivityName = "Finish";
                        task.FinishTime   = DateTime.Now;
                        string taskUrl = "/" + strFlowCode + "/Main#/ReopenMemo/Process/View?projectId=" + memo.ProjectId;
                        task.Url = taskUrl;
                        TaskWork.Update(task);
                        ProjectInfo.FinishNode(memo.ProjectId, strTypeCode, strInputNodeCode);
                        ProjectInfo.FinishNode(memo.ProjectId, strTypeCode, strSendNodeCode);
                        ProjectInfo.CompleteMainIfEnable(memo.ProjectId);
                    }
                }
                else
                {
                    AttachmentsMemoProcessInfo.UpdateNotifyDate(memo.ProjectId, FlowCode.ReopenMemo);
                }
                scope.Complete();
            }
        }
Exemplo n.º 3
0
 public void CreateAttachmentsMemo()
 {
     AttachmentsMemoProcessInfo.CreateAttachmentsMemoProcessInfo(ProjectId, FlowCode.ClosureMemo, FlowCode.MajorLease, USCode);
     AttachmentsMemoProcessInfo.CreateAttachmentsMemoProcessInfo(ProjectId, FlowCode.GBMemo, FlowCode.MajorLease, USCode);
     AttachmentsMemoProcessInfo.CreateAttachmentsMemoProcessInfo(ProjectId, FlowCode.ReopenMemo, FlowCode.MajorLease, USCode);
 }
Exemplo n.º 4
0
        public void Submit()
        {
            string strFlowCode = FlowCode.TempClosure;
            string strNodeCode = NodeCode.Finish;
            string strTypeCode = FlowCode.TempClosure_ClosureMemo;

            if (ProjectId.ToLower().IndexOf("rebuild") != -1)
            {
                strFlowCode = FlowCode.Rebuild;
                //strNodeCode = NodeCode.Finish;
                strTypeCode = FlowCode.Rebuild_TempClosureMemo;
            }
            else if (ProjectId.ToLower().IndexOf("reimage") != -1)
            {
                strFlowCode = FlowCode.Reimage;
                //strNodeCode = NodeCode.Finish;
                strTypeCode = FlowCode.Reimage_TempClosureMemo;
            }
            using (var scope = new TransactionScope())
            {
                Save();
                if (ProjectId.ToLower().IndexOf("majorlease") != -1 ||
                    ProjectId.ToLower().IndexOf("renewal") != -1)
                {
                    AttachmentsMemoProcessInfo.UpdateNotifyDate(ProjectId, FlowCode.ClosureMemo);
                }
                else
                {
                    var task = TaskWork.GetTaskWork(ProjectId, ClientCookie.UserCode, TaskWorkStatus.UnFinish, strFlowCode, strTypeCode);
                    if (task != null)
                    {
                        task.Status       = TaskWorkStatus.K2ProcessApproved;
                        task.ActivityName = "Finish";
                        string taskUrl = "/" + strFlowCode + "/Main#/ClosureMemo/Process/View?projectId=" + ProjectId;
                        if (ProjectId.ToLower().IndexOf("rebuild") != -1 ||
                            ProjectId.ToLower().IndexOf("reimage") != -1)
                        {
                            taskUrl = "/" + strFlowCode + "/Main#/TempClosureMemo/Process/View?projectId=" + ProjectId;
                        }
                        task.Url        = taskUrl;
                        task.FinishTime = DateTime.Now;
                        TaskWork.Update(task);
                        if (ProjectId.ToLower().IndexOf("rebuild") != -1)
                        {
                            ProjectInfo.FinishNode(ProjectId, strTypeCode, NodeCode.Rebuild_TempClosureMemo_Input);
                            ProjectInfo.FinishNode(ProjectId, strTypeCode, NodeCode.Rebuild_TempClosureMemo_Send, ProjectStatus.Finished);
                        }
                        else if (ProjectId.ToLower().IndexOf("reimage") != -1)
                        {
                            ProjectInfo.FinishNode(ProjectId, strTypeCode, NodeCode.Reimage_TempClosureMemo_Input);
                            ProjectInfo.FinishNode(ProjectId, strTypeCode, NodeCode.Reimage_TempClosureMemo_Send, ProjectStatus.Finished);
                        }
                        else
                        {
                            //TempClosure
                            ProjectInfo.FinishNode(ProjectId, strTypeCode, NodeCode.TempClosure_ClosureMemo_Input);
                            ProjectInfo.FinishNode(ProjectId, strTypeCode, NodeCode.TempClosure_ClosureMemo_Send, ProjectStatus.Finished);
                        }
                        ProjectInfo.CompleteMainIfEnable(ProjectId);
                    }
                }
                scope.Complete();
            }
        }