Beispiel #1
0
        public DeleteGPSendingResponseDto DeleteGPSendingMasterAndDetails(DeleteGPSendingRequestDto deleteGPSendingRequestDto)
        {
            DeleteGPSendingResponseDto response = new DeleteGPSendingResponseDto();

            var deleteGPSendingDetailsItems = new List <DeleteGPSendingDetailsCM>();

            var deleteGPSendingCM = new DeleteGPSendingCM();

            foreach (var dcItems in deleteGPSendingRequestDto.DeleteGPSendingDetails)
            {
                var deleteDcDetails = new DeleteGPSendingDetailsCM
                {
                    GPNumber        = dcItems.GPNumber,
                    GPSerialNo      = dcItems.GPSerialNo,
                    UpdatedBy       = new Guid("783F190B-9B66-42AC-920B-E938732C1C01"), //Later needs to be remove
                    UpdatedDateTime = System.DateTime.UtcNow
                };

                deleteGPSendingDetailsItems.Add(deleteDcDetails);
            }

            deleteGPSendingCM.GPNumber                 = deleteGPSendingRequestDto.GPNumber;
            deleteGPSendingCM.IsDeleteFrom             = deleteGPSendingRequestDto.IsDeleteFrom;
            deleteGPSendingCM.DeleteGPSendingDetailsCM = deleteGPSendingDetailsItems;

            gatePassRepository.DeleteGPSendingMasterAndDetails(deleteGPSendingCM);

            return(response);
        }
        public void DeleteGPSendingMasterAndDetails(DeleteGPSendingCM DeleteGPSendingCM)
        {
            using (var connection = new DbConnectionProvider().CreateConnection())
            {
                connection.Open();

                var command = new GPSendingDeleteCommand {
                    Connection = connection
                };
                command.Execute(DeleteGPSendingCM.DeleteGPSendingDetailsCM.ToDataTableWithNull(), DeleteGPSendingCM.GPNumber, DeleteGPSendingCM.IsDeleteFrom);
            }
        }