Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 public string UpdateInterpretation(Interpretation interpretation)
 {
     bool isProcessDone = UpdateEntity<Interpretation>(interpretation);
     if (isProcessDone)
     {
         log.Info(string.Format("Interpretation to Order {0} changed", interpretation.Order.Id));
         return string.Empty;
     }
     else
     {
         return "Interpertation is exist for this ORDER!";
     }
 }