/// <summary>
        /// Deze methode geeft een lijst van opmerkingen door naar de web service.
        /// De web service gebruikt deze gegevens om een .CSV-bestand te maken
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void BtnOpslaan_Click(object sender, RoutedEventArgs e)
        {
            btnSynchroniseren.IsEnabled = false;
            prSynchroniseren.IsActive = true;
            lblBoodschap.Text = "Even geduld. Gegevens worden op dit moment verstuurd...";
            lblBoodschap.Visibility = Windows.UI.Xaml.Visibility.Visible;

            if (!swtManierOpslag.IsOn)
            {
                try
                {
                    await CopyFiles.copyPhotosToUSB();
                    await CopyFiles.copyVideosToUSB();
                    if (await LocalDB.database.SynchroniseerNaarUSB())
                    {
                        lblBoodschap.Text = "De gegevens zijn met succes verstuurd naar de USB!";
                    }
                    else
                    {
                        lblBoodschap.Text = "Er is iets fout gelopen. Controleer of u een opslagmedium ingestoken heeft...";
                    }
                }
                catch(Exception)
                {
                    lblBoodschap.Text = "Er is iets fout gelopen. Controleer of u een opslagmedium ingestoken heeft...";
                }
            }
            else
            {
                await CopyFiles.copyPhotosViaNetwork();
                await CopyFiles.copyVideosViaNetwork();

                List<String> lijstGegevens = new List<String>();
                List<Comment> opmerkingen = await OverzichtOpmerkingen.GetOverzichtComments();

                List<string> lijstStringGegevens = new List<string>();
                foreach (Comment opmerking in opmerkingen)
                {
                    lijstStringGegevens.Add("Chauffeur: " + opmerking.Chauffeur +
                        ", OpmperkingID: " + opmerking.Id.ToString() +
                        ", Aangemaakt op: " + opmerking.Datum.ToString("dd/MM/yyyy HH:mm") +
                        ", Objectcode: " + opmerking.ObjectCode +
                        ", Defectcode: " + opmerking.DefectCode +
                        ", Omschrijving: " + opmerking.Omschrijving);
                }

                ArrayOfString aosGegevens = new ArrayOfString(); //Een ArrayOfString is nodig voor de web service
                aosGegevens.AddRange(lijstStringGegevens);

                var avAuto = await LocalDB.database.GetToegewezenAuto();

                string datum = String.Format("Wagen {0} - {1}-{2}-{3} {4}h{5}m", avAuto.Number, DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year,
                                                                                DateTime.Now.Hour, DateTime.Now.Minute);

                string bestandsNaam = String.Format("{0} opmerkingen.csv", datum);

                //await CopyFiles.copyVideosViaNetwork();
                lblBoodschap.Text = "Videos uploaden";

                if (await LocalDB.database.SetMaakSVCvoorWebSync(aosGegevens, bestandsNaam))
                {
                    lblBoodschap.Text = "De gegevens zijn met succes verstuurd naar de server!";
                }
                else
                {
                    lblBoodschap.Text = "Er is iets fout gelopen. Controleer of u met het juiste netwerk verbonden bent...";
                }
 
            }

            btnSynchroniseren.IsEnabled = true;
            prSynchroniseren.IsActive = false;
        }
        public void populateDataGridView()
        {
            List <string> list  = new List <string>();
            ArrayOfString array = new ArrayOfString();

            array.AddRange(list);
            service.dataProgramarii(ref array);
            string day, hour, data1;
            int    positionCol = 0, positionRow = 0;

            foreach (var el in array)
            {
                string[] data = el.Split(' ');
                day  = data[0];
                hour = data[1];
                for (int i = 1; i < 6; i++)
                {
                    if (dataGridView1.Columns[i].Name == day)
                    {
                        positionCol = i;
                    }
                }
                for (int i = 0; i < 8; i++)
                {
                    if (dataGridView1.Rows[i].Cells[0].Value.ToString() == hour)
                    {
                        positionRow = i;
                    }
                }
                string recuperata = dataGridView1.Rows[positionRow].Cells[positionCol].Value.ToString();
                data1 = recuperata + "\n" + "dr. " + data[2] + " " + data[3] + "\nPacient: " + " " + data[4] + " " + data[5];
                dataGridView1.Rows[positionRow].Cells[positionCol].Value           = data1;
                dataGridView1.Rows[positionRow].Cells[positionCol].Style.BackColor = changeColor();
            }
        }
Beispiel #3
0
        public static string Get(string url, Dictionary <string, string> data = null)
        {
            try
            {
                var dts = new ArrayOfString();
                if (data != null)
                {
                    dts.AddRange(data.Select(dt => $"{dt.Key}={dt.Value}"));
                }

                if (dts.Count > 0)
                {
                    url += "?" + dts.Join("&");
                }
                var httpClient = new HttpClient(url)
                {
                    Verb = HttpVerb.GET
                };
                var result = httpClient.GetString();
                return(result);
            }
            catch (Exception e)
            {
                Log.Error($"请求服务器异常 Get:{url},{e}");
                return("fail");
            }
        }
Beispiel #4
0
 public ArrayOfString GetPropertiesAsArrayOfString(Type type)
 {
   PropertyInfo[] propertyInfos = type.GetProperties();
   List<string> items = new List<string>();
   string propertyType = string.empty;
   
   for (int x = 0; x < propertyInfos.count(); x++)
   {
     switch propertyInfos[x].PropertyType.ToString())
     {
       case "System.String":
            propertyType = "String";
            break;
       case "System.DataTime":
            propertyType = "DateTime";
            break;
       case "System.Int32":
            propertyType = "Int32";
            break;
     }
   
     items.Add(propertyInfos[x].Name + "|" + propertyType);
   }
      
   ArrayOfString properties = new ArrayOfString();
   properties.AddRange(items);
   return properties
 }
