private void SaveGSInvoice(ASYCUDAValuation v, xcuda_Gs_Invoice di)
        {
            if (di != null)//&& di.Amount_foreign_currency != 0
            {
                var inv = new ASYCUDAValuationGs_Invoice();
                if (di.Amount_foreign_currency != 0)
                {
                    inv.Amount_foreign_currency = di.Amount_foreign_currency.ToString();
                }
                if (di.Amount_national_currency != 0)
                {
                    inv.Amount_national_currency = di.Amount_national_currency.ToString();
                }
                if (di.Currency_code != null)
                {
                    inv.Currency_code.Text.Add(di.Currency_code);
                }
                if (di.Currency_name != null)
                {
                    inv.Currency_name.Text.Add(di.Currency_name);
                }
                if (di.Currency_rate != 0)
                {
                    inv.Currency_rate = di.Currency_rate.ToString();
                }

                v.Gs_Invoice = inv;
            }
        }
 private void SaveWeight(ASYCUDAValuation v, xcuda_Weight dw)
 {
     if (dw != null)
     {
         var w = new ASYCUDAValuationWeight();
         w.Gross_weight = dw.Gross_weight.ToString();
         v.Weight       = w;
     }
 }
 private void SaveValuationItem(xcuda_ASYCUDA da, ASYCUDA a)
 {
     if (da.xcuda_Valuation != null)//&& da.xcuda_Valuation.xcuda_Gs_Invoice.Amount_foreign_currency != 0
     {
         var v = new ASYCUDAValuation();
         if (da.xcuda_Valuation.Calculation_working_mode != null)
         {
             v.Calculation_working_mode = da.xcuda_Valuation.Calculation_working_mode;
         }
         SaveGSInvoice(v, da.xcuda_Valuation.xcuda_Gs_Invoice);
         SaveGSExternalFreight(v, da.xcuda_Valuation.xcuda_Gs_external_freight);
         SaveWeight(v, da.xcuda_Valuation.xcuda_Weight);
         a.Valuation = v;
     }
 }
 private void SaveGSExternalFreight(ASYCUDAValuation v, xcuda_Gs_external_freight df)
 {
     if (df != null && df.Amount_foreign_currency != 0)
     {
         var f = new ASYCUDAValuationGs_external_freight();
         f.Amount_foreign_currency  = df.Amount_foreign_currency.ToString();
         f.Amount_national_currency = df.Amount_national_currency.ToString();
         if (df.Currency_code != null)
         {
             f.Currency_code.Text.Add(df.Currency_code);
         }
         if (df.Currency_rate != null)
         {
             f.Currency_rate = df.Currency_rate.ToString();
         }
         v.Gs_external_freight = f;
     }
 }