Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void SaveData()
   {

       try
       {
           if (ddlAction.SelectedValue == "")
           {
               return;
           }
           else
           {
               if (ddlAction.SelectedValue == "Approved")
               {
                   Param();

               }
               if (ddlAction.SelectedValue == "Recheck")
               {
                   Param();
               }
               if (ddlAction.SelectedValue == "Rejected")
               {
                   Param();
               }
            }

           ConManager.CommitTransaction();
           Audit.AuditProcess(Session["USER"].ToString(),"","MachinaryDetails","TERMSHR","","S",ddlAction.SelectedValue.Trim());
           //Audit.AuditProcess(Session["USER"].ToString(), txtAACode.Text.Trim(), "AdvanceAdjustment", "TERMSHR", "Advance Approval", "S", ddlAction.SelectedValue.Trim());
       }
       catch (Exception ex)
       {
           throw ex;
       }
       finally
       {
           ConManager.CloseConnection();
       }

}


what this method returns 0 or null?
Posted
Updated 10-May-13 20:54pm
v2

1 solution

It returns Nothing.

Could u more eloborate whats the issue u r facing?
 
Share this answer
 
Comments
Sumon562 11-May-13 2:56am    
Thanks Mr. Mohammed Hameed. I have mentioned the whole method. Please now describe what
if (ddlAction.SelectedValue == "")
{
return;
}
this portion of method means
Sumon562 11-May-13 2:58am    
Is this portion of method is right?
Mohammed Hameed 11-May-13 3:03am    
It is like 'if no item selected from the dropdown then just return immediately from the method'. (This is to inform the control (compiler) that just exit immediately to the calling code, dont execute the next lines in this method).

And method returns nothing as its return type is void.

Note: Default value for selectedvalue is empty string ("").
Mohammed Hameed 11-May-13 3:04am    
Yes it is correct.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900