public void UpdateStatus(ParkingLotUpdateViewModel model) { var entity = this.BaseService.Get(model.Id); if (entity != null) { entity.Status = model.Status; this.BaseService.Update(entity); } }
public void UpdateName(ParkingLotUpdateViewModel model) { var entity = this.BaseService.Get(model.Id); if (entity != null) { entity.Name = model.Name; this.BaseService.Update(entity); } }
public IHttpActionResult UpdateName(ParkingLotUpdateViewModel model) { try { var parkingLotApi = new ParkingLotApi(); parkingLotApi.UpdateName(model); return(Json(new ResultModel { success = true, })); } catch (Exception ex) { return(Json(new ResultModel { success = false, })); } }
public IHttpActionResult UpdateStatus(ParkingLotUpdateViewModel model) { try { var parkingLotApi = new ParkingLotApi(); parkingLotApi.UpdateStatus(model); return(Json(new ResultModel { message = "Cập nhập thành công", success = true, })); } catch (Exception ex) { return(Json(new ResultModel { message = "Có lỗi xảy ra, vui lòng liên hệ admin", success = false, })); } }