Weightloss surgery is such a drastic solution to a weight problem that you should consider very seriously before you have it performed. It's expensive, painful, and prone to complications, so it's should only be considered if you're dangerously obese -- not just pleasingly plump.
The most common and effective forms of weightloss surgery are restrictive procedures, in which part of the stomach is either closed off or removed so that you can't eat large amounts of food at one time. However, the digestive process still proceeds as normal.