Exemplo n.º 1
0
        private void CambiaCompañia(string Compañia)
        {
            bool   Res          = true;
            string appServerUrl = string.Empty;

            EnvironmentInformation.ConfigurationFileName = FileSys;
            appServerUrl = AppSettingsHandler.AppServerUrl;
            CustomBinding wcfBinding = new CustomBinding();

            wcfBinding = NetTcp.UsernameWindowsChannel();
            Uri CustSvcUri = new Uri(string.Format("{0}/Ice/BO/{1}.svc", appServerUrl, "UserFile"));

            using (UserFileImpl US = new UserFileImpl(wcfBinding, CustSvcUri))
            {
                try
                {
                    US.ClientCredentials.UserName.UserName = cred.UserName;
                    US.ClientCredentials.UserName.Password = cred.Password;
                    US.SaveSettings(cred.UserName, true, gCompany, true, false, true, true, true, true, true, true, true,
                                    false, false, -2, 0, 1456, 886, 2, "MAINMENU", "", "", 0, -1, 0, "", false);
                }
                catch (Exception ex)
                {
                    US.Close();
                    US.Dispose();
                    throw new Exception(ex.Message);
                }
                finally
                {
                    US.Close();
                    US.Dispose();
                }
            }
        }
Exemplo n.º 2
0
        public void insertUD01()
        {
            bool   Res          = true;
            string appServerUrl = string.Empty;

            EnvironmentInformation.ConfigurationFileName = FileSys;
            appServerUrl = AppSettingsHandler.AppServerUrl;
            CustomBinding wcfBinding = new CustomBinding();

            wcfBinding = NetTcp.UsernameWindowsChannel();
            Uri CustSvcUri = new Uri(string.Format("{0}/Ice/BO/{1}.svc", appServerUrl, "UD01"));

            using (UD01Impl OB = new UD01Impl(wcfBinding, CustSvcUri))
            {
                OB.ClientCredentials.UserName.UserName = cred.UserName;
                OB.ClientCredentials.UserName.Password = cred.Password;
                UD01DataSet dt = new UD01DataSet();
                OB.GetaNewUD01(dt);

                dt.Tables["UD01"].Rows[0]["Company"]     = gCompany;
                dt.Tables["UD01"].Rows[0]["key1"]        = "T4921O";
                dt.Tables["UD01"].Rows[0]["key2"]        = "";
                dt.Tables["UD01"].Rows[0]["key3"]        = "";
                dt.Tables["UD01"].Rows[0]["key4"]        = "";
                dt.Tables["UD01"].Rows[0]["key5"]        = "";
                dt.Tables["UD01"].Rows[0]["character01"] = "prueba_12:59";

                OB.Update(dt);
            }
        }
Exemplo n.º 3
0
        public void NewPatchFldRow()
        {
            try
            {
                string appServerUrl = string.Empty;
                EventCollector = String.Empty;

                EnvironmentInformation.ConfigurationFileName = fileSys;
                appServerUrl = AppSettingsHandler.AppServerUrl;
                CustomBinding wcfBinding = new CustomBinding();
                wcfBinding = NetTcp.UsernameWindowsChannel();
                Uri CustSvcUri = new Uri(string.Format("{0}/Ice/BO/{1}.svc", appServerUrl, "PatchFld"));
                using (PatchFldImpl OB = new PatchFldImpl(wcfBinding, CustSvcUri))
                {
                    OB.ClientCredentials.UserName.UserName = cred.username;
                    OB.ClientCredentials.UserName.Password = cred.password;
                    PatchFldDataSet dataRow = new PatchFldDataSet();
                    OB.GetNewPatchFld(dataRow, "DLMAC", "InvcHead", "MXFiscalFolio");
                }
            }
            catch (Ice.Common.BusinessObjectException epiException)
            {
                Console.WriteLine(epiException.Message);
            }
            catch (Exception sysException)
            {
                Console.WriteLine(sysException.Message);
            }
        }
Exemplo n.º 4
0
        public void setCompany(string currentCompany)
        {
            try
            {
                EventCollector = String.Empty;
                string appServerUrl = string.Empty;
                EnvironmentInformation.ConfigurationFileName = fileSys;
                appServerUrl = AppSettingsHandler.AppServerUrl;
                CustomBinding wcfBinding = NetTcp.UsernameWindowsChannel();
                Uri           CustSvcUri = new Uri(String.Format("{0}/Ice/BO/{1}.svc", appServerUrl, "UserFile"));

                using (Ice.Proxy.BO.UserFileImpl US = new Ice.Proxy.BO.UserFileImpl(wcfBinding, CustSvcUri))
                {
                    US.ClientCredentials.UserName.UserName = cred.username;
                    US.ClientCredentials.UserName.Password = cred.password;
                    US.SaveSettings(cred.username, true, currentCompany, true, false, true, true, true, true, true, true, true,
                                    false, false, -2, 0, 1456, 886, 2, "MAINMENU", "", "", 0, -1, 0, "", false);
                    US.Close();
                    US.Dispose();
                }
            }
            catch (System.UnauthorizedAccessException loginError)
            {
                EventCollector = loginError.Message;
            }
            catch (Ice.Common.BusinessObjectException businessException)
            {
                EventCollector = businessException.Message;
            }
            catch (Exception error)
            {
                EventCollector = error.Message;
            }
        }
