Exemple #1
0
        //***==================== ProceedScan
        private bool EANGTIN(ref PSC_Types.ScDat s, string sBC)
        {
            bool
           ret = true;
            string
                sEANP = "";

            try
            {
                if (sBC.Length == 14)
                {// это ITF
                    s.tTyp  = AppC.TYP_TARA.TARA_TRANSP;
                    s.sGTIN = sBC;
                    if (SetKMCOnGTIN(ref s))
                    {
                        return(AppC.RC_OKB);
                    }
                    sEANP  = sBC.Substring(1, 12);
                    s.sEAN = Srv.CheckSumModul10(sEANP);
                }
                else
                {
                    s.tTyp = AppC.TYP_TARA.TARA_POTREB;
                    if (sBC.Length == 13)
                    {
                        sEANP  = sBC.Substring(0, 12);
                        s.sEAN = Srv.CheckSumModul10(sEANP);
                    }
                    else
                    {
                        s.sEAN = sBC;
                    }
                }
                ret = xNSI.Connect2MC(s.sEAN, 0, -1, ref s);
            }
            catch
            {
                ret = false;
            }
            return(ret);
        }
Exemple #2
0
        private bool EANGTIN(ref PSC_Types.ScDat s, string sBC)
        {
            bool
           ret = true;
            string
                sEANP = "";

            try
            {
                if (sBC.Length == 14)
                {// это ITF
                    s.tTyp  = AppC.TYP_TARA.TARA_TRANSP;
                    s.sGTIN = sBC;
                    if (SetKMCOnGTIN(ref s))
                    {
                        return(AppC.RC_OKB);
                    }
                    sEANP = sBC.Substring(1, 12);
                }

                if (sBC.Length == 13)
                {
                    s.tTyp = AppC.TYP_TARA.TARA_POTREB;
                    //if ((xScan.Dat.StartsWith("460")) ||
                    //    (xScan.Dat.StartsWith("481")))
                    //{
                    //    sEANP = sBC.Substring(0, 12);
                    //}
                    sEANP = sBC.Substring(0, 12);
                }

                s.sEAN = Srv.CheckSumModul10(sEANP);
                ret    = xNSI.Connect2MC(s.sEAN, 0, -1, ref s);
            }
            catch
            {
                ret = false;
                //sTypDoc.sN = sS + "-???";
            }
            return(ret);
        }