Beispiel #5
0
        public static void GetAsync(string url, Dictionary <string, string> data = null, GetCallBack callBack = null)
        {
            var dts = new ArrayOfString();

            if (data != null)
            {
                dts.AddRange(data.Select(dt => $"{dt.Key}={dt.Value}"));
            }

            if (dts.Count > 0)
            {
                url += "?" + dts.Join("&");
            }
            var httpClient = new HttpClient(url)
            {
                Verb = HttpVerb.GET
            };

            httpClient.AsyncGetString((ss, e) =>
            {
                if (e == null)
                {
                    callBack?.Invoke(ss, null);
                }
                else
                {
                    ss = "fail";
                    callBack?.Invoke(ss, e);
                    Log.Error($"请求服务器异常 GetAsync:{url},{e}");
                }
            });
        }
Beispiel #6
0
        public void DeleteResults(List <string> lstGuids)
        {
            ArrayOfString aos = new ArrayOfString();

            aos.AddRange(lstGuids);

            m_dbClient.DeleteResults(aos);
        }
Beispiel #7
0
        public void DeleteSecurityConditions(string actionGuid, List <string> conditionGuids)
        {
            ArrayOfString aos = new ArrayOfString();

            aos.AddRange(conditionGuids);

            m_dbClient.DeleteConditionsOfAction(actionGuid, aos);
        }
 /// <summary> adds (or replaces) a tuple. </summary>
 /// <returns> true if something was added (not replaced). </returns>
 public override bool Enter(string[] tuple)
 {
     // do asynchronous call
     ArrayOfString corrected = new ArrayOfString();
     corrected.AddRange(tuple);
     _service.EnterAsync(corrected);
     // wait for result and return it
     return (bool)_asyncResult.Value;
 }
Beispiel #9
0
        public List <LogRecord> GetAppLogs(string appGuid, string tableGuid, List <string> lstRecordGuids)
        {
            ArrayOfString aos = new ArrayOfString();

            aos.AddRange(lstRecordGuids);

            return(LogTypeConvert.FromLogRecordPlus(appGuid, tableGuid, m_dbClient.GetAppLogsByLogGuid(appGuid, tableGuid,
                                                                                                       aos)));
        }
Beispiel #10
0
        public bool MustReinstal(Dictionary <string, Version> clientVersions)
        {
            ArrayOfString keys     = new ArrayOfString();
            ArrayOfString versions = new ArrayOfString();

            keys.AddRange(clientVersions.Keys);
            versions.AddRange(clientVersions.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value.ToString()));
            return(UpdaterService.MustReinstal(keys, versions));
        }
 /// <summary> removes tuples. </summary>
 /// <returns> returns true if something was removed. </returns>
 public override bool Remove(string[] keys)
 {
     // do asynchronous call
     ArrayOfString corrected = new ArrayOfString();
     corrected.AddRange(keys);
     _service.RemoveAsync(corrected);
     // wait for result and return it
     return (bool)_asyncResult.Value;
 }
        /// <summary>
        /// Gets the data.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="columns">The columns.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns>Broobu.SweNet.Contract.Domain.SweNetDataSet.</returns>
        public SweNetDataSet GetData(string sessionId, string tableName, string[] columns, DateTime startDate, DateTime endDate)
        {
            ArrayOfString columnsArray = new ArrayOfString();
            columnsArray.AddRange(columns);
            ISwenetDataSet res = SweNetAdapter
                .Proxy
                .getData(sessionId, tableName, columnsArray, startDate, endDate);
            return res.ToSweNetDataSet();

        }
Beispiel #13
0
        public void TestMethodAdjuntarIdentificacion()
        {
            var varios = new List <string> {
                "Luke", "Tatooine"
            }.ToList();
            ArrayOfString array = new ArrayOfString();

            array.AddRange(varios);
            Assert.IsTrue(_prueba.AdjuntarIdentificacion(array));
        }
        /// <summary>
        /// Gets the data.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="columns">The columns.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns>Broobu.SweNet.Contract.Domain.SweNetDataSet.</returns>
        public SweNetDataSet GetData(string sessionId, string tableName, string[] columns, DateTime startDate, DateTime endDate)
        {
            ArrayOfString columnsArray = new ArrayOfString();

            columnsArray.AddRange(columns);
            ISwenetDataSet res = SweNetAdapter
                                 .Proxy
                                 .getData(sessionId, tableName, columnsArray, startDate, endDate);

            return(res.ToSweNetDataSet());
        }
