예제 #1
0
        private void CloseITForm(ProcInst workListItem, TicketActivity activity)
        {
            var formService = new ItRequestFormService();
            var itParam     = new Domain.Entities.BatchData.ItRequestWorkflowInstance()
            {
                RequestHeaderId = workListItem.RequestHeaderId,
                Activity        = "IT Implementation",
                Action          = "Done",
                Comment         = GetPlainTextFromHtml(activity.Description),
                SerialNo        = workListItem.Serial,
                CurrentUser     = loginUsr.loginName,
                loginName       = loginUsr.loginName,
                fullName        = loginUsr.fullName,
                Requestor       = new Domain.Entities.Employee
                {
                    Id = loginUsr.id
                },
                AddUploadFiles = new List <Domain.Entities.FileAttachement>(),
                DelUploadFiles = new List <Domain.Entities.FileAttachement>(),
                UploadFiles    = new List <Domain.Entities.FileAttachement>()
            };
            var errorMsg = string.Empty;

            try
            {
                formService.TakeAction(itParam);
            }
            catch (Exception e)
            {
                errorMsg = e.Message;
                logger.Error(e);
            }
        }
예제 #2
0
        public ProcInst GetProcInstBySerial(string serialNumber)
        {
            string[] serials  = serialNumber.Split('_');
            var      K2WLItem = GetProcInst(Convert.ToInt16(serials[0]), Convert.ToInt16(serials[1]));

            if (K2WLItem == null)
            {
                return(null);
            }

            var procInst = new ProcInst()
            {
                ActivityName  = K2WLItem.ActivityInstanceDestination.Name,
                Serial        = K2WLItem.SerialNumber,
                AllocatedUser = K2WLItem.AllocatedUser,
                Folio         = K2WLItem.ProcessInstance.Folio,
                OpenedBy      = K2WLItem.AllocatedUser,
                Status        = K2WLItem.Status.ToString(),
                OpenFormUrl   = K2WLItem.Data,
                ProcInstId    = K2WLItem.ProcessInstance.ID
            };

            foreach (Action action in K2WLItem.Actions)
            {
                procInst.Actions.Add(action.Name);
            }

            return(procInst);
        }
예제 #3
0
        public ProcInst OpenWorklistItem(string serialNo)
        {
            var procInst = new ProcInst();

            using (var client = new K2Client(_currentUser))
            {
                procInst = client.GetProcInstBySerial(serialNo);
            }
            return(procInst);
        }
예제 #4
0
        public ProcInst OpenWorklistItem(int proctInstId)
        {
            var procInst = new ProcInst();

            using (var client = new K2Client(_currentUser))
            {
                procInst = client.GetProcInstById(proctInstId);
            }
            return(procInst);
        }
 public ProcInst GetProcInst(int loginId)
 {
     ProcInst procInst = new ProcInst();
     using (var edm = new DianPingK2ServerLogContext())
     {
         procInst = edm.ProcInst.AsQueryable()
             .Where(_ => _.ID == loginId).FirstOrDefault();
     }
     return procInst;
 }
        public ProcInst GetProcInst(int loginId)
        {
            ProcInst procInst = new ProcInst();

            using (var edm = new DianPingK2ServerLogContext())
            {
                procInst = edm.ProcInst.AsQueryable()
                           .Where(_ => _.ID == loginId).FirstOrDefault();
            }
            return(procInst);
        }