public void selectDrawerItem(IMenuItem item)
        {
            Fragment fragment = null;
            string   title    = "";

            if (CurrentFocus != null)
            {
                imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);
            }



            /*if (item.ItemId == Resource.Id.nav_receiving)
             * {
             *  fragment = new ReceiveFragment();
             *
             *  title = Resources.GetString(Resource.String.action_receiving_main);
             *  receiving_main.SetVisible(true);
             *  receiving_record.SetVisible(true);
             *  receiving_board.SetVisible(true);
             *  receiving_multi.SetVisible(true);
             *  shipment_main.SetVisible(false);
             *  shipment_find.SetVisible(false);
             *  allocation_find.SetVisible(false);
             *  allocation_replenishment.SetVisible(false);
             *  allocation_send_msg.SetVisible(false);
             *  allocation_msg.SetVisible(false);
             *  allocation_area_confirm.SetVisible(false);
             *  allocation_direct.SetVisible(false);
             *  entering_warehouse_main.SetVisible(false);
             *  entering_warehouse_find.SetVisible(false);
             *  production_storage_main.SetVisible(false);
             *  production_storage_find.SetVisible(false);
             *  production_storage_scan.SetVisible(false);
             * }
             * else if(item.ItemId == Resource.Id.nav_shipment)
             * {
             *  fragment = new ShipmentFragment();
             *
             *  title = Resources.GetString(Resource.String.action_shipment_main);
             *  receiving_main.SetVisible(false);
             *  receiving_record.SetVisible(false);
             *  receiving_board.SetVisible(false);
             *  receiving_multi.SetVisible(false);
             *  shipment_main.SetVisible(true);
             *  shipment_find.SetVisible(true);
             *  allocation_find.SetVisible(false);
             *  allocation_replenishment.SetVisible(false);
             *  allocation_send_msg.SetVisible(false);
             *  allocation_msg.SetVisible(false);
             *  allocation_area_confirm.SetVisible(false);
             *  allocation_direct.SetVisible(false);
             *  entering_warehouse_main.SetVisible(false);
             *  entering_warehouse_find.SetVisible(false);
             *  production_storage_main.SetVisible(false);
             *  production_storage_find.SetVisible(false);
             *  production_storage_scan.SetVisible(false);
             * }
             * else*/
            if (item.ItemId == Resource.Id.nav_search)
            {
                fragment = new LookupInStockFragment();

                title = Resources.GetString(Resource.String.action_allocation_find);
                searchFilter.SetVisible(false);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }
            else if (item.ItemId == Resource.Id.nav_allocation_send_msg)
            {
                Log.Debug(TAG, "Send msg");
                fragment = new AllocationSendMsgToReserveWarehouseFragment();

                title = Resources.GetString(Resource.String.action_allocation_send_msg_to_reserve);
                searchFilter.SetVisible(false);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(true);
                allocation_replenishment.SetVisible(true);
                allocation_send_msg.SetVisible(true);
                allocation_msg.SetVisible(true);
                allocation_area_confirm.SetVisible(true);
                allocation_direct.SetVisible(true);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }
            else if (item.ItemId == Resource.Id.nav_allocation)
            {
                fragment = new AllocationMsgFragment();

                title = Resources.GetString(Resource.String.action_allocation_msg);
                searchFilter.SetVisible(false);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(true);
                allocation_replenishment.SetVisible(true);
                allocation_send_msg.SetVisible(true);
                allocation_msg.SetVisible(true);
                allocation_area_confirm.SetVisible(true);
                allocation_direct.SetVisible(true);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }
            else if (item.ItemId == Resource.Id.nav_entering_warehouse)
            {
                fragment = new EnteringWarehouseFragment();

                title = Resources.GetString(Resource.String.action_entering_warehouse_main);
                searchFilter.SetVisible(false);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(true);
                entering_warehouse_find.SetVisible(true);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }
            else if (item.ItemId == Resource.Id.nav_production_storage)
            {
                fragment = new ProductionStorageFragment();

                title = Resources.GetString(Resource.String.action_production_storage_main);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(true);
                production_storage_find.SetVisible(true);
                production_storage_scan.SetVisible(true);
            }/*
              * else if (item.ItemId == Resource.Id.nav_receiving_inspection)
              * {
              * fragment = new ReceivingInspectionFragment();
              *
              * title = Resources.GetString(Resource.String.action_receiving_inspection_main);
              * receiving_main.SetVisible(false);
              * receiving_record.SetVisible(false);
              * receiving_board.SetVisible(false);
              * receiving_multi.SetVisible(false);
              * shipment_main.SetVisible(false);
              * shipment_find.SetVisible(false);
              * allocation_find.SetVisible(false);
              * allocation_replenishment.SetVisible(false);
              * allocation_send_msg.SetVisible(false);
              * allocation_msg.SetVisible(false);
              * allocation_area_confirm.SetVisible(false);
              * allocation_direct.SetVisible(false);
              * entering_warehouse_main.SetVisible(false);
              * entering_warehouse_find.SetVisible(false);
              * production_storage_main.SetVisible(false);
              * production_storage_find.SetVisible(false);
              * production_storage_scan.SetVisible(false);
              * }*/
            else if (item.ItemId == Resource.Id.nav_setting)
            {
                fragment = new Settingfragment();

                title = Resources.GetString(Resource.String.action_settings);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }
            else if (item.ItemId == Resource.Id.nav_login)
            {
                fragment = new LoginFragment();

                title = Resources.GetString(Resource.String.nav_login);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }
            else if (item.ItemId == Resource.Id.nav_logout)
            {
                fragment = new LogoutFragment();

                title = Resources.GetString(Resource.String.nav_logout);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);

                Intent intent = new Intent();
                intent.SetAction(Constants.ACTION_LOGOUT_ACTION);
                context.SendBroadcast(intent);
            }
            else
            {
                fragment = new LoginFragment();

                title = Resources.GetString(Resource.String.nav_login);
                receiving_main.SetVisible(false);
                receiving_record.SetVisible(false);
                receiving_board.SetVisible(false);
                receiving_multi.SetVisible(false);
                shipment_main.SetVisible(false);
                shipment_find.SetVisible(false);
                allocation_find.SetVisible(false);
                allocation_replenishment.SetVisible(false);
                allocation_send_msg.SetVisible(false);
                allocation_msg.SetVisible(false);
                allocation_area_confirm.SetVisible(false);
                allocation_direct.SetVisible(false);
                entering_warehouse_main.SetVisible(false);
                entering_warehouse_find.SetVisible(false);
                production_storage_main.SetVisible(false);
                production_storage_find.SetVisible(false);
                production_storage_scan.SetVisible(false);
            }

            FragmentTransaction fragmentTx = this.FragmentManager.BeginTransaction();

            //fragmentTx.Add(Resource.Id.flContent, fragment);
            fragmentTx.Replace(Resource.Id.flContent, fragment);

            fragmentTx.Commit();

            this.Title = title;

            DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            drawer.CloseDrawer(GravityCompat.Start);
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            Fragment fragment = null;
            string   title    = "";
            int      id       = item.ItemId;

            if (id == Resource.Id.action_settings)
            {
                title = Resources.GetString(Resource.String.action_settings);
                return(true);
            }
            //search
            else if (id == Resource.Id.action_shipping_find)
            {
                title    = Resources.GetString(Resource.String.action_shipment_find);
                fragment = new LookupInStockFragment();
            }
            else if (id == Resource.Id.action_allocation_find)
            {
                title    = Resources.GetString(Resource.String.action_allocation_find);
                fragment = new LookupInStockFragment();
            }
            else if (id == Resource.Id.action_entering_warehouse_find)
            {
                title    = Resources.GetString(Resource.String.action_entering_warehouse_find);
                fragment = new LookupInStockFragment();
            }
            else if (id == Resource.Id.action_production_storage_find)
            {
                title    = Resources.GetString(Resource.String.action_production_storage_find);
                fragment = new LookupInStockFragment();
            }
            //receive main fragment
            else if (id == Resource.Id.action_receiving_main)
            {
                title    = Resources.GetString(Resource.String.action_receiving_main);
                fragment = new ReceiveFragment();
            }
            //receive record fragment
            else if (id == Resource.Id.action_receiving_record)
            {
                title    = Resources.GetString(Resource.String.action_receiving_record);
                fragment = new ReceivingRecordFragment();
            }
            //receive board fragment
            else if (id == Resource.Id.action_receiving_board)
            {
                title    = Resources.GetString(Resource.String.action_receiving_board);
                fragment = new ReceivingBoardFragment();
            }
            //receive multi fragment
            else if (id == Resource.Id.action_receiving_multi)
            {
                title    = Resources.GetString(Resource.String.action_receiving_multi);
                fragment = new ReceivingMultiFragment();
            }
            //shipping main
            else if (id == Resource.Id.action_shipping_main)
            {
                title    = Resources.GetString(Resource.String.action_shipment_main);
                fragment = new ShipmentFragment();
            }
            //allocation replenishment
            else if (id == Resource.Id.action_allocation_replenishment)
            {
                title    = Resources.GetString(Resource.String.action_allocation_replenishment);
                fragment = new AllocationReplenishmentFragment();
            }
            //allocation send msg to reserve
            else if (id == Resource.Id.action_allocation_send_msg_to_reserve)
            {
                title    = Resources.GetString(Resource.String.action_allocation_send_msg_to_reserve);
                fragment = new AllocationSendMsgToReserveWarehouseFragment();
            }
            //allocation msg
            else if (id == Resource.Id.action_allocation_msg)
            {
                title    = Resources.GetString(Resource.String.action_allocation_msg);
                fragment = new AllocationMsgFragment();
            }
            //allocation area confirm
            else if (id == Resource.Id.action_allocation_area_confirm)
            {
                title    = Resources.GetString(Resource.String.action_allocation_area_confirm);
                fragment = new AllocationAreaConfirmFragment();
            }
            //allocation direct
            else if (id == Resource.Id.action_allocation_direct)
            {
                title    = Resources.GetString(Resource.String.action_allocation_direct);
                fragment = new AllocationDirectFragment();
            }
            //entering warehouse
            else if (id == Resource.Id.action_entering_warehouse_main)
            {
                title    = Resources.GetString(Resource.String.action_entering_warehouse_main);
                fragment = new EnteringWarehouseFragment();
            }
            //production storage
            else if (id == Resource.Id.action_production_storage_main)
            {
                title    = Resources.GetString(Resource.String.action_production_storage_main);
                fragment = new ProductionStorageFragment();
            }
            //production storage scan
            else if (id == Resource.Id.action_production_storage_scan)
            {
                title    = Resources.GetString(Resource.String.action_production_storage_scan);
                fragment = new ProductionFeedingScanFragment();
            }

            if (fragment != null)
            {
                FragmentTransaction fragmentTx = this.FragmentManager.BeginTransaction();
                //fragmentTx.Add(Resource.Id.flContent, fragment);
                fragmentTx.Replace(Resource.Id.flContent, fragment);

                fragmentTx.Commit();
                this.Title = title;
            }


            return(base.OnOptionsItemSelected(item));
        }