public IActionResult DatePostponement([FromBody, SwaggerRequestBody("Form to add a date postponement", Required = true)] BillDatePostponement form) { try { return(Ok(_service.DatePostponement(form.ToServiceLayer()))); } catch (ArgumentNullException e) { return(new BadRequestObjectResult(e.Message)); }; }
/// <summary> /// Function to add a Date Postponement /// </summary> /// <param name="form">BillDatePostponement</param> /// <returns>bool</returns> public bool DatePostponement(BillDatePostponement form) { Command command = new Command("P_Postponement", true); command.AddParameter("@IdBill", form.Id); command.AddParameter("@Date", form.DatePostponement); bool isChange = Connection.ExecuteNonQuery(command) == 1; if (!isChange) { throw new ArgumentNullException("Error raise during update or Bill not found"); } else { return(isChange); } }
public bool DatePostponement(BillDatePostponement form) { return(_repository.DatePostponement(form.ToDal())); }