Beispiel #15
0
        public async Task <IActionResult> CreatedTable(string tablename, int fieldsnumber)
        {
            Models.TableModel tableModel = new Models.TableModel
            {
                Name = tablename,
                NumberOfAttributes = fieldsnumber
            };

            List <String>           valuesToInsert = new List <String>();
            List <Models.Attribute> listValues     = new List <Models.Attribute>();

            for (int i = 0; i < fieldsnumber; i++)
            {
                var field = new Models.Attribute
                {
                    Name = Request.Form[String.Format("{0} {1}", "fieldName", i)],
                    Type = Request.Form[String.Format("{0} {1}", "fieldType", i)]
                };
                listValues.Add(field);


                valuesToInsert.Add(Request.Form[field.Name]);
            }
            tableModel.Attributes = listValues;


            WebServiceSoapClient.EndpointConfiguration endpointConfiguration = WebServiceSoapClient.EndpointConfiguration.WebServiceSoap;
            var client = new WebServiceSoapClient(endpointConfiguration);

            if (valuesToInsert[0] != null)
            {
                var arrString = new ArrayOfString();
                arrString.AddRange(valuesToInsert);
                var tmp = await client.AddToTableInBDAsync(tableModel.ConvertToServiceModel(), arrString);

                if (tmp.Body.AddToTableInBDResult)
                {
                    return(View(tableModel));
                }
                return(View("Error"));
            }
            else
            {
                var tmp = await client.CreateTableInBDAsync(tableModel.ConvertToServiceModel());

                if (tmp.Body.CreateTableInBDResult)
                {
                    return(View(tableModel));
                }
                return(View("Error"));
            }
        }
        public void GivenUserHabitatUserRolesWithUPasswordCreatedInHabitat(string username, string password, Table table)
        {
            var roles = new ArrayOfString();

            roles.AddRange(table.Rows.Select(x => x.Values.First()));

            ContextExtensions.UtfService.CreateUser(username, password, roles, "*****@*****.**");
            cleanupPool.Add(new TestCleanupAction
            {
                ActionType = ActionType.RemoveUser,
                Payload    = username
            });
        }
        /********************************************************************************************************
        * You may want to add more wrapper methods like the ones below and make the client variable private
        ********************************************************************************************************/


        /// <summary>
        /// Search for items on the EQUELLA server.  Consult the SOAP API documentation for more information on the values of
        /// the parameters and return result.
        /// </summary>
        /// <param name="query"></param>
        /// <param name="where"></param>
        /// <param name="onlylive"></param>
        /// <param name="sorttype"></param>
        /// <param name="reversesort"></param>
        /// <param name="offset"></param>
        /// <param name="maxresults"></param>
        /// <returns></returns>
        public XElement SearchItems(string query, string[] collectionUuids, string where, bool onlylive, int sorttype, bool reversesort, int offset, int maxresults)
        {
            ArrayOfString collectionArray = null;

            if (collectionUuids != null)
            {
                collectionArray = new ArrayOfString();
                collectionArray.AddRange(collectionUuids);
            }
            return(NewXElement(
                       client.searchItems(
                           query, collectionArray, where, onlylive, sorttype, reversesort, offset, maxresults)
                       ));
        }
 public void MSCPSWS_S03_TC02_ProviderSchemas()
 {
     // Get the provider names of all the providers from the hierarchy
     ArrayOfString providerNames = new ArrayOfString();
     SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
     providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
     foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
     {
         this.DepthFirstTraverse(node, ref providerNames);
     }
     
     // Get schemas of the claims providers specified in the list of provider names in the request.
     SPProviderSchema[] responseOfProviderSchemaResult = CPSWSAdapter.ProviderSchemas(providerNames);
     Site.Assert.IsNotNull(responseOfProviderSchemaResult, "The schemas of the specific claims providers should not be null!");
 }
Beispiel #19
0
        public void MSCPSWS_S03_TC02_ProviderSchemas()
        {
            // Get the provider names of all the providers from the hierarchy
            ArrayOfString providerNames = new ArrayOfString();

            SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
            providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
            foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
            {
                this.DepthFirstTraverse(node, ref providerNames);
            }

            // Get schemas of the claims providers specified in the list of provider names in the request.
            SPProviderSchema[] responseOfProviderSchemaResult = CPSWSAdapter.ProviderSchemas(providerNames);
            Site.Assert.IsNotNull(responseOfProviderSchemaResult, "The schemas of the specific claims providers should not be null!");
        }
Beispiel #20
0
        public static ResponseInfo SendSmsold(string fromId, List <string> destphoneNumbers, string message, DateTime deliveryDate)
        {
            var dest = new ArrayOfString();

            dest.AddRange(destphoneNumbers);
            var messageinfo = new MessageInfo();

            messageinfo.CallBack    = fromId;
            messageinfo.Destination = dest;
            messageinfo.Message     = message;
            messageinfo.MessageType = SMSTypeEnum.TEXT;
            //messageinfo.DeliveryEmail = deliveryDate.AddMonths(-1).ToString("DD MMM yyyy hh:mm tt");
            var sms = Svc.SendSMS(_token, messageinfo);

            return(sms);
        }
Beispiel #21
0
        public bool AreNewVersionsAvailable(Dictionary <string, Version> clientVersions, out Dictionary <string, Version> newAvailableVersions)
        {
            ArrayOfString keys = new ArrayOfString();

            keys.AddRange(clientVersions.Keys);
            FileWithVersion[]            _versions = UpdaterService.GetVersions(keys);
            Dictionary <string, Version> versions  = new Dictionary <string, Version>();

            foreach (FileWithVersion fileWithVersion in _versions)
            {
                if (!string.IsNullOrEmpty(fileWithVersion.Version))
                {
                    versions.Add(fileWithVersion.File, new Version(fileWithVersion.Version));
                }
                //_versions.Select(_v => string.IsNullOrEmpty(_v) ? null : new Version(_v)).ToList();
            }


            newAvailableVersions = new Dictionary <string, Version>();

            int i = 0;

            foreach (KeyValuePair <string, Version> kvp in clientVersions)
            {
                Version serverVersion = versions.ContainsKey(kvp.Key) ? kvp.Value : null;
                Version clientVersion = kvp.Value;

                if (serverVersion != null)
                {
                    if (serverVersion > clientVersion)
                    {
                        newAvailableVersions[kvp.Key] = serverVersion;
                    }
                }
                i++;
            }

            foreach (KeyValuePair <string, Version> kvp in versions)
            {
                if (!clientVersions.ContainsKey(kvp.Key))
                {
                    newAvailableVersions[kvp.Key] = kvp.Value;
                }
            }

            return(newAvailableVersions.Count > 0);
        }