Exemplo n.º 5
0
        public void updateUD01()
        {
            bool   Res          = true;
            bool   existe       = false;
            string appServerUrl = string.Empty;

            EnvironmentInformation.ConfigurationFileName = FileSys;
            appServerUrl = AppSettingsHandler.AppServerUrl;
            CustomBinding wcfBinding = new CustomBinding();

            wcfBinding = NetTcp.UsernameWindowsChannel();
            Uri CustSvcUri = new Uri(string.Format("{0}/Ice/BO/{1}.svc", appServerUrl, "UD01"));

            using (UD01Impl OB = new UD01Impl(wcfBinding, CustSvcUri))
            {
                OB.ClientCredentials.UserName.UserName = cred.UserName;
                OB.ClientCredentials.UserName.Password = cred.Password;
                UD01DataSet dt = new UD01DataSet();

                try
                {
                    dt = OB.GetByID("hola1", "", "", "", "");
                }
                catch (Exception e)
                {
                    existe = false;
                }
                if (!existe)
                {
                    OB.GetaNewUD01(dt);

                    dt.Tables["UD01"].Rows[0]["Company"] = gCompany;
                    dt.Tables["UD01"].Rows[0]["key1"]    = "hola1";
                    dt.Tables["UD01"].Rows[0]["key2"]    = "";
                    dt.Tables["UD01"].Rows[0]["key3"]    = "";
                    dt.Tables["UD01"].Rows[0]["key4"]    = "";
                    dt.Tables["UD01"].Rows[0]["key5"]    = "";
                }

                dt.Tables["UD01"].Rows[0]["character01"] = "prueba_01:15";

                OB.Update(dt);
            }
        }
Exemplo n.º 6
0
        public void UpdateInvcHeader(int invoiceNum, string UUID, string SATCertificate, string fecha)
        {
            try
            {
                string appServerUrl = string.Empty;
                EventCollector = String.Empty;

                EnvironmentInformation.ConfigurationFileName = fileSys;
                appServerUrl = AppSettingsHandler.AppServerUrl;
                CustomBinding wcfBinding = new CustomBinding();
                wcfBinding = NetTcp.UsernameWindowsChannel();
                Uri CustSvcUri = new Uri(string.Format("{0}/Erp/BO/{1}.svc", appServerUrl, "ARInvoice"));
                using (ARInvoiceImpl OB = new ARInvoiceImpl(wcfBinding, CustSvcUri))
                {
                    OB.ClientCredentials.UserName.UserName = cred.username;
                    OB.ClientCredentials.UserName.Password = cred.password;
                    ARInvoiceDataSet InvcData = OB.GetByID(invoiceNum);
                    InvcData.Tables["InvcHead"].Rows[0]["MXFiscalFolio"]        = UUID;
                    InvcData.Tables["InvcHead"].Rows[0]["MXCertifiedTimeStamp"] = fecha;
                    InvcData.Tables["InvcHead"].Rows[0]["MXSATCertificateSN"]   = "00001000000406725461";
                    OB.Update(InvcData);
                }
            }
            catch (Ice.Common.BusinessObjectException epiException)
            {
                EventCollector = epiException.Message + "\n" + epiException.StackTrace;
            }
            catch (Exception sysException)
            {
                EventCollector = sysException.Message + "\n" + sysException.StackTrace;
            }

            /*
             * finally
             * {
             *  epiSession.Dispose();
             *  epiSession = null;
             * }
             */
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            if (args.Count() != 1)
            {
                Environment.Exit(0);
            }
            CustomBinding binding = NetTcp.UsernameWindowsChannel();

            if (args.Length != 0)
            {
                using (var dynQry = GetEpicorBOInstance <DynamicQueryImpl, DynamicQuerySvcContract>(binding, new Uri($"net.tcp://{Settings.Default.Server}/{Settings.Default.Instance}/ICE/BO/DynamicQuery.svc"), Settings.Default.UserName, Settings.Default.Password))
                {
                    var  eP = dynQry.GetQueryExecutionParametersByID(args[0]);
                    bool morePages;
                    var  rslt = dynQry.GetListByID(args[0], eP, 0, 0, out morePages);
                    foreach (DataRow r in rslt.Tables["Results"].Rows)
                    {
                        r["RowMod"] = "U";
                    }
                    dynQry.UpdateByID(args[0], rslt);
                }
            }
        }