private void setModeDependentLayout() { lblTitle.Text = Resources.GetString(mode.ToString()); switch (mode) { case MODE.StockMovement: { lblNewStock.Visible = false; txtNewStock.Visible = false; lblNewStockUOM.Visible = false; lblCostPlace.Visible = true; ddlCostPlace.Visible = true; lblAmount.Visible = true; txtAmount.Visible = true; lblAmountUOM.Visible = true; ddlCostPlace.DataSource = service.GetCostPlaces(); ddlCostPlace.ValueMember = "Id"; ddlCostPlace.DisplayMember = "Name"; break; } case MODE.StockCount: { lblNewStock.Visible = true; txtNewStock.Visible = true; lblNewStockUOM.Visible = true; lblCostPlace.Visible = false; ddlCostPlace.Visible = false; lblAmount.Visible = false; txtAmount.Visible = false; lblAmountUOM.Visible = false; break; } } }