Beispiel #22
0
        /// <summary>
        /// 读取数据块集合的值
        /// </summary>
        /// <param name="ItemNames">数据块集合</param>
        /// <returns></returns>
        public static List <object> ReadValueSerial(List <string> ItemNames)
        {
            ArrayOfString itemNames = new ArrayOfString();

            itemNames.AddRange(ItemNames);
            try
            {
                using (ASRS_ServiceSoapClient srv = new ASRS_ServiceSoapClient())
                {
                    return(srv.OPC_Read(itemNames));
                }
            }
            catch (Exception ex)
            {
                return(new List <object>());
            }
        }
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string pLname, pFName, mLname = " ", mFname = " ", descriere = " ";

            service.dateMedic(this.cnp, ref mLname, ref mFname);
            pLname = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
            pFName = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
            List <string> list  = new List <string>();
            ArrayOfString array = new ArrayOfString();

            array.AddRange(list);
            service.antecedenteMedicale(pLname, pFName, ref array, mLname, mFname);
            //  var l = array.Take(array.Count - 1).ToList();
            service.problemaCurenta(pLname, pFName, mLname, mFname, ref descriere);
            listBox1.DataSource = array;
            textBox1.Text       = descriere;
        }
        private void spec_btn_Click(object sender, EventArgs e)
        {
            if (spec_groupBox.Visible == false)
            {
                List <string> list      = new List <string>();
                ArrayOfString arrString = new ArrayOfString();
                arrString.AddRange(list);
                service.listSpecialization(ref arrString);

                listBox1.DataSource   = arrString;
                med_btn.Visible       = true;
                m_groupBox.Visible    = false;
                spec_groupBox.Visible = true;
            }
            else if (spec_groupBox.Visible == true)
            {
                spec_groupBox.Visible = false;
            }
        }
        private void med_btn_Click(object sender, EventArgs e)
        {
            if (m_groupBox.Visible == false)
            {
                List <string> list      = new List <string>();
                ArrayOfString arrString = new ArrayOfString();
                arrString.AddRange(list);
                string spec = listBox1.SelectedItem.ToString();
                service.DoctorsfromSpecialization(spec, ref arrString);

                m_list.DataSource = arrString;

                spec_groupBox.Visible = false;
                m_groupBox.Visible    = true;
            }
            else if (m_groupBox.Visible == true)
            {
                m_groupBox.Visible = false;
            }
        }
Beispiel #26
0
        public void EnvioEmailCancelamentoMassa(tCancelamentoLoteFila item, string atendente, string formaDevolucao)
        {
            IngressoBO         iBO       = new IngressoBO();
            CancelamentoLoteBO cBO       = new CancelamentoLoteBO();
            List <tIngresso>   ingressos = iBO.Listar(item.Ingressos.Select(x => x.IngressoID).ToList());

            List <CancelamentoLoteMailModel> mailModel = ado.CarregarCamposEmail(item.VendaBilheteriaID);

            string motivo = cBO.Consultar(item.CancelamentoLoteID).MotivoCancelamento;

            MailServiceSoapClient service      = new MailServiceSoapClient();
            ArrayOfString         codIngressos = new ArrayOfString();

            codIngressos.AddRange(ingressos.Select(x => string.Format("<li>Ingresso: {0} - Evento: {1} - Data: {2}</li>",
                                                                      x.Codigo,
                                                                      (x.tEvento != null) ? x.tEvento.Nome : string.Empty,
                                                                      (x.tApresentacao != null) ? x.tApresentacao.HorarioAsDateTime.ToString("dd/MM/yyyy HH:mm") : string.Empty)
                                                   ).ToList());
            service.EnviarEmailCancelamentoMassa(mailModel[0].Cliente, mailModel[0].Email, mailModel[0].Senha, atendente, mailModel[0].Data.ToString("dd/MM/yyyy HH:mm"), mailModel[0].Canal, string.Join(",", mailModel.Select(x => x.Pagamento).ToList()), mailModel[0].Evento, motivo, formaDevolucao, codIngressos, mailModel[0].DescricaoEmail);
        }
        public void populatedataGridView()
        {
            string mLName = " ", mFName = " ", mcnp = this.cnp;

            service.dateMedic(mcnp, ref mLName, ref mFName);

            List <string> list  = new List <string>();
            ArrayOfString array = new ArrayOfString();

            array.AddRange(list);
            service.listaPacientiProgramati(mLName, mFName, ref array);
            string[] data;
            string   date;

            foreach (var el in array)
            {
                data = el.Split(' ');
                date = data[2] + " " + data[3];
                dataGridView1.Rows.Add(data[0], data[1], date);
            }
        }
Beispiel #28
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrWhiteSpace(textBox1.Text) && !String.IsNullOrWhiteSpace(textBox2.Text))
            {
                var datos = new List <string> {
                    textBox1.Text, textBox2.Text
                }.ToList();

                ArrayOfString identificacion = new ArrayOfString();

                _clienteImperial.AdjuntarRebelde(textBox1.Text);
                _clienteImperial.AdjuntarPlaneta(textBox2.Text);

                identificacion.AddRange(datos);

                _clienteImperial.AdjuntarIdentificacion(identificacion);
            }
            else
            {
                Log.Error("No se ha procedido a la insercíon de datos " + DateTime.Now);
                MessageBox.Show("No puedes dejarlo vacio ni con espacios en blanco");
            }
        }
Beispiel #29
0
        public void TestMethodCrearEscribirTxt()
        {
            bool   prueba = false;
            string path = Directory.GetCurrentDirectory() + @"\InfoAvistamientoRebelde.txt";
            var    varios = new List <string> {
                "Luke", "Tatooine"
            }.ToList();
            ArrayOfString array = new ArrayOfString();

            array.AddRange(varios);

            if (!File.Exists(path))
            {
                // Write each directory name to a file.
                using (StreamWriter sw = File.CreateText(path))
                {
                    foreach (var item in array)
                    {
                        sw.WriteLine("rebeld " + item[1] + "on " + item[2]);
                        prueba = true;
                    }
                }
            }
            else
            {
                using (StreamWriter sw = new StreamWriter(path))
                {
                    foreach (var item in array)
                    {
                        sw.WriteLine("rebeld " + item[1] + "on " + item[2]);
                        prueba = true;
                    }
                }
            }

            Assert.IsTrue(prueba);
        }
        public void MSCPSWS_S05_TC04_SearchAll_nullSearchPattern()
        {
            // Get the provider names of all the providers from the hierarchy
            ArrayOfString providerNames = new ArrayOfString();

            SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
            providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
            foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
            {
                this.DepthFirstTraverse(node, ref providerNames);
            }

            // Set search principal Type.
            SPPrincipalType principalType = SPPrincipalType.SharePointGroup;

            // Get max count of matched entities allowed to return for this search.
            int maxCount = Convert.ToInt32(Common.GetConfigurationPropertyValue("MaxCount", Site));

            bool caughtException = false;

            try
            {
                // Set searchPattern as null and call searchAll.
                CPSWSAdapter.SearchAll(providerNames, principalType, null, maxCount);
            }
            catch (System.ServiceModel.FaultException faultException)
            {
                caughtException = true;

                // Verify Requirement 650, if the server returns an ArgumentNullException<"searchPattern"> message.
                Site.CaptureRequirementIfIsTrue(this.VerifyArgumentNullException(faultException, "searchPattern"), 650, @"[In SearchAll] If this [searchPattern] is NULL, the protocol server MUST return an ArgumentNullException<""searchPattern""> message.");
            }
            finally
            {
                this.Site.Assert.IsTrue(caughtException, "If searchPattern is NULL, the protocol server MUST return an ArgumentNullException<searchPattern> message.");
            }
        }
