Пример #1
0
        public JsonpResult verify(int invNo, string pattern, string serial, int ck)
        {
            IInvSrv = InvServiceFactory.GetService(pattern, currentCom.id);
            iGen    = InvServiceFactory.GetGenerator(pattern, currentCom.id);
            IInvoice inv = IInvSrv.GetByNo(currentCom.id, pattern, serial, invNo);

            byte[] data = iRepo.GetData(inv);

            XmlDocument xd = new XmlDocument();

            xd.PreserveWhitespace = true;
            xd.LoadXml(System.Text.Encoding.UTF8.GetString(data));

            int  k = iGen.VerifyInvoice(Encoding.UTF8.GetBytes(xd.OuterXml));
            bool c = false;

            if (k == 0 || k == 1 || (k == 2 && ck == 0))
            {
                c = true;
            }
            return(new JsonpResult
            {
                Data = c,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }