Exemplo n.º 1
0
        private static void PopulateConceptHeader(ref Concept con, ConceptCSV csv)
        {
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.GetDirectoryName(Assembly.GetAssembly(typeof(ConceptCSV)).Location) + @"\" + "log4net.config"));
            log.Debug($"Populating concept header with {String.Join(",",csv)}");

            try
            {
                con.batch = JDE.GetNextBatchNumber().ToString();
                DataRow r = csv.DT.Rows[0];
                con.BillToAddress   = Double.Parse(r["CUSTOMER NUMBER"].ToString());
                con.ConceptID       = JDE.GetConceptID(con.BillToAddress);
                con.JulianOrderDate = CommonFunctions.DateStringToJulian(System.DateTime.Today.ToString());
                con.OrderDetails    = new List <ConceptLine>();
                con.PONumber        = r["PO NUMBER"].ToString();
                con.OrderedBy       = r["ORDERED BY"].ToString();
                con.ShippingVendor  = Double.Parse(r["SHIPPING VENDOR"].ToString());
                con.ShippingMode    = r["SHIPPING METHOD"].ToString();
            }
            catch (Exception eBLL)
            {
                log.Error($"Error populating concept header" + eBLL.Message);
                throw;
            }

            return;
        }
Exemplo n.º 2
0
        public void GetConceptID_byABALKY()
        {
            string name     = "2020PH1";
            string expected = "DN";
            string result   = JDE.GetConceptID(name);

            Assert.IsTrue(0 == String.Compare(expected, result));
        }
Exemplo n.º 3
0
        public void GetConceptID_byABAN8()
        {
            float  address  = 4590;
            string expected = "DN";
            string result   = JDE.GetConceptID(address);

            Assert.IsTrue(0 == String.Compare(expected, result));
        }
Exemplo n.º 4
0
        } // WriteConcept

        public List <string> CheckForMissingShipToAddresses()
        {
            List <string> AllShipToNames = new List <string>();
            double        SoldTo         = double.Parse(DT.Rows[0].Field <string>("CUSTOMER NUMBER"), System.Globalization.CultureInfo.InvariantCulture);
            string        ConceptID      = JDE.GetConceptID(SoldTo);

            foreach (DataRow r in DT.Rows)
            {
                AllShipToNames.Add(r.Field <string>("STORE NUMBER").Trim()
                                   + "-"
                                   + ConceptID.Trim());
            }
            List <string> missing = JDE.FindMissingShipTos(AllShipToNames.Distinct().ToList());

            return(missing);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Populate the empty ShipToCSV object
 /// </summary>
 /// <param name="missing"></param>
 /// <param name="concept"></param>
 public void PopulateSpreadsheet(List <string> missing, ConceptCSV concept)
 {
     if (null == DT)
     {
         DT = new DataTable();
         PopulateColumns();
         string conceptID = JDE.GetConceptID(Double.Parse(concept.DT.Rows[0].Field <string>("CUSTOMER NUMBER")));
         foreach (string shipto in missing)
         {
             PopulateDataRow(shipto, concept, conceptID);
         }
     }
     else
     {
         log.Error("The DataTable for ShipToCSV already exists.");
         throw new System.AggregateException("Error, the DataTable for ShipToCSV already exists & must be deleted first.");
     }
 }
Exemplo n.º 6
0
        } // ValidateTaxExplanations

        /// <summary>
        /// Verify a valid concept code exists in JDE for this customer.
        /// </summary>
        /// <param name="conceptCSV"></param>
        /// <returns></returns>
        private bool ConceptCodeExists(ConceptCSV conceptCSV)
        {
            bool   result;
            string concept = JDE.GetConceptID(Double.Parse(conceptCSV.DT.Rows[0].Field <string>("CUSTOMER NUMBER"))).Trim();

            if (String.Empty == concept)
            {
                log.Error($"Customer Number {conceptCSV.DT.Rows[0].Field<string>("CUSTOMER NUMBER")} does not have a concept code populated in F0101.ABAC08");
                using (new CenterDialog(this))
                {
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    MessageBox.Show($"Customer Number {conceptCSV.DT.Rows[0].Field<string>("CUSTOMER NUMBER")} does not have a concept code populated in the Address Book.\r\nPlease fix this in the spreadsheet or JDE before continuing.", "Data Error", buttons);
                }
                result = false;
            }
            else
            {
                log.Debug($"Customer Number {conceptCSV.DT.Rows[0].Field<string>("CUSTOMER NUMBER")} has a concept.");
                result = true;
            }
            return(result);
        } // ConceptCodeExists