Beispiel #31
0
        protected async Task <IEnumerable <TicketInfo> > GetTicketsAsync(Int32 take, params String[] nameEqualsValue)
        {
            var tickets        = new List <TicketInfo>();
            var searchCriteria = new ArrayOfString();

            if (!(nameEqualsValue is null) && nameEqualsValue.Length > 0)
            {
                searchCriteria.AddRange(nameEqualsValue);
            }

            // Unassigned Tickets
            var response = await Service.GetTicketsBySearchAsync(Config.AuthUserName, Config.AuthPassword, new ArrayOfString()
            {
                "sortorder=ascending", "userid=1"
            }).ConfigureAwait(false);

            tickets.AddRange(response.Body.GetTicketsBySearchResult.Tickets);
            // Assigned Tickets
            response = await Service.GetTicketsBySearchAsync(Config.AuthUserName, Config.AuthPassword, searchCriteria).ConfigureAwait(false);

            tickets.AddRange(response.Body.GetTicketsBySearchResult.Tickets);

            return(tickets.OrderByDescending(t => t.LastReplyDateUtc).Take(take));
        }
        public void MSCPSWS_S05_TC01_Search()
        {
            // Set principal type for search.
            SPPrincipalType principalType = SPPrincipalType.SecurityGroup;

            // Generate ArrayOfSPProviderSearchArguments.
            List<SPProviderSearchArguments> arrayOfSPProviderSearchArguments = new List<SPProviderSearchArguments>();

            Site.Assume.IsNotNull(this.GenerateProviderSearchArgumentsInput_Valid(), "There should be a valid provider search arguments!");
            SPProviderSearchArguments providerSearchArguments = this.GenerateProviderSearchArgumentsInput_Valid();
            arrayOfSPProviderSearchArguments.Add(providerSearchArguments);

            Site.Assume.IsNotNull(TestSuiteBase.SearchPattern, "The search pattern should not be null!");

            // Call Search operation.
            SPProviderHierarchyTree[] responseOfSearchResult = CPSWSAdapter.Search(arrayOfSPProviderSearchArguments.ToArray(), principalType, TestSuiteBase.SearchPattern);

            Site.Assert.IsNotNull(responseOfSearchResult, "The search result MUST be not null.");
            Site.Assert.IsTrue(responseOfSearchResult.Length >= 1, "The search result MUST contain at least one claims provider.");

            // Get the input provider names list.
            ArrayOfString providerNames = new ArrayOfString();
            providerNames.AddRange(arrayOfSPProviderSearchArguments.Select(root => root.ProviderName));

            // Requirement capture condition.
            bool searchSuccess = false;
            
            foreach (SPProviderHierarchyTree providerTree in responseOfSearchResult)
            {
                if (providerTree.ProviderName.StartsWith(Common.GetConfigurationPropertyValue("HierarchyProviderPrefix", this.Site)))
                {
                    if (providerNames.Contains(providerTree.ProviderName))
                    {
                        searchSuccess = true;
                    }
                    else
                    {
                        // Jump over the Hierarchy Provider tree that the server sees fit to return together with the result Claims provider trees.
                        continue;
                    }
                }               
                else if (providerNames.Contains(providerTree.ProviderName))
                {
                    searchSuccess = true;
                }
                else 
                {
                    Site.Assert.Fail("The provider names in the search result should be contained in the provider names in the input message!");
                }
            }
            
            // Capture requirement 378 by matching the input provider name with the result claims provider name,
            // The search input claims provider already satisfy the condition 1 and 3 in requirement 378 in test environment configuration.
            Site.CaptureRequirementIfIsTrue(
                searchSuccess, 
                378, 
                @"[In Search] The protocol server MUST search across all claims providers that meet all the following criteria:
                The claims providers are associated with the Web application (1) specified in the input message.
                The claims providers are listed in the provider search arguments in the input message.
                The claims providers support search.");

            // Capture requirement 398 by matching searchPattern with the result claims provider's Nm attribute.
            Site.CaptureRequirementIfIsTrue(searchSuccess, 398, @"[In Search] searchPattern: The protocol server MUST search for the string in each claims provider.");

            // Capture requirement 404 by matching searchPattern with the result claims provider's Nm attribute.
            Site.CaptureRequirementIfIsTrue(searchSuccess, 404, @"[In SearchResponse] The protocol server MUST return one claims provider hierarchy tree for each claims provider that contains entities that match the search string.");
        }
Beispiel #33
0
        /// <summary>
        /// Deze methode geeft een lijst van opmerkingen door naar de web service.
        /// De web service gebruikt deze gegevens om een .CSV-bestand te maken
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void BtnOpslaan_Click(object sender, RoutedEventArgs e)
        {
            btnSynchroniseren.IsEnabled = false;
            prSynchroniseren.IsActive   = true;
            lblBoodschap.Text           = "Even geduld. Gegevens worden op dit moment verstuurd...";
            lblBoodschap.Visibility     = Windows.UI.Xaml.Visibility.Visible;

            if (!swtManierOpslag.IsOn)
            {
                try
                {
                    await CopyFiles.copyPhotosToUSB();

                    await CopyFiles.copyVideosToUSB();

                    if (await LocalDB.database.SynchroniseerNaarUSB())
                    {
                        lblBoodschap.Text = "De gegevens zijn met succes verstuurd naar de USB!";
                    }
                    else
                    {
                        lblBoodschap.Text = "Er is iets fout gelopen. Controleer of u een opslagmedium ingestoken heeft...";
                    }
                }
                catch (Exception)
                {
                    lblBoodschap.Text = "Er is iets fout gelopen. Controleer of u een opslagmedium ingestoken heeft...";
                }
            }
            else
            {
                await CopyFiles.copyPhotosViaNetwork();

                await CopyFiles.copyVideosViaNetwork();

                List <String>  lijstGegevens = new List <String>();
                List <Comment> opmerkingen   = await OverzichtOpmerkingen.GetOverzichtComments();

                List <string> lijstStringGegevens = new List <string>();
                foreach (Comment opmerking in opmerkingen)
                {
                    lijstStringGegevens.Add("Chauffeur: " + opmerking.Chauffeur +
                                            ", OpmperkingID: " + opmerking.Id.ToString() +
                                            ", Aangemaakt op: " + opmerking.Datum.ToString("dd/MM/yyyy HH:mm") +
                                            ", Objectcode: " + opmerking.ObjectCode +
                                            ", Defectcode: " + opmerking.DefectCode +
                                            ", Omschrijving: " + opmerking.Omschrijving);
                }

                ArrayOfString aosGegevens = new ArrayOfString(); //Een ArrayOfString is nodig voor de web service
                aosGegevens.AddRange(lijstStringGegevens);

                var avAuto = await LocalDB.database.GetToegewezenAuto();

                string datum = String.Format("Wagen {0} - {1}-{2}-{3} {4}h{5}m", avAuto.Number, DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year,
                                             DateTime.Now.Hour, DateTime.Now.Minute);

                string bestandsNaam = String.Format("{0} opmerkingen.csv", datum);

                //await CopyFiles.copyVideosViaNetwork();
                lblBoodschap.Text = "Videos uploaden";

                if (await LocalDB.database.SetMaakSVCvoorWebSync(aosGegevens, bestandsNaam))
                {
                    lblBoodschap.Text = "De gegevens zijn met succes verstuurd naar de server!";
                }
                else
                {
                    lblBoodschap.Text = "Er is iets fout gelopen. Controleer of u met het juiste netwerk verbonden bent...";
                }
            }

            btnSynchroniseren.IsEnabled = true;
            prSynchroniseren.IsActive   = false;
        }
        /// <summary> finds matching tuples. </summary>
        /// <returns> words to be shown in each field. </returns>
        public override string[][] Search(string[] keys)
        {
            // do asynchronous call
            ArrayOfString corrected = new ArrayOfString();
            corrected.AddRange(keys);
            _service.SearchAsync(corrected);

            // wait for result and transform it
            ArrayOfString[] result = (ArrayOfString[])_asyncResult.Value;
            string[][] correctedResult = new string[result.Length][];
            for (int i = 0; i < result.Length; ++i) {
                correctedResult[i] = result[i].ToArray();
            }

            return correctedResult;
        }
Beispiel #35
0
    public void GivenUserHabitatUserRolesWithUPasswordCreatedInHabitat(string username, string password, Table table)
    {
      var roles = new ArrayOfString();
      roles.AddRange(table.Rows.Select(x => x.Values.First()));

      ContextExtensions.UtfService.CreateUser(username, password, roles, "*****@*****.**");
      cleanupPool.Add(new TestCleanupAction
      {
        ActionType = ActionType.RemoveUser,
        Payload = username
      });
    }
        public void MSCPSWS_S05_TC03_SearchAll()
        {
            // Get the provider names of all the providers from the hierarchy
            ArrayOfString providerNames = new ArrayOfString();
            SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
            providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
            foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
            {
                this.DepthFirstTraverse(node, ref providerNames);
            }

            // Set search principal Type.
            SPPrincipalType principalType = SPPrincipalType.SecurityGroup;

            // Get the searchPattern string as SearchAll input
            this.GenerateSearchAllInput_Valid();

            // Get max count of matched entities allowed to return for this search.
            int maxCount = Convert.ToInt32(Common.GetConfigurationPropertyValue("MaxCount", Site));

            Site.Assume.IsNotNull(TestSuiteBase.SearchPattern, "The search pattern should not be null!");

            // Search the first claims provider tree which has a child.
            SPProviderHierarchyTree[] responseOfSearchResult = CPSWSAdapter.SearchAll(providerNames, principalType, TestSuiteBase.SearchPattern, maxCount);

            // Requirement capture condition.
            bool searchAllSuccess = false;

            foreach (SPProviderHierarchyTree providerTree in responseOfSearchResult)
            {
                if (providerTree.ProviderName.StartsWith(Common.GetConfigurationPropertyValue("HierarchyProviderPrefix", this.Site)))
                {
                    if (providerNames.Contains(providerTree.ProviderName))
                    {
                        searchAllSuccess = true;
                    }
                    else
                    {
                        // Jump over the Hierarchy Provider tree that the server sees fit to return together with the result Claims provider trees.
                        continue;
                    }
                }
                else if (providerNames.Contains(providerTree.ProviderName))
                {
                    searchAllSuccess = true;
                }
                else
                {
                    Site.Assert.Fail("The provider names in the SearchAll result should be contained in the provider names in the input message!");
                }
            }

            // Capture requirement 417 by matching the input provider name with the result claims provider name,
            // The search input claims provider already satisfy the condition 1 and 3 in requirement 417 in test environment configuration.
            Site.CaptureRequirementIfIsTrue(
                searchAllSuccess, 
                417, 
                @"[In SearchAll] The protocol server MUST search across all claims providers that meet all the following criteria:
                The claims providers are associated with the Web application (1) specified in the input message.
                The claims providers are listed in the provider names in the input message.
                The claims providers support search.");
        }
        public void MSCPSWS_S05_TC04_SearchAll_nullSearchPattern()
        {
            // Get the provider names of all the providers from the hierarchy
            ArrayOfString providerNames = new ArrayOfString();
            SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
            providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
            foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
            {
                this.DepthFirstTraverse(node, ref providerNames);
            }

            // Set search principal Type.
            SPPrincipalType principalType = SPPrincipalType.SharePointGroup;

            // Get max count of matched entities allowed to return for this search.
            int maxCount = Convert.ToInt32(Common.GetConfigurationPropertyValue("MaxCount", Site));

            bool caughtException = false; 
            try
            {
                // Set searchPattern as null and call searchAll.
                CPSWSAdapter.SearchAll(providerNames, principalType, null, maxCount);
            }
            catch (System.ServiceModel.FaultException faultException)
            {
                caughtException = true;

                // Verify Requirement 650, if the server returns an ArgumentNullException<"searchPattern"> message.
                Site.CaptureRequirementIfIsTrue(this.VerifyArgumentNullException(faultException, "searchPattern"), 650, @"[In SearchAll] If this [searchPattern] is NULL, the protocol server MUST return an ArgumentNullException<""searchPattern""> message.");
            }
            finally
            {
                this.Site.Assert.IsTrue(caughtException, "If searchPattern is NULL, the protocol server MUST return an ArgumentNullException<searchPattern> message.");
            }
        }
        public void MSCPSWS_S05_TC01_Search()
        {
            // Set principal type for search.
            SPPrincipalType principalType = SPPrincipalType.SecurityGroup;

            // Generate ArrayOfSPProviderSearchArguments.
            List <SPProviderSearchArguments> arrayOfSPProviderSearchArguments = new List <SPProviderSearchArguments>();

            Site.Assume.IsNotNull(this.GenerateProviderSearchArgumentsInput_Valid(), "There should be a valid provider search arguments!");
            SPProviderSearchArguments providerSearchArguments = this.GenerateProviderSearchArgumentsInput_Valid();

            arrayOfSPProviderSearchArguments.Add(providerSearchArguments);

            Site.Assume.IsNotNull(TestSuiteBase.SearchPattern, "The search pattern should not be null!");

            // Call Search operation.
            SPProviderHierarchyTree[] responseOfSearchResult = CPSWSAdapter.Search(arrayOfSPProviderSearchArguments.ToArray(), principalType, TestSuiteBase.SearchPattern);

            Site.Assert.IsNotNull(responseOfSearchResult, "The search result MUST be not null.");
            Site.Assert.IsTrue(responseOfSearchResult.Length >= 1, "The search result MUST contain at least one claims provider.");

            // Get the input provider names list.
            ArrayOfString providerNames = new ArrayOfString();

            providerNames.AddRange(arrayOfSPProviderSearchArguments.Select(root => root.ProviderName));

            // Requirement capture condition.
            bool searchSuccess = false;

            foreach (SPProviderHierarchyTree providerTree in responseOfSearchResult)
            {
                if (providerTree.ProviderName.StartsWith(Common.GetConfigurationPropertyValue("HierarchyProviderPrefix", this.Site)))
                {
                    if (providerNames.Contains(providerTree.ProviderName))
                    {
                        searchSuccess = true;
                    }
                    else
                    {
                        // Jump over the Hierarchy Provider tree that the server sees fit to return together with the result Claims provider trees.
                        continue;
                    }
                }
                else if (providerNames.Contains(providerTree.ProviderName))
                {
                    searchSuccess = true;
                }
                else
                {
                    Site.Assert.Fail("The provider names in the search result should be contained in the provider names in the input message!");
                }
            }

            // Capture requirement 378 by matching the input provider name with the result claims provider name,
            // The search input claims provider already satisfy the condition 1 and 3 in requirement 378 in test environment configuration.
            Site.CaptureRequirementIfIsTrue(
                searchSuccess,
                378,
                @"[In Search] The protocol server MUST search across all claims providers that meet all the following criteria:
                The claims providers are associated with the Web application (1) specified in the input message.
                The claims providers are listed in the provider search arguments in the input message.
                The claims providers support search.");

            // Capture requirement 398 by matching searchPattern with the result claims provider's Nm attribute.
            Site.CaptureRequirementIfIsTrue(searchSuccess, 398, @"[In Search] searchPattern: The protocol server MUST search for the string in each claims provider.");

            // Capture requirement 404 by matching searchPattern with the result claims provider's Nm attribute.
            Site.CaptureRequirementIfIsTrue(searchSuccess, 404, @"[In SearchResponse] The protocol server MUST return one claims provider hierarchy tree for each claims provider that contains entities that match the search string.");
        }
        public void MSCPSWS_S05_TC03_SearchAll()
        {
            // Get the provider names of all the providers from the hierarchy
            ArrayOfString providerNames = new ArrayOfString();

            SPProviderHierarchyTree[] responseOfGetHierarchyAllResult = TestSuiteBase.GetAllProviders();
            providerNames.AddRange(responseOfGetHierarchyAllResult.Select(root => root.ProviderName));
            foreach (SPProviderHierarchyNode node in responseOfGetHierarchyAllResult.SelectMany(root => root.Children))
            {
                this.DepthFirstTraverse(node, ref providerNames);
            }

            // Set search principal Type.
            SPPrincipalType principalType = SPPrincipalType.SecurityGroup;

            // Get the searchPattern string as SearchAll input
            this.GenerateSearchAllInput_Valid();

            // Get max count of matched entities allowed to return for this search.
            int maxCount = Convert.ToInt32(Common.GetConfigurationPropertyValue("MaxCount", Site));

            Site.Assume.IsNotNull(TestSuiteBase.SearchPattern, "The search pattern should not be null!");

            // Search the first claims provider tree which has a child.
            SPProviderHierarchyTree[] responseOfSearchResult = CPSWSAdapter.SearchAll(providerNames, principalType, TestSuiteBase.SearchPattern, maxCount);

            // Requirement capture condition.
            bool searchAllSuccess = false;

            foreach (SPProviderHierarchyTree providerTree in responseOfSearchResult)
            {
                if (providerTree.ProviderName.StartsWith(Common.GetConfigurationPropertyValue("HierarchyProviderPrefix", this.Site)))
                {
                    if (providerNames.Contains(providerTree.ProviderName))
                    {
                        searchAllSuccess = true;
                    }
                    else
                    {
                        // Jump over the Hierarchy Provider tree that the server sees fit to return together with the result Claims provider trees.
                        continue;
                    }
                }
                else if (providerNames.Contains(providerTree.ProviderName))
                {
                    searchAllSuccess = true;
                }
                else
                {
                    Site.Assert.Fail("The provider names in the SearchAll result should be contained in the provider names in the input message!");
                }
            }

            // Capture requirement 417 by matching the input provider name with the result claims provider name,
            // The search input claims provider already satisfy the condition 1 and 3 in requirement 417 in test environment configuration.
            Site.CaptureRequirementIfIsTrue(
                searchAllSuccess,
                417,
                @"[In SearchAll] The protocol server MUST search across all claims providers that meet all the following criteria:
                The claims providers are associated with the Web application (1) specified in the input message.
                The claims providers are listed in the provider names in the input message.
                The claims providers support search.");
        }
Beispiel #40
0
        public static bool UpLoadSql(List <string> lstSql, ref string strError)
        {
            bool bResult     = false;
            int  UploadCount = 0;
            int  ErrorCount  = 0;
            int  indexD      = 0;
            int  indexT      = 0;

            try
            {
                ArrayOfString arr = new ArrayOfString();
                while (lstSql.Count >= Common_Var.OnceImportSize)
                {
                    arr = new ArrayOfString();
                    arr.AddRange(lstSql.GetRange(0, Common_Var.OnceImportSize - 1));
                    bResult = WMSWebService.service.UpLoadSql(arr, Common_Var.CurrentUser, ref strError);
                    if (bResult)
                    {
                        UploadCount += Common_Var.OnceImportSize;
                        lstSql.RemoveRange(0, Common_Var.OnceImportSize - 1);
                    }
                    else
                    {
                        indexD = strError.IndexOf("第");
                        indexT = strError.IndexOf("条");
                        if (indexT > indexD && indexD >= 0)
                        {
                            string strCount = strError.Substring(indexD + 1, indexT - indexD - 1);
                            ErrorCount = Convert.ToInt32(strCount);
                            strError   = string.Format("{0}{1}{2}", strError.Substring(0, indexD + 1), UploadCount + ErrorCount, strError.Substring(indexT));
                        }
                        return(bResult);
                    }
                }

                if (lstSql.Count >= 1)
                {
                    arr = new ArrayOfString();
                    arr.AddRange(lstSql);
                    bResult = WMSWebService.service.UpLoadSql(arr, Common_Var.CurrentUser, ref strError);
                }
            }
            catch (Exception ex)
            {
                strError = ex.Message;
                bResult  = false;
            }

            if (bResult)
            {
                UploadCount += lstSql.Count;
                return(bResult);
            }
            else
            {
                indexD = strError.IndexOf("第");
                indexT = strError.IndexOf("条");
                if (indexT > indexD && indexD >= 0)
                {
                    string strCount = strError.Substring(indexD + 1, indexT - indexD - 1);
                    ErrorCount = Convert.ToInt32(strCount);
                    strError   = string.Format("{0}{1}{2}", strError.Substring(0, indexD + 1), UploadCount + ErrorCount, strError.Substring(indexT));
                }
                return(bResult);
            }
        }