Ejemplo n.º 1
0
        public Dictionary <String, List <String> > Put([FromBody] PassengerRecord value)
        {
            if (!string.IsNullOrEmpty(value.Key) && !string.IsNullOrEmpty(value.LastName))
            {
                if (pl.Add(value))
                {
                    return(pl.GetList());
                }
            }

            var res = new Dictionary <String, List <String> >();

            res.Add("Error", new List <string> {
                "Invalid passenger record"
            });
            return(res);
        }
Ejemplo n.º 2
0
        public void WebApiPUTGET()
        {
            var value = new PassengerRecord
            {
                Key       = "TESTAB",
                LastName  = "Doe",
                Gender    = "MR",
                FirstName = "John"
            };

            if (pl.Add(value))
            {
                var res = pl.GetList();
                Assert.AreEqual(res.Count, 4);
                Assert.AreEqual(res["LVGVUP"].Count, 2);
                Assert.AreEqual(res["TESTAB"].Count, 1);
                Assert.AreEqual((res["TESTAB"][0]), "JOHN/DOEMR");
            }
        }
Ejemplo n.º 3
0
        public List <String> GetPNL()
        {
            var pasList = pl.GetList();
            var res     = new List <String>();

            if (pasList == null && pasList.Count() == 0)
            {
                return(res);
            }

            foreach (var list in pasList)
            {
                foreach (var p in list.Value)
                {
                    res.Add(String.Format("1{0} {1}{2}", p, SystemConstants.RecordSeparator, list.Key));
                }
            }
            return(res);
        }