Example #1
0
        private void fillGarpTableFields(OrderRowDefinitions.OrderRow or, ref GarpGenericDB data)
        {
            data.setValue("ANR", or.Artikel);
            data.setValue("ORA", or.Antal.Replace(",", "."));

            if (isInternalProduct(or.Artikel))
            {
                if (GCF.noNULL(or.APris).Equals(""))
                    mOGR.setValue("LVP", "0");
                else
                    mOGR.setValue("LVP", or.APris.Replace(",", "."));

                mOGR.setValue("LPF", "F");

                // PRI is always zero on internal products
                mOGR.setValue("PRI", "0");
            }
            else
            {
                if (GCF.noNULL(or.APris).Equals(""))
                    mOGR.setValue("PRI", "0");
                else
                    mOGR.setValue("PRI", or.APris.Replace(",", "."));
            }

            //data.setValue("PRI", or.APris);

            try
            {
                if (!GCF.noNULL(or.LevTid).Equals(""))
                    data.setValue("LDT", or.LevTid);
            }
            catch { }

            if (GCF.noNULL(or.AidDate).Trim() != "")
                mOGR.setValue("DIM", "1" + or.AidDate);
            else
                mOGR.setValue("DIM", GCF.noNULL(or.AidDate));

            data.setValue("RES", oProdStat.getIdByTX1(or.Prodstatus));
            data.setValue("BNX", or.SelectedHandler);
            data.setValue("INK", or.InkStat);

            if (or.ViewInList)
                data.setValue("X1F", "x");
            else
                data.setValue("X1F", "0");

            if (or.Warrenty)
            {
                data.setValue("RAB", "-100");
                data.setValue("RBK", "G");
            }
            else
            {
                data.setValue("RAB", "");
                data.setValue("RBK", "");
            }

            if (or.Beloppsrad)
                data.setValue("BRA", "*");
            else
                data.setValue("BRA", "");

            mOGR2.setValue("C2A", or.Thord_NeedStep);
            mOGR2.setValue("NU5", or.AidOid.ToString());
            mOGR2.setValue("NU6", or.PartOid.ToString());

            data.setValue("EXT", or.EA_ProductGroup);

            mOGR2.setValue("C1C", or.Priority);
            mOGR2.setValue("C2B", or.AidPriority);

            // ********* Producktions, vet inte ens om dett blir aktuellt ************
            if (GCF.noNULL(or.ProductionTitle).Length > 20)
            {
                mOGR2.setValue("C20", or.ProductionTitle.Substring(0, 20));
                mOGR2.setValue("C10", or.ProductionTitle.Substring(20));
            }
            else
            {
                mOGR2.setValue("C20", or.ProductionTitle);
                mOGR2.setValue("C10", "");
            }

            try
            {
                if (or.Urgent)
                    mOGR2.setValue("C1B", "1");
                else
                    mOGR2.setValue("C1B", "0");
            }
            catch { mOGR2.setValue("C1B", "0"); }

            string[] s = { "yyMMdd", "yyyyMMdd", "yyyy-MM-dd" };
            try
            {
                mOGR2.setValue("C06", or.PromisedDeliverDate.HasValue ? or.PromisedDeliverDate.Value.ToString("yyMMdd") : "");
            }
            catch { mOGR2.setValue("C06", DateTime.Today.ToString("yyMMdd")); }

            try
            {
                mOGR2.setValue("C07", or.ConditionDate.HasValue ? or.ConditionDate.Value.ToString("yyMMdd") : "");
            }
            catch { mOGR2.setValue("C07", DateTime.Today.ToString("yyMMdd")); }
        }
Example #2
0
 public void setWarranty(bool value, ref GarpGenericDB data)
 {
     if (value)
     {
         data.setValue("RAB", "-100");
         data.setValue("RBK", "G");
     }
     else
     {
         data.setValue("RAB", "");
         data.setValue("RBK", "");
     }
 }