Pcs are directly connected to the switch and modems on one of the pcs which we consider to be the server.
Ok, so what I am gathering from your description is that you are using a server rather than an internet router for your access to the outside world. That's fine, although I would recommend the dedicated box for your internet routing...
In any event, if this server is running a Windows Server version of the operating system, you may consider doing some additional research and testing in enabling the RRAS (routing and remote access) role on this server and allowing RRAS to manage the connections. There are several ways to configure this so that the server could use both connections either both active, or active/passive, etc..
Without specific information about the server, connections, business requirements, etc.. providing the correct guidance is challanging.
Rather than using a server, you could also look into buying an internet router that supports more than one WAN connection and it (just like the server example I gave) would manage the ISP connections automatically.
so this means i will need to install a router for it to work out. I thought there is a software wchich can be installed on the server and it does the auto redial when Internet goes down.
So I am not sure if you understood my last response. In summary, I did indicate that you can do this in either software or with a tradition router. If you want to do this in software, my recommendation was to install the RRAS role on the server operating system. If you are not running a server OS, then you will need to do additional research as to what software is avaiable to manage remote "demand-dial" type connections and routing.
Instead of using a hosting server, you could also look into purchasing a web based wireless router that facilitates more than one WAN relationship and just like the hosting server example I gave would handle the ISP relationships instantly.. . . . . .