public async Task <IActionResult> Cancel(string id) { return(await this.Execute(true, true, async() => { OrderDetailsModel order = await this.orders.ChangeStatus(id, this.UserId, Domain.Enums.OrderStatus.Cancelled); DeliveryDataDetailsModel deliveryData = await this.deliveryData.Get(order.DeliveryDataId); string userEmail = deliveryData.Email; string subject = string.Format(MailConstants.SubjectCancel, order.Number); this.mails.Send(userEmail, subject, MailConstants.ContentCancel, this.smtpConfiguration); return this.Ok(); })); }
public async Task <IActionResult> Get(string id) { return(await this.Execute(false, false, async() => { DeliveryDataDetailsModel data = await this.deliveryData.Get(id); return this.Ok(new { deliveryData = data }); })); //try //{ // DeliveryDataDetailsModel data = await this.deliveryData.Get(id); // return this.Ok(new { deliveryData = data }); //} //catch (Exception e) //{ // return this.StatusCode(StatusCodes.Status400BadRequest, e.Message); //} }