public string EditInterpretation(DtoInterpretation dtoInterpretation) { var uniqueInterpretation = InterpretationMethods.Instance.GetInterpretationByOrder(dtoInterpretation.Order.Number); if (uniqueInterpretation == null) { var interpretation = new Interpretation() { Text = dtoInterpretation.Text, Order = new Order() { Id = OrderMethods.Instance.GetOrderByNumber(dtoInterpretation.Order.Number).Id }, Condition = dtoInterpretation.Condition, SignOutDt = dtoInterpretation.SignOutDt }; return(InterpretationMethods.Instance.InsertInterpretation(interpretation)); } else { var interpretation = new Interpretation() { Id = uniqueInterpretation.Id, Text = dtoInterpretation.Text, Order = new Order() { Id = OrderMethods.Instance.GetOrderByNumber(dtoInterpretation.Order.Number).Id }, Condition = dtoInterpretation.Condition, SignOutDt = dtoInterpretation.SignOutDt }; return(InterpretationMethods.Instance.UpdateInterpretation(interpretation)); } }
public string EditInterpretation(DtoInterpretation dtoInterpretation) { var uniqueInterpretation = InterpretationMethods.Instance.GetInterpretationByOrder(dtoInterpretation.Order.Number); if (uniqueInterpretation == null) { var interpretation = new Interpretation() { Text = dtoInterpretation.Text, Order = new Order() { Id = OrderMethods.Instance.GetOrderByNumber(dtoInterpretation.Order.Number).Id }, Condition = dtoInterpretation.Condition, SignOutDt = dtoInterpretation.SignOutDt }; return InterpretationMethods.Instance.InsertInterpretation(interpretation); } else { var interpretation = new Interpretation() { Id = uniqueInterpretation.Id, Text = dtoInterpretation.Text, Order = new Order() { Id = OrderMethods.Instance.GetOrderByNumber(dtoInterpretation.Order.Number).Id }, Condition = dtoInterpretation.Condition, SignOutDt = dtoInterpretation.SignOutDt }; return InterpretationMethods.Instance.UpdateInterpretation(interpretation); } }
public DtoInterpretation GetInterpretationByOrder(string orderNumber) { Interpretation interpretation = InterpretationMethods.Instance.GetInterpretationByOrder(orderNumber); if (interpretation != null) { var dtoInterpretation = new DtoInterpretation() { Id = interpretation.Id, Condition = interpretation.Condition, Order = new DtoOrder() { Id = interpretation.Order.Id }, SignOutDt = interpretation.SignOutDt, Text = interpretation.Text }; return(dtoInterpretation); } else { return(null); } }
public DtoInterpretation GetInterpretationByOrder(string orderNumber) { Interpretation interpretation = InterpretationMethods.Instance.GetInterpretationByOrder(orderNumber); if (interpretation != null) { var dtoInterpretation = new DtoInterpretation() { Id = interpretation.Id, Condition = interpretation.Condition, Order = new DtoOrder() { Id = interpretation.Order.Id }, SignOutDt = interpretation.SignOutDt, Text = interpretation.Text }; return dtoInterpretation; } else { return null; } }