public void UpdateOrderAppointment(OrderAppointment orderAppointment) { try { var ptBulk = string.IsNullOrEmpty(orderAppointment.PtBulk) ? "" : orderAppointment.PtBulk; var entity = context.OrderAppointments.Where(x => x.PurchaseOrderId == orderAppointment.PurchaseOrderId && x.PickTicketId == orderAppointment.PickTicketId && x.CustomerId == orderAppointment.CustomerId && x.PtBulk == ptBulk).FirstOrDefault(); if (entity != null) { //if (orderAppointment.Status != 0) //{ entity.Status = orderAppointment.Status; //} if (!string.IsNullOrEmpty(orderAppointment.Notes)) { entity.Notes = orderAppointment.Notes; } if (!string.IsNullOrEmpty(orderAppointment.ConfirmationNumber)) { entity.ConfirmationNumber = orderAppointment.ConfirmationNumber; } context.SaveChanges(); } } catch (Exception exc) { throw exc; } }
public async Task <string> SetAppointment(Appointment appointment, OrderAppointment order) { return(await Repository.SetAppointment(appointment, order)); }