public ActionResult UpdatetGroupVehicles(GroupVehiclesViewModel model, List <int> sourceUserVehicleList)
        {
            _logger.Information($"UpdatetGroupVehicles model : { JsonConvert.SerializeObject(model)}");
            ResponseViewModel result = new ResponseViewModel();

            try
            {
                AssignVehicleForGroupModel updateModel = new AssignVehicleForGroupModel();
                updateModel.CompanyId  = model.CompanyId;
                updateModel.GroupId    = model.GroupId;
                updateModel.VehicleIds = sourceUserVehicleList;
                _companyGroupsVehiclesService.AssignVehicleForGroup(updateModel);
                result.IsOk = true;
            }
            catch (Exception ex)
            {
                result.IsOk      = false;
                result.Exception = ex;
                _logger.Information($"UpdatetGroupVehicles exception: { JsonConvert.SerializeObject(ex)}");
                throw ex;
            }

            result.ResponseTime = string.Format("{0:yyyy/MM/dd HH:mm:ss}", DateTime.Now);
            _logger.Information($"UpdatetGroupVehicles_Result : { JsonConvert.SerializeObject(result)}");

            GroupVehiclesViewModel viewModel = SetGroupVehiclesViewModel(model.CompanyId, model.GroupId);

            viewModel.SaveResult = result.IsOk;
            return(View("EditGroupVehicle", viewModel));
        }
        public ActionResult EditGroupVehicle(int CompanyId, int GroupId, string Control)
        {
            GroupVehiclesViewModel viewModel = new GroupVehiclesViewModel();

            viewModel          = SetGroupVehiclesViewModel(CompanyId, GroupId);
            Session["Control"] = Control;
            return(View(viewModel));
        }
        /// <summary>
        /// GroupVehiclesViewModel 給值
        /// </summary>
        /// <param name="CompanyId"></param>
        /// <param name="GroupId"></param>
        /// <returns></returns>
        private GroupVehiclesViewModel SetGroupVehiclesViewModel(int CompanyId, int GroupId)
        {
            GroupVehiclesViewModel viewModel       = new GroupVehiclesViewModel();
            List <SelectListItem>  selectListItems = new List <SelectListItem>();

            viewModel.CompanyId   = CompanyId;
            viewModel.CompanyName = _companyService.GetCompanyName(CompanyId);
            viewModel.GroupId     = GroupId;
            viewModel.GroupName   = _companyGroupService.GetCompanyGroupName(GroupId);
            selectListItems       = _companyGroupsVehiclesService.GetVehicleByCompanyGroup(CompanyId, GroupId);
            viewModel.GroupVehicleSelectListItemList = selectListItems;
            ViewBag.VehicleList = _vehicleService.GetVehicleBy(CompanyId);

            return(viewModel);
        }