| | |
| | | mpdTest1.mpdDetailsRecords[3].mpded.Intra_Trade_Gurantee_RMB__c = 7500.00 ; |
| | | mpdTest1.mpdDetailsRecords[3].mpded.Maintenance_Price_Year__c = 7000.00; |
| | | mpdTest1.UpdateSave(); |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = mpdTest1.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert att; |
| | | ContentVersion version = new ContentVersion(); |
| | | version.Title = '123'; |
| | | version.VersionData = EncodingUtil.base64Decode('test'); |
| | | version.ContentLocation = 's'; |
| | | version.PathOnClient = '123.txt'; |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = mpdTest1.Id; |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | // Attachment att = new Attachment( |
| | | // Name = 'test', |
| | | // ParentId = mpdTest1.Id, |
| | | // Body = EncodingUtil.base64Decode('test') |
| | | // ); |
| | | // insert att; |
| | | //system.assertEquals(1,mList.size()); |
| | | if(mList.size()>0){ |
| | | mList[0].Status__c = '审批中-服务'; |
| | |
| | | //mpdTest1.UpdateSave(); |
| | | List<Maintenance_Product_Data__c> mListEdit = [SELECT Id,Status__c,Name,RecordTypeId, RecordType.Name,RecordType.DeveloperName |
| | | FROM Maintenance_Product_Data__c where id = :mpdTest1.id]; |
| | | Attachment att = new Attachment( |
| | | Name = 'test11', |
| | | ParentId = mListEdit[0].Id, |
| | | Body = EncodingUtil.base64Decode('test11') |
| | | ); |
| | | insert att; |
| | | ContentVersion version = new ContentVersion(); |
| | | version.Title = '123'; |
| | | version.VersionData = EncodingUtil.base64Decode('test11'); |
| | | version.ContentLocation = 's'; |
| | | version.PathOnClient = '123.txt'; |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = mListEdit[0].Id; |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | // Attachment att = new Attachment( |
| | | // Name = 'test11', |
| | | // ParentId = mListEdit[0].Id, |
| | | // Body = EncodingUtil.base64Decode('test11') |
| | | // ); |
| | | // insert att; |
| | | mpdTest1.init(); |
| | | mpdTest1.UpdateSave(); |
| | | mpdTest1.Submitmpd(); |
| | |
| | | MaintenanceProductDataController mpdTest1 = new MaintenanceProductDataController(new ApexPages.StandardController(m)); |
| | | List<Maintenance_Product_Data__c> mListEdit = [SELECT Id,Status__c,Name,RecordTypeId, RecordType.Name,RecordType.DeveloperName |
| | | FROM Maintenance_Product_Data__c where id = :mpdTest1.id]; |
| | | Attachment att = new Attachment( |
| | | Name = 'test11', |
| | | ParentId = mListEdit[0].Id, |
| | | Body = EncodingUtil.base64Decode('test11') |
| | | ); |
| | | insert att; |
| | | ContentVersion version = new ContentVersion(); |
| | | version.Title = '123'; |
| | | version.VersionData = EncodingUtil.base64Decode('test11'); |
| | | version.ContentLocation = 's'; |
| | | version.PathOnClient = '123.txt'; |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = mListEdit[0].Id; |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | // Attachment att = new Attachment( |
| | | // Name = 'test11', |
| | | // ParentId = mListEdit[0].Id, |
| | | // Body = EncodingUtil.base64Decode('test11') |
| | | // ); |
| | | // insert att; |
| | | mpdTest1.init(); |
| | | mpdTest1.UpdateSave(); |
| | | mpdTest1.Submitmpd(); |