Exemplo n.º 1
0
        public ActionResult Save(AddAlternateSpelling alternateSpelling)
        {
            NameClient client = new NameClient();

            client.AddSpelling(alternateSpelling.CommonName, alternateSpelling.VariationName);
            client.Close();

            return(RedirectToAction("All"));
        }
Exemplo n.º 2
0
        //public ActionResult Save(AddNickName nickName)
        public ActionResult Save(string FullName, string NickName)
        {
            NameClient client = new NameClient();

            //client.AddNickName(nickName.FullName, nickName.NickName);
            client.AddNickName(FullName, NickName);
            client.Close();

            return(RedirectToAction("All"));
        }
Exemplo n.º 3
0
        public ActionResult Save([ModelBinder(typeof(MultipleNameDetailsBinder))] EditNameDetail[] edits, int pageIndex, int rowsPerPage)
        {
            NameClient client = new NameClient();

            client.EditNameDetails(edits.Select(edit => new EditNameDetailRequest()
            {
                NameDetailId = edit.NameDetailId,
                Origin       = edit.Origin,
                Meaning      = edit.Meaning,
                IsDeleted    = edit.IsDeleted
            }).ToArray());
            client.Close();

            return(RedirectToAction("Index", new { pageIndex = pageIndex, rowsPerPage = rowsPerPage }));
        }
Exemplo n.º 4
0
        public ActionResult All()
        {
            NameClient client = new NameClient();

            NickNameModel[] models = client.GetNickNames().Select(response => new NickNameModel()
            {
                FullNameId = response.FullNameId,
                FullName   = response.FullName,
                NickNameId = response.NickNameId,
                NickName   = response.NickName
            }).ToArray();
            client.Close();

            return(View("All", models));
        }
Exemplo n.º 5
0
        public ActionResult All()
        {
            NameClient client = new NameClient();

            SpellingModel[] models = client.GetSpellings().Select(response => new SpellingModel()
            {
                CommonNameId    = response.CommonNameId,
                CommonName      = response.CommonName,
                VariationNameId = response.VariationNameId,
                VariationName   = response.VariationName
            }).ToArray();
            client.Close();

            return(View("All", models));
        }
Exemplo n.º 6
0
        public ActionResult Index(int pageIndex = 0, int rowsPerPage = 50)
        {
            IndexModel model = new IndexModel()
            {
                PageIndex = pageIndex, RowsPerPage = rowsPerPage
            };

            NameClient client = new NameClient();

            model.NameDetails = client.GetPagedNames(pageIndex, rowsPerPage).Select(response => new NameDetail()
            {
                NameId       = response.NameId,
                Name         = response.Name,
                NameDetailId = response.NameDetailId,
                Origin       = response.Origin,
                Meaning      = response.Meaning
            }).ToArray();
            client.Close();

            return(View("Index", model));
        }