Example #1
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);
            }
        }
Example #2
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);
            }
        }