Exemplo n.º 1
0
 static string ReplaceRowTag(EMDataSet emDataSet,EMDataSet.ContBundleTblRow bundleRow,
     string tag)
 {
     switch (tag)
     {
         case "<BUNDLE_NUMBER>":
             return bundleRow.BundleSeqNumber.ToString();
         case "<PO_NUMBER>":
         {
             EMDataSet.POItemTblRow poItemRow = bundleRow.POItemTblRow;
             EMDataSet.POHeaderTblRow poHeaderRow = poItemRow.POHeaderTblRow;
             return poHeaderRow.PONumber;
         }
         case "<SIZE>":
         {
             EMDataSet.POItemTblRow poItemRow = bundleRow.POItemTblRow;
             if (!poItemRow.IsSizeOfItemNull())
                 return poItemRow.SizeOfItem;
             return "";
         }
         case "<ITEM_NAME>":
         {
             EMDataSet.POItemTblRow poItemRow = bundleRow.POItemTblRow;
             return HelperFunctions.GetItemName(poItemRow);
         }
         case "<CODE>":
         {
             EMDataSet.POItemTblRow poItemRow = bundleRow.POItemTblRow;
             if (!poItemRow.IsItemAccessCodeNull())
                 return poItemRow.ItemAccessCode;
             return "";
         }
     case "<BRANCH>":
         {
             EMDataSet.POItemTblRow poItemRow = bundleRow.POItemTblRow;
             if (poItemRow.POHeaderTblRow.IsCustomerLocationIDNull())
                 return "";
             int custLocID = poItemRow.
                 POHeaderTblRow.CustomerLocationID;
             return
                 emDataSet.LocationTbl.FindByLocID(custLocID).LocName;
         }
         case "<WEIGHT_KGS>":
         {
             if (!bundleRow.IsMetricShipQtyNull())
                 return bundleRow.MetricShipQty.ToString("N0");
             return "";
         }
         case "<WEIGHT_LBS>":
         {
             if (!bundleRow.IsEnglishShipQtyNull())
                 return bundleRow.EnglishShipQty.ToString("N0");
             return "";
         }
         case "<HEAT>":
         {
             if (!bundleRow.IsHeatNull())
                 return bundleRow.Heat;
             return "";
         }
         case "<INVOICE>":
         {
             if (!bundleRow.IsInvoiceNumberNull())
                 return bundleRow.InvoiceNumber;
             return "";
         }
         case "<BAY>":
         {
             if (!bundleRow.IsBayNumberNull())
                 return bundleRow.BayNumber;
             return "";
         }
     }
     Debug.Assert(false);
     return null;
 }