示例#1
0
        public async Task ChangeRepairStatus(RepairStatusModel status)
        {
            var repair = await _context.Repairs.FirstOrDefaultAsync(x => x.RepairId == status.RepairId);

            if (repair == null)
            {
                throw new Exception("Repair not found");
            }
            repair.Status = status.Status;
            await _context.SaveChangesAsync();
        }
示例#2
0
        public async Task <IActionResult> ChangeRepairStatus([FromBody] RepairStatusModel model)
        {
            try
            {
                await _repairsRepository.ChangeRepairStatus(model);

                return(Json(
                           new
                {
                    Success = true,
                    Data = "ok"
                }));
            }
            catch (Exception exception)
            {
                return(Json(new { Success = false, exception.Message }));
            }
        }