public class SelectMedicalInstitutionAddController {
|
@AuraEnabled
|
public static Rental_Apply__c SelectRentalApply(String RentalApplyId){
|
Rental_Apply__c RentalApply= new Rental_Apply__c();
|
List<Rental_Apply__c> RentalApplyList = [select Id,
|
Medical_Institution_Address_sup__c,
|
direct_shippment_address__c,
|
Medical_Institution_Address__c,
|
direct_send__c,
|
Sparepartsdeliveryaddress__c,
|
detailedAddress__c,
|
Hospital__c,
|
Hospital__r.State_Master__r.Name,
|
Hospital__r.City_Master__r.Name,
|
Hospital__r.Sparepartsdeliveryaddress1__c,
|
Hospital__r.Sparepartsdeliveryaddress2__c,
|
Hospital__r.Sparepartsdeliveryaddress3__c,
|
Hospital__r.Sparepartsdeliveryaddress4__c,
|
Hospital__r.Sparepartsdeliveryaddress5__c,
|
Hospital__r.Sparepartsdeliveryaddress6__c,
|
Hospital__r.Sparepartsdeliveryaddress7__c,
|
Hospital__r.Sparepartsdeliveryaddress8__c,
|
Hospital__r.Sparepartsdeliveryaddress9__c,
|
Hospital__r.Sparepartsdeliveryaddress10__c
|
from Rental_Apply__c where Id =: RentalApplyId];
|
if(RentalApplyList.size()>0){
|
RentalApply = RentalApplyList[0];
|
}
|
return RentalApply;
|
}
|
@AuraEnabled
|
public static String saveAllDatas(String RentalApplyjson){
|
Savepoint sp = Database.setSavepoint();
|
try {
|
Rental_Apply__c RentalApplyobj = (Rental_Apply__c)JSON.deserialize(RentalApplyjson,Rental_Apply__c.class);
|
Rental_Apply__c addRentalApply = new Rental_Apply__c();
|
addRentalApply.Id = RentalApplyobj.Id;
|
addRentalApply.Medical_Institution_Address_sup__c = RentalApplyobj.Medical_Institution_Address_sup__c;
|
addRentalApply.Medical_Institution_Address__c = RentalApplyobj.Medical_Institution_Address__c;
|
addRentalApply.Sparepartsdeliveryaddress__c = RentalApplyobj.Sparepartsdeliveryaddress__c;
|
addRentalApply.detailedAddress__c = RentalApplyobj.detailedAddress__c;
|
update addRentalApply;
|
return 'success';
|
} catch (Exception e) {
|
Database.rollback(sp);
|
return e.getMessage();
|
}
|
}
|
|
}
|