コード例 #1
0
        public string AddDestination()
        {
            DataAbstractionLayer dal = new DataAbstractionLayer();
            string country           = Request.Params["Country"];
            string city    = Request.Params["City"];
            string address = Request.Params["Address"];
            string desc    = Request.Params["Description"];

            if (string.IsNullOrEmpty(country) || string.IsNullOrEmpty(city))
            {
                return("Some mandatory fields are missing!");
            }
            dal.InsertDestination(new Destination
            {
                Country     = country,
                City        = city,
                Address     = address,
                Description = desc
            });
            return("Destination added successfully!");
        }