示例#1
0
        public static EGAISSrv2.Element[] GetEgaisListFrom1C()
        {
            try
            {
                /*
                 * PDiscountCard.EGAISSrv.wsExtAlco_WebServiceAlco srv = new PDiscountCard.EGAISSrv.wsExtAlco_WebServiceAlco();
                 * NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
                 * srv.Credentials = Cred;
                 * //string res = srv.GetBeerStockAlcoCodes(AlohainiFile.DepNum.ToString());
                 * EGAISSrv.Element[] res = srv.GetBeerStockAlcoCodes(DepNum.ToString());
                 * return res;
                 */
                PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco srv = new PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco();
                NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
                srv.Credentials = Cred;
                //string res = srv.GetBeerStockAlcoCodes(AlohainiFile.DepNum.ToString());
                EGAISSrv2.Element[] res = srv.GetBeerStockAlcoCodes(DepNum.ToString());

                Utils.ToLog(String.Format("GetBeerStockAlcoCodes Dep: {0}; Address {1}", DepNum, srv.Url));
                foreach (EGAISSrv2.Element El in res)
                {
                    Utils.ToLog(El.AlcoCode + " " + El.AlcoName);
                }
                return(res);
            }
            catch (Exception e)
            {
                Utils.ToLog("Error GetEgaisListFrom1C " + e.Message);
                return(null);
            }
            //  return null;
        }
示例#2
0
        public static bool SendBeerEgaisTo1C(string AlcoCode)
        {
            try
            {
                try
                {
                    Utils.ToCardLog(String.Format("Send beer to EGAIS: {0}", AlcoCode));
                    PDiscountCard.EGAISSrv.wsExtAlco_WebServiceAlco srv = new PDiscountCard.EGAISSrv.wsExtAlco_WebServiceAlco();
                    NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
                    srv.Credentials = Cred;
                    //   string res = srv.stringPutBottleOpen(QRCode, AlohainiFile.DepNum.ToString());
                    string res2 = srv.stringPutBeerOpen(AlcoCode, DepNum.ToString());
                }
                catch
                {
                }

                Utils.ToCardLog(String.Format("Send beer to EGAIS: {0}", AlcoCode));
                PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco srv2 = new PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco();
                NetworkCredential Cred2 = new NetworkCredential("ws", "ws1", "");
                srv2.Credentials = Cred2;
                //   string res = srv.stringPutBottleOpen(QRCode, AlohainiFile.DepNum.ToString());
                string res = srv2.stringPutBeerOpen(AlcoCode, DepNum.ToString());
                return(res == "0");
            }
            catch (Exception e)
            {
                Utils.ToCardLog(String.Format("Error beer Send to EGAIS: {0}; Err:{1}", AlcoCode, e.Message));
                return(false);
            }
        }
示例#3
0
 private static string GetEgaisIdFrom1C(string Code)
 {
     try
     {
         PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco srv = new PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco();
         NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
         srv.Credentials = Cred;
         string res = srv.stringGetItemByQRCode(Code.ToUpper());
         return(res);
     }
     catch (Exception e)
     {
         return("Ошибка. " + e.Message);
     }
 }
示例#4
0
 public static bool GetEgaisAlreadyScanFrom1C(string Code, int Unit = -1)
 {
     try
     {
         Utils.ToCardLog("GetEgaisAlreadyScanFrom1C " + Code);
         if (Unit == -1)
         {
             Unit = iniFile.SpoolDepNum;
         }
         PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco srv = new PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco();
         NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
         srv.Credentials = Cred;
         bool res = srv.boolCheckQRCodeDoubleDayUse(Code.ToUpper(), Unit.ToString());
         Utils.ToCardLog("GetEgaisAlreadyScanFrom1C return " + res);
         return(res);
     }
     catch (Exception e)
     {
         Utils.ToCardLog("GetEgaisAlreadyScanFrom1C Error" + e.Message);
         return(false);
     }
 }
示例#5
0
        public static bool SendEgaisTo1C(string QRCode)
        {
            try
            {
                Utils.ToCardLog(String.Format("Send to EGAIS: {0}", QRCode));
                PDiscountCard.EGAISSrv.wsExtAlco_WebServiceAlco srv = new PDiscountCard.EGAISSrv.wsExtAlco_WebServiceAlco();
                NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
                srv.Credentials = Cred;
                string res = srv.stringPutBottleOpen(QRCode.ToUpper(), DepNum.ToString());
                //  return res == "0";
            }
            catch (Exception e)
            {
                Utils.ToCardLog(String.Format("Error Send to EGAIS: {0}; Err:{1}", QRCode, e.Message));
                //  return false;
            }


            try
            {
                Utils.ToCardLog(String.Format("Send to EGAIS2: {0}", QRCode));
                PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco srv2 = new PDiscountCard.EGAISSrv2.wsExtAlco_WebServiceAlco();
                NetworkCredential Cred = new NetworkCredential("ws", "ws1", "");
                srv2.Credentials = Cred;
                string res = srv2.stringPutBottleOpen(QRCode.ToUpper(), DepNum.ToString());
                Utils.ToCardLog(String.Format("Send to EGAIS2 end res: {0}", res));
                return(res == "0");
            }
            catch (Exception e)
            {
                Utils.ToCardLog(String.Format("Error Send to EGAIS2: {0}; Err:{1}", QRCode, e.Message));
                return(false);
            }

            //http://server1c/alco/ws/wsAlco.1cws?wsdl
            //http://server1c/retail/ws/wsAlco.1cws?wsdl
        }