public ActionResult ViewMySchedules(string DriverId) { //限制只能為公司 var user = _aspNetUsersService.GetUserModelByName(User.Identity.Name); CommonDropDownList(user.CompanyId, DriverId); ViewBag.DriverId = DriverId; ViewBag.DriverName = _aspNetUsersService.QueryUsersByID(DriverId).RealName; return(View()); }
/// <summary> /// 公司司機車輛 給值 /// </summary> /// <param name="CompanyId"></param> /// <param name="DriverId"></param> /// <returns></returns> private CompanyDriverVehicleViewModel SetCompanyDriverVehicleViewModel(int CompanyId, string DriverId) { CompanyDriverVehicleViewModel viewModel = new CompanyDriverVehicleViewModel(); List <SelectListItem> selectListItems = new List <SelectListItem>(); viewModel.CompanyId = CompanyId; viewModel.DriverId = DriverId; viewModel.DriverName = _aspNetUsersService.QueryUsersByID(DriverId).RealName; selectListItems = _userVehiclesService.GetCompanyDriverVehicle(DriverId); viewModel.CompanyDriverVehicleSelectListItemList = selectListItems; ViewBag.VehicleList = _vehicleService.GetVehicleBy(CompanyId); return(viewModel); }
public JsonResult GetGoodOwnerPhoneNumber(UserIdModel model) { string phoneNumber = string.Empty; var queryCustomer = _customerService.GetCustomerByUserId(model.UserId); if (queryCustomer != null) { phoneNumber = queryCustomer.ContactPhoneNumber; } else { var queryUser = _aspNetUsersService.QueryUsersByID(model.UserId); phoneNumber = queryUser.PhoneNumber; } return(Json(phoneNumber)); }