コード例 #1
0
        public void Post([FromBody] TripTO tripTO)
        {
            using (var db = new Fish360Project.f360Entities())
            {
                Trips newTrip = new Trips();
                newTrip.name      = tripTO.name;
                newTrip.notes     = tripTO.notes;
                newTrip.startDate = DateTime.Parse(tripTO.startDate); //, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.endDate   = DateTime.Parse(tripTO.endDate);   //, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.userId    = tripTO.userId;

                db.Trips.Add(newTrip);
                db.SaveChanges();
            }
        }
コード例 #2
0
ファイル: TripService.asmx.cs プロジェクト: vishalc35/dev
        public string CreateTrip(TripTO tripTO, string token)
        {
            using (var db = new Fish360Project.f360Entities())
            {
                UserTO userTO = FindUserForToken(token);

                Trips newTrip = new Trips();
                newTrip.name = tripTO.name;
                newTrip.startDate = DateTime.ParseExact(tripTO.startDate, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.endDate = DateTime.ParseExact(tripTO.endDate, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.userId = userTO.id;

                db.Trips.Add(newTrip);
                db.SaveChanges();
            }
            return null;
        }
コード例 #3
0
        public string CreateTrip(TripTO tripTO, string token)
        {
            using (var db = new Fish360Project.f360Entities())
            {
                UserTO userTO = FindUserForToken(token);

                Trips newTrip = new Trips();
                newTrip.name      = tripTO.name;
                newTrip.notes     = tripTO.notes;
                newTrip.startDate = DateTime.ParseExact(tripTO.startDate, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.endDate   = DateTime.ParseExact(tripTO.endDate, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.userId    = userTO.id;

                db.Trips.Add(newTrip);
                db.SaveChanges();
            }
            return(null);
        }
コード例 #4
0
ファイル: TripController.cs プロジェクト: Juncai/dev
        public void Post([FromBody]TripTO tripTO)
        {
            using (var db = new Fish360Project.f360Entities())
            {
                Trips newTrip = new Trips();
                newTrip.name = tripTO.name;
                newTrip.startDate = DateTime.ParseExact(tripTO.startDate, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.endDate = DateTime.ParseExact(tripTO.endDate, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                newTrip.userId = tripTO.userId;

                db.Trips.Add(newTrip);
                db.SaveChanges();
            }
        }