Exemplo n.º 1
0
        private string NewFile_Service(string reporter, string productSN, string docType, string fileName, string filePath, string Ext, string Time)
        {
            string             ret         = "ERROR";
            deviceInfo         devInfo     = new deviceInfo();
            Service1SoapClient test1       = new Service1SoapClient();
            string             productType = devInfo.GetProductType(productSN);
            string             filePathAll = filePath + fileName;

            using (FileStream fileStream = new FileStream(filePathAll, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                // 读取文件的 byte[]
                byte[] bytes = new byte[fileStream.Length];
                fileStream.Read(bytes, 0, bytes.Length);
                fileStream.Close();

                /*
                 *          // 把 byte[] 转换成 Stream
                 *          Stream stream = new MemoryStream(bytes);
                 *          byte[] bytes = new byte[stream.Length];
                 *          stream.Read(bytes, 0, bytes.Length);
                 *      // 设置当前流的位置为流的开始
                 *          stream.Seek(0, SeekOrigin.Begin);
                 */
                try
                {
                    ret = test1.CollectDevice_MES_Doc_New(reporter, deviceInfo.deviceCode, productType, productSN, docType, deviceInfo.folderId, fileName, bytes, Ext, Time);
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(ret);
        }
        public List <Budget> GetAll()
        {
            try
            {
                Service1SoapClient client     = service.GetClient();
                object[]           argumentos = new object[1];
                var     data    = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_CONSULTA_PRESUPUESTO", argumentos).Any1;
                DataSet dataSet = ConvertUtils.XmlToDataSet(data.InnerXml);
                if (dataSet.Tables.Count > 0)
                {
                    List <Budget> budgets = new List <Budget>();
                    foreach (DataRow row in dataSet.Tables[0].Rows)
                    {
                        Budget budget = new Budget
                        {
                            Id           = Convert.ToInt32(row.ItemArray[0].ToString()),
                            CustomerId   = row.ItemArray[1].ToString(),
                            Total        = Convert.ToInt32(row.ItemArray[2].ToString()),
                            Date         = Convert.ToDateTime(row.ItemArray[3]),
                            CustomerName = row.ItemArray[4].ToString(),
                        };

                        budgets.Add(budget);
                    }
                    return(budgets);
                }

                return(new List <Budget>());
            }
            catch (Exception e)
            {
                Console.WriteLine("Error " + e);
                return(new List <Budget>());
            }
        }
 public List <Product> GetAll()
 {
     try
     {
         Service1SoapClient client     = service.GetClient();
         object[]           argumentos = new object[3];
         var            data           = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_CONSULTA_PRODUCTO", argumentos).Any1;
         DataSet        dataSet        = ConvertUtils.XmlToDataSet(data.InnerXml);
         List <Product> Products       = new List <Product>();
         if (dataSet.Tables.Count > 0)
         {
             foreach (DataRow row in dataSet.Tables[0].Rows)
             {
                 Product Product = new Product
                 {
                     Id    = Convert.ToInt32(row.ItemArray[0].ToString()),
                     Name  = row.ItemArray[1].ToString(),
                     Cost  = Convert.ToDouble(row.ItemArray[2].ToString()),
                     Price = Convert.ToDouble(row.ItemArray[3].ToString()),
                     Stock = Convert.ToInt32(row.ItemArray[4].ToString()),
                 };
                 Products.Add(Product);
             }
         }
         return(Products);
     }
     catch (System.Exception e)
     {
         Console.WriteLine("Error " + e);
         return(new List <Product>());
     }
 }
Exemplo n.º 4
0
 public List <Customer> GetAll()
 {
     try
     {
         Service1SoapClient client     = service.GetClient();
         object[]           argumentos = new object[3];
         var             data          = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_CONSULTA_CLIENTE", argumentos).Any1;
         DataSet         dataSet       = ConvertUtils.XmlToDataSet(data.InnerXml);
         List <Customer> customers     = new List <Customer>();
         if (dataSet.Tables.Count > 0)
         {
             foreach (DataRow row in dataSet.Tables[0].Rows)
             {
                 Customer customer = new Customer
                 {
                     Id             = Convert.ToInt32(row.ItemArray[0].ToString()),
                     DocumentType   = row.ItemArray[1].ToString(),
                     DocumentNumber = row.ItemArray[2].ToString(),
                     FirstName      = row.ItemArray[3].ToString(),
                     LastName       = row.ItemArray[4].ToString(),
                     Email          = row.ItemArray[5].ToString(),
                 };
                 customers.Add(customer);
             }
         }
         return(customers);
     }
     catch (System.Exception e)
     {
         Console.WriteLine("Error " + e);
         return(new List <Customer>());
     }
 }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet dsResult = new DataSet();
            try
            {

                var demdata = new Service1SoapClient();

                DataSet ds = demdata.GetDocumentazione();

                DataTable dt = ds.Tables[0];
                byte[] bytes = (byte[])dt.Rows[0]["Documento"];

                ByteToImage(bytes);

                //System.Drawing.ImageConverter imageConverter = new System.Drawing.ImageConverter();
                //System.Drawing.Image image = imageConverter.ConvertFrom(bytes) as System.Drawing.Image;
                //System.Drawing.Bitmap b = new System.Drawing.Bitmap(image);
                //b.Save("D:\tets", System.Drawing.Imaging.ImageFormat.Jpeg);
                //b.Dispose();

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Service1SoapClient PROXY = new Service1SoapClient();

            double res = PROXY.calculersupstraction(56, 3);

            Console.WriteLine(res);
        }
Exemplo n.º 7
0
 public Form1()
 {
     InitializeComponent();
     //populate();
     //Serialize();
     Deserialize();
     RefreshTestSuits();
     sc=new Service1SoapClient();
 }
Exemplo n.º 8
0
 private void btnClick(object sender, EventArgs e)
 {
     
     Service1SoapClient MyService = new Service1SoapClient();
     
     DataSet ds = MyService.GetData();
     
     dataGrid.DataSource = ds.Tables["Barcodes"];
 }
Exemplo n.º 9
0
 public void HelloWorldTest()
 {
     Service1SoapClient target = new Service1SoapClient(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.HelloWorld();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 10
0
 private void GetFile(object sender, EventArgs e)
 {
     Service1SoapClient StringWS = new Service1SoapClient();
     StringWriterWS.ArticleFile test = StringWS.StringReader("Vare.csv", @"\\SRV-DIV-04\CSV$\Data\");
     MessageBox.Show(test.AllLines[1]);
     MessageBox.Show(test.AllLines[2]);
     MessageBox.Show(test.Name);
     
 }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            using (ServiceEsteban.Service1SoapClient client = new Service1SoapClient())
            {
                string valor = client.GetInfoNombrePropietarioCupon("AF54HT98");

                Console.WriteLine(valor);
                Console.Read();
            }
        }
Exemplo n.º 12
0
        public int Login(string username, string password)
        {
            object[] argumentos = new object[2];
            argumentos[0] = username;
            argumentos[1] = password;
            Service1SoapClient client = service.GetClient();
            var data = client.f_usuario_login(username, password);

            return(int.Parse(data.ToString()));
        }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            Service1SoapClient proxy = new Service1SoapClient();


            double resultat = proxy.CalculSoustraction(56, 3);

            Console.WriteLine("resultat est :" + resultat);
            Console.ReadKey();
        }
Exemplo n.º 14
0
        private void GoGoGo(object sender, EventArgs e)
        {
            Service1SoapClient StringWS = new Service1SoapClient();

            if (StringWS.StringWriter(Text_txt.Text, Filename_txt.Text, Location_txt.Text))
                MessageBox.Show("OK");
            else
                MessageBox.Show("Fejl");

        }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            using (ServiceEsteban.Service1SoapClient client = new Service1SoapClient())
            {

                string valor = client.GetInfoNombrePropietarioCupon("AF54HT98");

                Console.WriteLine(valor);
                Console.Read();
            }
        }
Exemplo n.º 16
0
        public Budget GetById(int id)
        {
            try
            {
                Service1SoapClient client     = service.GetClient();
                object[]           argumentos = new object[1];
                argumentos[0] = id;
                var     data    = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_PRESUPUESTO_POR_ID", argumentos).Any1;
                DataSet dataSet = ConvertUtils.XmlToDataSet(data.InnerXml);

                if (dataSet.Tables.Count > 0)
                {
                    // Cabecera
                    DataRow row    = dataSet.Tables[0].Rows[0];
                    Budget  budget = new Budget
                    {
                        Id            = Convert.ToInt32(row.ItemArray[0].ToString()),
                        CustomerId    = row.ItemArray[1].ToString(),
                        Total         = Convert.ToInt32(row.ItemArray[2].ToString()),
                        Date          = Convert.ToDateTime(row.ItemArray[3]),
                        CustomerName  = row.ItemArray[4].ToString(),
                        CustomerEmail = row.ItemArray[5].ToString(),
                    };


                    // Detalles
                    object[] argumentosD = new object[1];
                    argumentos[0] = budget.Id;
                    var     dataD                = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_PRESUPUESTO_DETALLES", argumentos).Any1;
                    DataSet dataSetD             = ConvertUtils.XmlToDataSet(dataD.InnerXml);
                    List <BudgetDetails> details = new List <BudgetDetails>();
                    foreach (DataRow item in dataSetD.Tables[0].Rows)
                    {
                        BudgetDetails detail = new BudgetDetails();
                        detail.Id          = int.Parse(item.ItemArray[0].ToString());
                        detail.ProductId   = int.Parse(item.ItemArray[1].ToString());
                        detail.Description = item.ItemArray[2].ToString();
                        detail.Quantity    = int.Parse(item.ItemArray[3].ToString());
                        detail.Price       = item.ItemArray[4].ToString();
                        detail.Total       = int.Parse(item.ItemArray[5].ToString());
                        details.Add(detail);
                    }
                    budget.Details = details;
                    return(budget);
                }
                return(new Budget());
            }
            catch (System.Exception e)
            {
                Console.WriteLine("Error " + e);
                return(new Budget());
            }
        }
Exemplo n.º 17
0
        public Service1SoapClient GetInstance()
        {
            BasicHttpBinding myBinding = new BasicHttpBinding();

            myBinding.MaxBufferPoolSize      = 2147483647;
            myBinding.MaxReceivedMessageSize = 2147483647;

            EndpointAddress    myEndpoint    = new EndpointAddress(DefaultEndpoint);
            Service1SoapClient serviceClient = new Service1SoapClient(myBinding, myEndpoint);

            return(serviceClient);
        }
Exemplo n.º 18
0
        public int Add(Budget budget)
        {
            try
            {
                Service1SoapClient client     = service.GetClient();
                object[]           argumentos = new object[2];
                argumentos[0] = budget.CustomerId;
                argumentos[1] = budget.Total;
                var     data     = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_INSERTAR_PRESUPUESTO", argumentos).Any1;
                DataSet dataSet  = ConvertUtils.XmlToDataSet(data.InnerXml);
                int     budgetId = 0;
                if (dataSet.Tables.Count > 0)
                {
                    DataRow row     = dataSet.Tables[0].Rows[0];
                    Budget  budget1 = new Budget
                    {
                        Id         = Convert.ToInt32(row.ItemArray[0].ToString()),
                        CustomerId = row.ItemArray[1].ToString(),
                        Total      = Convert.ToInt32(row.ItemArray[2].ToString()),
                        Date       = Convert.ToDateTime(row.ItemArray[3]),
                    };
                    budgetId = budget1.Id;
                }

                if (budgetId > 0)
                {
                    // Insertamos los detalles
                    foreach (var item in budget.Details)
                    {
                        object[] argumentosD = new object[6];
                        argumentosD[0] = budgetId;
                        argumentosD[1] = item.ProductId;
                        argumentosD[2] = item.Description;
                        argumentosD[3] = item.Quantity;
                        argumentosD[4] = item.Price;
                        argumentosD[5] = item.Total;
                        var     dataD    = client.DTcallProcedure("TECHNICAL.PKG_PRESUPUESTO.SP_INS_PRESUPUESTO_DETALLE", argumentosD).Any1;
                        DataSet dataSetD = ConvertUtils.XmlToDataSet(dataD.InnerXml);
                    }
                    return(budgetId);
                }
                return(0);
            }
            catch (System.Exception e)
            {
                Console.WriteLine("Error " + e);
                return(0);
            }
        }
Exemplo n.º 19
0
 protected void lbVerificar_Click(object sender, EventArgs e)
 {
     Service1SoapClient obj = new Service1SoapClient();
     PersonaDTO p = obj.buscarpersonaPorDNI(TextBox7.Text, 1);
     if (p != null)
     {
         TextBox1.Text = p.txNomb;
         TextBox6.Text = p.txMail;
         TextBox4.Text = p.txNumDocu;
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "mensaje('El usuario no se encuentra registrado');", true);
     }
 }
Exemplo n.º 20
0
        public Service1SoapClient GetClient()
        {
            var Uri = "http://15.222.249.125:1501/ws_technical/Service1.asmx";

            BasicHttpBinding binding = new BasicHttpBinding();
            EndpointAddress  address = new EndpointAddress(Uri);

            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
            binding.Security.Transport.ProxyCredentialType  = HttpProxyCredentialType.None;

            binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;

            Service1SoapClient soapClient = new Service1SoapClient(binding, address);

            return(soapClient);
        }
Exemplo n.º 21
0
        private string NewData_Service(string reporter, string productSN, string propertyName, string propertyValue, string Ext, string Time)
        {
            string             ret         = "ERROR";
            deviceInfo         devInfo     = new deviceInfo();
            Service1SoapClient test1       = new Service1SoapClient();
            string             productType = devInfo.GetProductType(productSN);

            try
            {
                ret = test1.CollectDevice_MES_ProcessData_New(reporter, deviceInfo.deviceCode, productType, productSN, propertyName, propertyValue, Ext, Time);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(ret);
        }
Exemplo n.º 22
0
        private string ErrNotify_Service(string reporter, string problemType, string Ext, string Time)
        {
            // deviceInfo devInfo = new deviceInfo;
            Service1SoapClient test1 = new Service1SoapClient();
            string             ret;

            //string productSN = devInfo.GetProductType(
            try
            {
                ret = test1.CollectDevice_MES_TPMData_New(reporter, deviceInfo.deviceCode, problemType, Ext, Time);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(ret);
        }
Exemplo n.º 23
0
 private void ConvertFileToStream(string docType, string sFile)
 {
     try
     {
         Service1SoapClient sc            = new Service1SoapClient();
         FileStream         objfilestream = new FileStream(sFile, FileMode.Open, FileAccess.Read);
         int    len         = (int)objfilestream.Length;
         Byte[] mybytearray = new Byte[len];
         objfilestream.Read(mybytearray, 0, len);
         sc.SaveDocument(mybytearray, sFile.Remove(0, sFile.LastIndexOf("\\") + 1), docType);
         objfilestream.Close();
     }
     catch (Exception)
     {
         MessageBox.Show("Error in file:" + sFile);
         //throw;
     }
 }
 private async void Button_LogIn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Service1SoapClient web_service = new Service1SoapClient();
         string answer = await web_service.LogInAsync(TextBox_Username.Text, TextBox_Password.Password);
         if (answer.ToLower().Equals("success"))
         {
             NavigationService.Navigate(new Uri("/Authenticated.xaml", UriKind.Relative));
         }
         else
         {
             MessageBox.Show("The log-in details are invalid!");
         }
     catch (<ExceptionType> e)
     {
         // ... handle exception here
     }
 }
Exemplo n.º 25
0
        private void buttonGetWeather_Click(object sender, EventArgs e)
        {
            GetWeatherRequest req = new GetWeatherRequest();

            if (radioButtonCelsius.Checked)
            {
                req.TemperatureType = TemperatureType.Celsius;
            }
            else
            {
                req.TemperatureType = TemperatureType.Fahrenheit;
            }
            req.City = textCity.Text;

            Service1SoapClient client = new Service1SoapClient();
            GetWeatherResponse resp   = client.GetWeather(req);

            textWeatherCondition.Text = resp.Condition.ToString();
            textTemperature.Text      = resp.Temperature.ToString();
        }
Exemplo n.º 26
0
        private string EndJob_Service(string reporter, string productSN, string Ext, string Time)
        {
            string             ret;
            deviceInfo         devInfo     = new deviceInfo();
            Service1SoapClient test1       = new Service1SoapClient();
            string             productType = devInfo.GetProductType(productSN);

            try
            {
                if (jobNew > 0)
                {
                    jobNew--;
                    string ret1 = test1.CollectDevice_MES_ControlJob_New(reporter, deviceInfo.deviceCode, productType, productSN, deviceInfo.operationGroup, Ext, "1", Time);
                }
                ret = test1.CollectDevice_MES_EndJob_New(reporter, deviceInfo.deviceCode, productType, productSN, deviceInfo.operationGroup, Ext, Time);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(ret);
        }
Exemplo n.º 27
0
        private string StartJob_Service(string reporter, string productSN, string Ext, string Time)
        {
            deviceInfo         devInfo     = new deviceInfo();
            Service1SoapClient test1       = new Service1SoapClient();
            string             productType = devInfo.GetProductType(productSN);

            jobNew++;
            string ret;

            try
            {
                ret = test1.CollectDevice_MES_StartJob_New(reporter, deviceInfo.deviceCode, productType, productSN, deviceInfo.operationGroup, Ext, Time);
                if (ret == "OK")
                {
                    string ret1 = test1.CollectDevice_MES_ControlJob_New(reporter, deviceInfo.deviceCode, productType, productSN, deviceInfo.operationGroup, Ext, "0", Time);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(ret);
        }
Exemplo n.º 28
0
        private void button2_Click(object sender, EventArgs e)
        {
            var soapClient = new Service1SoapClient();

            guestbookDataGridView.DataSource = soapClient.RetrieveGuestBookData();
        }
Exemplo n.º 29
0
        private void button1_Click(object sender, EventArgs e)
        {
            var soapClient = new Service1SoapClient();

            soapClient.SignGuestBook( userNametextBox.Text, userMessageTextBox.Text );
        }
Exemplo n.º 30
0
 public void Service1SoapClientConstructorTest()
 {
     string endpointConfigurationName = string.Empty; // TODO: Initialize to an appropriate value
     EndpointAddress remoteAddress = null; // TODO: Initialize to an appropriate value
     Service1SoapClient target = new Service1SoapClient(endpointConfigurationName, remoteAddress);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (cmbEPoints.SelectedIndex > 0)
            {
                WSClient wsClient;
                wsClient = new WSClient(IRConfiguration.GetEndPointByName(cmbEPoints.SelectedValue).IREndPoint);
                ssClient = wsClient.GetClient();
            }

            lblNewName.DataBind();
            lblNewPassword.DataBind();
            lblNewSurname.DataBind();
            lblNewUserName.DataBind();
            btnSaveNewUser.DataBind();
            if (!Page.IsPostBack)
            {
                Utils.PopulateCmbEndPoint(cmbEPoints);
                cmbEPoints.Items.Insert(0, "");
                Utils.PopulateCmbAgencySchemes(cmbAgencies);
                PopulateAgenciesGrid();
            }
        }
Exemplo n.º 32
0
        private void Submit_Click(object sender, RoutedEventArgs e)
        {
            Submit.IsEnabled=false;
            UpLoad.IsEnabled=false;
            FileList.IsEnabled=false;
            Progress.Text = "Starting";
            numberOfFiles = files.Count;

            client = new Service1SoapClient();
            client.AddFileCompleted +=new EventHandler<AddFileCompletedEventArgs>(client_AddFileCompleted);
            client.InitCompleted +=new EventHandler<InitCompletedEventArgs>(client_InitCompleted);
            client.InitAsync();
        }
Exemplo n.º 33
0
 public Service1SoapClient(EndpointConfiguration endpointConfiguration) :
     base(Service1SoapClient.GetBindingForEndpoint(endpointConfiguration), Service1SoapClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Exemplo n.º 34
0
 public void Service1SoapClientConstructorTest3()
 {
     Service1SoapClient target = new Service1SoapClient();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 35
0
 public void GetDataTest()
 {
     Service1SoapClient target = new Service1SoapClient(); // TODO: Initialize to an appropriate value
     DataSet expected = null; // TODO: Initialize to an appropriate value
     DataSet actual;
     actual = target.GetData();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 36
0
        /// <summary>
        /// AddAuthor - Используйте "AddAuthorParams" для передачи параметров в этот метод.
        /// </summary>
        public void AddAuthor()
        {
            #region Variable Declarations
            WinButton uIAuthorManagementButton = this.UISandboxWindow.UIToolStrip1ToolBar.UIAuthorManagementButton;
            WinEdit uITxtAddAuthorEdit = this.UIAuthorsWindow.UITxtAddAuthorWindow.UITxtAddAuthorEdit;
            WinButton uIAddButton = this.UIAuthorsWindow.UIAddWindow.UIAddButton;
            WinButton uIЗакрытьButton = this.UIAuthorsWindow.UIAuthorsTitleBar.UIЗакрытьButton;
            #endregion

            // Щелчок "Author Management" кнопка
            Mouse.Click(uIAuthorManagementButton, new Point(14, 11));

            // Щелчок "Author Management" кнопка
            Mouse.Click(uIAuthorManagementButton, new Point(14, 11));

            // Тип "Stanislav Lem" в "txtAddAuthor" надпись
            uITxtAddAuthorEdit.Text = this.AddAuthorParams.UITxtAddAuthorEditText;

            // Щелчок "Add" кнопка
            Mouse.Click(uIAddButton, new Point(19, 10));

            // Щелчок "Закрыть" кнопка
            Mouse.Click(uIЗакрытьButton, new Point(8, 9));

            Service1SoapClient sc = new Service1SoapClient();
            Author a = sc.GetAuthor(this.AddAuthorParams.UITxtAddAuthorEditText);
            Assert.AreEqual(this.AddAuthorParams.UITxtAddAuthorEditText, a.Name);
        }
Exemplo n.º 37
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button4_Click(object sender, EventArgs e)
        {
            LearningObjectContextModel ctx = new LearningObjectContextModel();

            OntoLearningObject obj = new OntoLearningObject();
            ctx.LearningObject_ID = txtID.Text;
            ctx.MediaFormat =  txtMediaFormat.Text;
            ctx.MediaType = cmbMediaType.SelectedItem.ToString();
            ctx.Title = txtTitle.Text;
            ctx.MoodleCommunity = TxtLOComunidade.Text;
            ctx.Link = txtLink.Text;
            ctx.ObjectLearningStyle = cmbLearningStyle.SelectedItem.ToString();
            ctx.Description = txtDescription.Text;
            ctx.Idiom = cmbIdiom.SelectedItem.ToString();
            ctx.Size = txtSize.Text;
            ctx.KeywordsList = txtkeyword.Text;

            var json = new JavaScriptSerializer().Serialize(ctx);
            Console.WriteLine(json);
               //WebServiceSoapClient.Service1 webSevice = new WebServiceSoapClient.Service1();
               //webSevice.SaveLearningObjectinOntology(json);

            this.Cursor = Cursors.WaitCursor;
            ServiceReference3.Service1SoapClient soa = new Service1SoapClient();
            soa.SaveLearningObjectinOntology(json);
            this.Cursor = Cursors.Default;
        }
Exemplo n.º 38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Service1SoapClient sc = new Service1SoapClient();

            Page.Response.Write(sc.HelloWorld());
        }
Exemplo n.º 39
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            Service1SoapClient sc = new Service1SoapClient();

            progressBar1.Enabled = true;
            progressBar1.Minimum = 1;
            progressBar1.Maximum = 100;
            progressBar1.Step    = 10;
            progressBar1.PerformStep();


            PdfDocument doc   = new PdfDocument();
            int         count = 0;

            string[] FilenameName;
            /***Final Output file folder***/
            string appPath    = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            string exportPath = appPath + "\\Uploads";
            bool   exists     = System.IO.Directory.Exists(exportPath);

            if (!exists)
            {
                System.IO.Directory.CreateDirectory(exportPath);
            }

            /****End***/

            /***Create Temp folder just processing purpose*/
            string tempPath    = exportPath + "\\Temp"; // your code goes here
            bool   checkfolder = System.IO.Directory.Exists(tempPath);

            if (!checkfolder)
            {
                System.IO.Directory.CreateDirectory(tempPath);
            }
            /*****End****/
            progressBar1.PerformStep();

            foreach (string item in openFileDialog1.FileNames)
            {
                FilenameName = item.Split('\\');
                string   extension    = Path.GetExtension(FilenameName[FilenameName.Length - 1]).ToLower();
                string   fullfilename = Path.GetFileName(FilenameName[FilenameName.Length - 1]);
                string[] filename     = fullfilename.Split('.');
                string   filePath     = tempPath + "\\" + filename[0];
                if (extension == ".jpg" || extension == ".jpeg" || extension == ".gif")
                {
                    Conversion.PDFConversion.ConvertTOPdf("IMAGE", item, filePath, ref doc, count);
                }
                else if (extension == ".xls" || extension == ".xlsx")
                {
                    // Conversion.PDFConversion.ConvertTOPdf("EXCEL", item, filePath, ref doc, 0);
                    sc.ConvertTOPdf("EXCEL", item, filePath);
                }
                else if (extension == ".txt")
                {
                    Conversion.PDFConversion.ConvertTOPdf("TEXT", item, filePath, ref doc, count);
                }
                else if (extension == ".doc" || extension == ".docx")
                {
                    Conversion.PDFConversion.ConvertTOPdf("DOC", item, filePath, ref doc, 0);
                }
                count++;
            }
            progressBar1.PerformStep();
            Conversion.PDFConversion con = new PDFConversion();
            con.PDfMer(tempPath, exportPath);

            Directory.Delete(tempPath, true);


            progressBar1.Value   = 100;
            progressBar1.Enabled = false;
            progressBar1.PerformStep();
        }
Exemplo n.º 40
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            /**Progress Bar***/
            progressBar1.Enabled = true;
            progressBar1.Minimum = 1;
            progressBar1.Maximum = 100;
            progressBar1.Step    = 10;
            progressBar1.PerformStep();
            /**End**/

            BasicHttpBinding binding = new BasicHttpBinding();

            binding.MaxBufferPoolSize      = 2147483647;
            binding.MaxBufferSize          = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;
            string          url     = System.Configuration.ConfigurationSettings.AppSettings["webserviceURL"];
            EndpointAddress address = new EndpointAddress(url);

            Service1SoapClient sc = new Service1SoapClient(binding, address);


            try
            {
                PdfDocument doc   = new PdfDocument();
                int         count = 0;
                string[]    FilenameName;
                string      exportPath = "";
                /***Final Output file folder***/
                if (lblOutpath.Text == "")
                {
                    string appPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
                    exportPath = appPath + "\\Uploads";
                    bool exists = System.IO.Directory.Exists(exportPath);
                    if (!exists)
                    {
                        System.IO.Directory.CreateDirectory(exportPath);
                    }
                }
                else
                {
                    exportPath = lblOutpath.Text;
                }
                /****End***/


                progressBar1.PerformStep();

                foreach (string item in openFileDialog1.FileNames)
                {
                    FilenameName = item.Split('\\');
                    string   extension    = Path.GetExtension(FilenameName[FilenameName.Length - 1]).ToLower();
                    string   fullfilename = Path.GetFileName(FilenameName[FilenameName.Length - 1]);
                    string[] filename     = fullfilename.Split('.');
                    if (extension == ".jpg" || extension == ".jpeg" || extension == ".gif")
                    {
                        ConvertFileToStream("IMAGE", item);
                    }
                    else if (extension == ".xls" || extension == ".xlsx")
                    {
                        ConvertFileToStream("EXCEL", item);
                    }
                    else if (extension == ".txt")
                    {
                        ConvertFileToStream("TEXT", item);
                    }
                    else if (extension == ".doc" || extension == ".docx")
                    {
                        ConvertFileToStream("DOC", item);
                    }
                    else if (extension == ".pdf")
                    {
                        ConvertFileToStream("pdf", item);
                    }
                    count++;
                    progressBar1.PerformStep();
                }
                progressBar1.PerformStep();
                Conversion.PDFConversion con = new PDFConversion();


                var documentContents = sc.MergDocuments();
                saveFinalDocuments(documentContents, exportPath);

                progressBar1.Value   = 100;
                progressBar1.Enabled = false;
                progressBar1.PerformStep();
                MessageBox.Show("File Created on location:" + exportPath);
            }
            catch (Exception)
            {
                MessageBox.Show("Error exists during file conversions");
                // throw;
            }
        }
Exemplo n.º 41
0
 public void Service1SoapClientConstructorTest1()
 {
     Binding binding = null; // TODO: Initialize to an appropriate value
     EndpointAddress remoteAddress = null; // TODO: Initialize to an appropriate value
     Service1SoapClient target = new Service1SoapClient(binding, remoteAddress);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 42
0
        public string GetProductType(string productSN)
        {
            Service1SoapClient test1 = new Service1SoapClient();

            return(test1.ReturnDevice_SN_Info(region, productSN));
        }
Exemplo n.º 43
0
 public Service1SoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(Service1SoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            string username = "******";
            string password = "******";

            if(e.Argument.ToString()=="DS")
            {
                int? dUpdateStatus = DirectoryUpdateStatus.GetLastVersion("All");

                try
                {

                    HCMIS.Desktop.DirectoryServices.Service1SoapClient sc = new HCMIS.Desktop.DirectoryServices.Service1SoapClient();

                    long newLastVersionDS = sc.GetLastVersion(username, password);

                    if (!dUpdateStatus.HasValue || dUpdateStatus.Value != newLastVersionDS)
                    {
                        //Proxy.ABC.SaveList(sc.GetABCs(username, password, dUpdateStatus, null));
                        //Proxy.VEN.SaveList(sc.GetVENs(username, password, dUpdateStatus, null));
                        //Proxy.CommodityType.SaveList(sc.GetCommodityTypes(username, password, dUpdateStatus, null));
                        //Proxy.DosageForm.SaveList(sc.GetDosageForms(username, password, dUpdateStatus, null));
                        //Proxy.Product.SaveList(sc.GetProducts(username, password, dUpdateStatus, null));
                        //Proxy.Unit.SaveList(sc.GetUnits(username, password, dUpdateStatus, null));
                        //Proxy.Program.SaveList(sc.GetPrograms(username, password, dUpdateStatus, null));
                        //Proxy.Manufacturer.SaveList(sc.GetManufacturer(username, password, dUpdateStatus, null));
                        //Proxy.Supplier.SaveList(sc.GetSuppliers(username, password, dUpdateStatus, null));
                        //Proxy.StoreType.SaveList(sc.GetModes(username, password, dUpdateStatus, null));
                        //Proxy.StoreGroup.SaveList(sc.GetAccounts(username, password, dUpdateStatus, null));
                        //Proxy.StoreGroupDivision.SaveList(sc.GetSubAccounts(username, password, dUpdateStatus, null));
                        //Proxy.Stores.SaveList(sc.GetSubSubAccounts(username, password, dUpdateStatus, null));
                        //Proxy.ItemUnit.SaveList(sc.GetItemUnitsWithUnitDetail(username, password, dUpdateStatus, null));
                        //Proxy.Items.SaveList(sc.GetDrugItems(username, password, dUpdateStatus, null));
                        //Proxy.Items.SaveList(sc.GetSupplyItems(username, password, dUpdateStatus, null));
                        //Proxy.DrugCategory.SaveList(sc.GetDrugCategory(username, password, dUpdateStatus, null));
                        //Proxy.DrugSubCategory.SaveList(sc.GetDrugSubCategory(username, password, dUpdateStatus, null));
                        //Proxy.SupplyCategory.SaveList(sc.GetSupplyCategories(username, password, dUpdateStatus, null));
                        //Proxy.ItemSupplyCategory.SaveList(sc.GetItemSupplyCategories(username, password, dUpdateStatus, null));
                        //Proxy.DrugItemSubCategory.SaveList(sc.GetDrugItemSubCategory(username, password, dUpdateStatus, null));
                        ////Proxy.ItemProgram.SaveList(sc.GetItemPrograms(username, password, dUpdateStatus, null));
                        //Proxy.ItemUnit.SaveList(sc.GetItemUnitsWithUnitDetail(username, password, dUpdateStatus, null));
                        //Proxy.ItemManufacturer.SaveList(sc.GetItemManufacturers(username, password, dUpdateStatus, null));
                        DirectoryUpdateStatus.SaveLastVersion("All", Convert.ToInt32(newLastVersionDS));
                    }
                }
                catch (Exception exp)
                {
                    string message = "";

                    if (CurrentContext.LoggedInUser.UserType == UserType.Constants.SUPER_ADMINISTRATOR)
                    {
                        message = exp.Message;
                    }
                    else
                    {
                        message = "Please check the network connection and try again.";
                    }
                    e.Result = message;
                }
            }

            else if(e.Argument.ToString()=="GL")
            {
                int? gLUpdateStatus = DirectoryUpdateStatus.GetLastVersion("GL");
                try
                {
                    HCMIS.Desktop.GeneralLookups.Service1SoapClient glSC = new Service1SoapClient();
                    long newLastVersionGL = glSC.GetLastVersion(username, password);
                    if (!gLUpdateStatus.HasValue || gLUpdateStatus.Value != newLastVersionGL)
                    {
                        //Proxy.Region.SaveList(glSC.GetRegions(username, password, gLUpdateStatus, null));
                        //Proxy.Zone.SaveList(glSC.GetZones(username, password, gLUpdateStatus, null));
                        //Proxy.Woreda.SaveList(glSC.GetWoredas(username, password, gLUpdateStatus, null));
                        DirectoryUpdateStatus.SaveLastVersion("GL", Convert.ToInt32(newLastVersionGL));
                    }
                }
                catch (Exception exp)
                {
                    string message = "";

                    if (CurrentContext.LoggedInUser.UserType == UserType.Constants.SUPER_ADMINISTRATOR)
                    {
                        message = exp.Message;
                    }
                    else
                    {
                        message = "Please check the network connection and try again.";
                    }
                    e.Result = message;
                }
            }
        }
Exemplo n.º 45
0
 public WSClient(string endPointAddress)
 {
     BasicHttpBinding binding = new BasicHttpBinding();
     EndpointAddress address = new EndpointAddress(endPointAddress);
     _client = new Service1SoapClient(binding, address);
 }
 protected void btnCalcular_Click(object sender, EventArgs e)
 {
     Service1SoapClient service1 = new Service1SoapClient();
     lblresultado.Text = service1.Soma(Convert.ToInt32(txtValor1.Text), Convert.ToInt32(txtValor2.Text)).ToString();
 }
Exemplo n.º 47
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddIdentity <User, IdentityRole>(cfg =>
            {
                cfg.Tokens.AuthenticatorTokenProvider = TokenOptions.DefaultAuthenticatorProvider;
                cfg.User.RequireUniqueEmail           = false;
                cfg.Password.RequireDigit             = false;
                cfg.Password.RequiredUniqueChars      = 0;
                cfg.Password.RequireLowercase         = false;
                cfg.Password.RequireNonAlphanumeric   = false;
                cfg.Password.RequireUppercase         = false;
            })
            .AddDefaultTokenProviders()
            .AddEntityFrameworkStores <DataContext>();
            //


            //////
            services.ConfigureApplicationCookie(options =>
            {
                //options.LoginPath = "/Account/NotAuthorized";
                options.LoginPath          = "/Account/Login";
                options.AccessDeniedPath   = "/Account/NotAuthorized";
                options.ExpireTimeSpan     = TimeSpan.FromMinutes(20);
                options.ReturnUrlParameter = CookieAuthenticationDefaults.ReturnUrlParameter;
                options.SlidingExpiration  = true;
            });
            ////
            ///
            services.AddAuthentication()
            //.AddCookie(options => {
            //    options.LoginPath = "/Account/Login/";
            //    options.SlidingExpiration = false;
            //    options.ExpireTimeSpan = TimeSpan.FromMinutes(1);
            //})
            .AddCookie()
            .AddJwtBearer(cfg =>
            {
                cfg.TokenValidationParameters = new TokenValidationParameters
                {
                    ValidIssuer      = this.Configuration["Tokens:Issuer"],
                    ValidAudience    = this.Configuration["Tokens:Audience"],
                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(this.Configuration["Tokens:Key"]))
                };
            });


            services.AddDbContext <DataContext>(cfg =>
            {
                cfg.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"));
            });


            services.AddSingleton(_env.ContentRootFileProvider); //Inject IFileProvider

            //services.AddSingleton<IFileProvider>(
            //        new PhysicalFileProvider($"{Directory.GetCurrentDirectory()}\\wwwroot\\Files\\Analisis"));

            services.AddTransient <SeedDb>();               //
            services.AddScoped <IUserHelper, UserHelper>(); //
            services.AddScoped <IDatosRepository, DatosRepository>();
            services.AddScoped <IMailHelper, MailHelper>();
            services.AddScoped <ITiposAnalisis, TiposAnalisis>();
            services.AddScoped <ICombosHelper, CombosHelper>();
            services.AddScoped <IFileHelper, FileHelper>();

            services.AddScoped <IAnalisisRepository, AnalisisRepository>();
            services.AddScoped <INovedadesRepository, NovedadesRepository>();
            services.AddScoped <ITramitesRepository, TramitesRepository>();
            services.AddScoped <ICapacitacionesRepository, CapacitacionesRepository>();

            services.AddScoped <ILogRepository, LogRepository>();
            //services.AddSingleton<ILog, LogNLog>();


            services.AddScoped <IVehiculoProvGpsRepository, VehiculoProvGpsRepository>();
            services.AddScoped <IVehiculoGpsRepository, VehiculoGpsRepository>();
            services.AddScoped <IIncidenciasRepository, IncidenciasRepository>();
            services.AddScoped <IGamaRepository, GamaRepository>();
            services.AddScoped <ILocationWorldRepository, LocationWorldRepository>();
            services.AddScoped <IIturanRepository, IturanRepository>();
            services.AddScoped <IAccesosRepository, AccesosRepository>();

            services.AddHttpContextAccessor();
            services.TryAddSingleton <IActionContextAccessor, ActionContextAccessor>();

            var url = Configuration["WsdlUser"];

            services.AddScoped <Service1Soap>(provider =>
            {
                BasicHttpBinding result       = new BasicHttpBinding();
                result.MaxBufferSize          = int.MaxValue;
                result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
                result.MaxReceivedMessageSize = int.MaxValue;
                result.AllowCookies           = true;
                result.MaxBufferPoolSize      = int.MaxValue;
                //result.Security = BasicHttpSecurityMode.None;

                var client = new Service1SoapClient(

                    //new BasicHttpBinding(BasicHttpSecurityMode.None),
                    result,
                    new EndpointAddress(url));
                return(client);
            });

            var url1 = Configuration["WsdlData"];

            services.AddScoped <WSDLCondelpiData.Service1Soap>(provider =>
            {
                BasicHttpBinding result       = new BasicHttpBinding();
                result.MaxBufferSize          = int.MaxValue;
                result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
                result.MaxReceivedMessageSize = int.MaxValue;
                result.AllowCookies           = true;
                result.MaxBufferPoolSize      = int.MaxValue;

                var client1 = new WSDLCondelpiData.Service1SoapClient(
                    //new BasicHttpBinding(BasicHttpSecurityMode.None),
                    result,
                    new EndpointAddress(url1));
                return(client1);
            });

            //servicios
            services.AddTransient <Microsoft.Extensions.Hosting.IHostedService, UpdateProvGpsService>();
            services.AddTransient <Microsoft.Extensions.Hosting.IHostedService, UpdateCGBService>();
            services.AddTransient <Microsoft.Extensions.Hosting.IHostedService, UpdateLWDeviceIDService>();
            services.AddTransient <Microsoft.Extensions.Hosting.IHostedService, UpdateIturanService>();

            services.AddMvc(properties =>
            {
                properties.ModelBinderProviders.Insert(0, new JsonModelBinderProvider());
            });
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
Exemplo n.º 48
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            string username = "******";
            string password = "******";

            if (e.Argument.ToString() == "DS")
            {
                int?dUpdateStatus = DirectoryUpdateStatus.GetLastVersion("All");

                try
                {
                    HCMIS.Desktop.DirectoryServices.Service1SoapClient sc = new HCMIS.Desktop.DirectoryServices.Service1SoapClient();

                    long newLastVersionDS = sc.GetLastVersion(username, password);

                    if (!dUpdateStatus.HasValue || dUpdateStatus.Value != newLastVersionDS)
                    {
                        //Proxy.ABC.SaveList(sc.GetABCs(username, password, dUpdateStatus, null));
                        //Proxy.VEN.SaveList(sc.GetVENs(username, password, dUpdateStatus, null));
                        //Proxy.CommodityType.SaveList(sc.GetCommodityTypes(username, password, dUpdateStatus, null));
                        //Proxy.DosageForm.SaveList(sc.GetDosageForms(username, password, dUpdateStatus, null));
                        //Proxy.Product.SaveList(sc.GetProducts(username, password, dUpdateStatus, null));
                        //Proxy.Unit.SaveList(sc.GetUnits(username, password, dUpdateStatus, null));
                        //Proxy.Program.SaveList(sc.GetPrograms(username, password, dUpdateStatus, null));
                        //Proxy.Manufacturer.SaveList(sc.GetManufacturer(username, password, dUpdateStatus, null));
                        //Proxy.Supplier.SaveList(sc.GetSuppliers(username, password, dUpdateStatus, null));
                        //Proxy.StoreType.SaveList(sc.GetModes(username, password, dUpdateStatus, null));
                        //Proxy.StoreGroup.SaveList(sc.GetAccounts(username, password, dUpdateStatus, null));
                        //Proxy.StoreGroupDivision.SaveList(sc.GetSubAccounts(username, password, dUpdateStatus, null));
                        //Proxy.Stores.SaveList(sc.GetSubSubAccounts(username, password, dUpdateStatus, null));
                        //Proxy.ItemUnit.SaveList(sc.GetItemUnitsWithUnitDetail(username, password, dUpdateStatus, null));
                        //Proxy.Items.SaveList(sc.GetDrugItems(username, password, dUpdateStatus, null));
                        //Proxy.Items.SaveList(sc.GetSupplyItems(username, password, dUpdateStatus, null));
                        //Proxy.DrugCategory.SaveList(sc.GetDrugCategory(username, password, dUpdateStatus, null));
                        //Proxy.DrugSubCategory.SaveList(sc.GetDrugSubCategory(username, password, dUpdateStatus, null));
                        //Proxy.SupplyCategory.SaveList(sc.GetSupplyCategories(username, password, dUpdateStatus, null));
                        //Proxy.ItemSupplyCategory.SaveList(sc.GetItemSupplyCategories(username, password, dUpdateStatus, null));
                        //Proxy.DrugItemSubCategory.SaveList(sc.GetDrugItemSubCategory(username, password, dUpdateStatus, null));
                        ////Proxy.ItemProgram.SaveList(sc.GetItemPrograms(username, password, dUpdateStatus, null));
                        //Proxy.ItemUnit.SaveList(sc.GetItemUnitsWithUnitDetail(username, password, dUpdateStatus, null));
                        //Proxy.ItemManufacturer.SaveList(sc.GetItemManufacturers(username, password, dUpdateStatus, null));
                        DirectoryUpdateStatus.SaveLastVersion("All", Convert.ToInt32(newLastVersionDS));
                    }
                }
                catch (Exception exp)
                {
                    string message = "";

                    if (CurrentContext.LoggedInUser.UserType == UserType.Constants.SUPER_ADMINISTRATOR)
                    {
                        message = exp.Message;
                    }
                    else
                    {
                        message = "Please check the network connection and try again.";
                    }
                    e.Result = message;
                }
            }

            else if (e.Argument.ToString() == "GL")
            {
                int?gLUpdateStatus = DirectoryUpdateStatus.GetLastVersion("GL");
                try
                {
                    HCMIS.Desktop.GeneralLookups.Service1SoapClient glSC = new Service1SoapClient();
                    long newLastVersionGL = glSC.GetLastVersion(username, password);
                    if (!gLUpdateStatus.HasValue || gLUpdateStatus.Value != newLastVersionGL)
                    {
                        //Proxy.Region.SaveList(glSC.GetRegions(username, password, gLUpdateStatus, null));
                        //Proxy.Zone.SaveList(glSC.GetZones(username, password, gLUpdateStatus, null));
                        //Proxy.Woreda.SaveList(glSC.GetWoredas(username, password, gLUpdateStatus, null));
                        DirectoryUpdateStatus.SaveLastVersion("GL", Convert.ToInt32(newLastVersionGL));
                    }
                }
                catch (Exception exp)
                {
                    string message = "";

                    if (CurrentContext.LoggedInUser.UserType == UserType.Constants.SUPER_ADMINISTRATOR)
                    {
                        message = exp.Message;
                    }
                    else
                    {
                        message = "Please check the network connection and try again.";
                    }
                    e.Result = message;
                }
            }
        }