Ejemplo n.º 1
0
 protected override void TakeFormAction()
 {
     if (CurrentActivity().CurrAction.FormDataProcessing.IsSaveRequestData)
     {
         var entity = informationRepo.Get(p => p.RequestHeaderId == RequestHeader.Id);
         if (entity == null && WorkflowInstance.Information != null)
         {
             var information = new Information();
             information.RequestHeaderId = RequestHeader.Id;
             information.AdjType         = WorkflowInstance.Information.AdjType;
             information.Remark          = WorkflowInstance.Information.Remark;
             informationRepo.Add(information);
             _dataField.Add("AdjustType", WorkflowInstance.Information.AdjType);
         }
         else
         {
             entity.RequestHeaderId = RequestHeader.Id;
             entity.AdjType         = WorkflowInstance.Information.AdjType;
             entity.Remark          = WorkflowInstance.Information.Remark;
             informationRepo.Update(entity);
             _dataField.Add("AdjustType", WorkflowInstance.Information.AdjType);
         }
         ProcessData(WorkflowInstance.NewOutlines, DataOP.AddNew);
         ProcessData(WorkflowInstance.ModifiedOutlines, DataOP.EDIT);
         ProcessData(WorkflowInstance.DeletedOutlines, DataOP.DEL);
     }
 }
        public InformationDto AddInfomation(InformationDto dto)
        {
            Information    information           = _modelMapper.FromInformationDto(dto);
            Information    created               = _informationRepository.Add(information);
            InformationDto createdInformationDto = _modelMapper.ToInformationDto(created);

            return(createdInformationDto);
        }
Ejemplo n.º 3
0
        protected override void TakeFormAction()
        {
            if (CurrentActivity().CurrAction.FormDataProcessing.IsSaveRequestData)
            {
                var oInformation = informationRepo.Get(p => p.RequestHeaderId == RequestHeader.Id);
                if (oInformation == null)
                {
                    var nInformation = WorkflowInstance.Information;

                    nInformation.JaTechnician    = null;
                    nInformation.RequestHeaderId = RequestHeader.Id;
                    informationRepo.Add(nInformation);
                }
                else
                {
                    oInformation.Instruction = WorkflowInstance.Information.Instruction;
                    oInformation.JaDate      = WorkflowInstance.Information.JaDate;
                    if (CurrentActivity().ActivityName == "ADM Approval" && CurrentActivity().CurrAction.ActionName == "Approved" && string.IsNullOrEmpty(oInformation.ReferenceNumber))
                    {
                        oInformation.ReferenceNumber = GetRefNum();
                    }
                    oInformation.Location     = WorkflowInstance.Information.Location;
                    oInformation.Mode         = WorkflowInstance.Information.Mode;
                    oInformation.Remark       = WorkflowInstance.Information.Remark;
                    oInformation.RequestType  = WorkflowInstance.Information.RequestType;
                    oInformation.SubLocation  = WorkflowInstance.Information.SubLocation;
                    oInformation.TcDesc       = WorkflowInstance.Information.TcDesc;
                    oInformation.WorkType     = WorkflowInstance.Information.WorkType;
                    oInformation.Wrjd         = WorkflowInstance.Information.Wrjd;
                    oInformation.CcdId        = WorkflowInstance.Information.CcdId;
                    oInformation.JaTechnician = WorkflowInstance.Information.JaTechnician;

                    informationRepo.Update(oInformation);
                }
            }
        }