[SalesForce] Getting null parameter in apex controller from lightning controller

I am not able to pass the parameter from lightning controller to apex controller. In below apex controller "accNo" is null where as in lightning controller I am getting value of accountNumber. Don't know whats wrong in my code. Please help.

Apex Controller

    @AuraEnabled
    public static Banking__c searchAccountApex(String accNo){
       system.debug(accNo);
       Banking__c searchbank = [select Account_Name__c,Balance__c, from banking__c where name = :accNo ];  // Getting accNo null
       return searchbank;
     }

Component

<aura:component controller="Bank_Controller">
<aura:attribute name="AccountNumber" type="String" default=""/>
<aura:attribute name="record" type="Banking__c" default="{'sobjectType':'Banking__c', 'Account_Name__c':'','Deposit_Amount__c':''}"/>
<aura:attribute name="searchResult" type="boolean" default="false" />
<ui:inputNumber label="Account Number" aura:Id="accountNumber1" value="{!v.AccountNumber}" class="Account_Number__c"  />
<ui:button label="search" press="{!c.searchAccount}" /> <br></br>
<aura:if isTrue="{!v.searchResult}">
    Account Name    : <ui:outputText value="{!v.record.Account_Name__c}"  />  <br></br>
    Account number  : <ui:outputText value="{!v.record.name}" /> <br></br>  
    Account Balance : <ui:outputCurrency value="{!v.record.Balance__c}" />  <br></br>
</aura:if>

JavaScript Controller

({
searchAccount : function(component, event, helper) {
     var accountNumberComponent=component.find("accountNumber1");
    var accountNumber = accountNumberComponent.get("v.value");
    console.log(accountNumber);    // getting account number using component.find method
    console.log(component.get("v.AccountNumber"));     // getting account number directly from accoountNumber Attributr
    var action = component.get("c.searchAccountApex");
    action.setParams({
        accNo : component.get("v.AccountNumber")    // Here when if I pass "AccountNumber" attribute, it is not getting passed. getting null in apex controller. 
    });
    action.setCallback(this,function(response){
        if(response.getState()==="SUCCESS"){
            component.set("v.record",response.getReturnValue());
            component.set("v.searchResult",true);

        } 
    });
    $A.enqueueAction(action);

}
})

Best Answer

Its very strange, I created a new component and copied code from old component and now its working. I think problem was something else, not in the code. Thank You guys for your help. I really appreciate.