コード例 #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));
            }
        }
コード例 #2
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);
     }
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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;
     }
 }