Esempio n. 1
0
        public int SendRequest(DriverRequest request)
        {
            var db = new LiftEmAllEntities();

            request.CreatedDate = DateTime.Now;
            db.DriverRequests.Add(request);
            db.SaveChanges();
            return(request.Id);
        }
Esempio n. 2
0
        public int UpdateDriver(DriverRequest r)
        {
            var db      = new LiftEmAllEntities();
            var request = db.DriverRequests.Find(r.Id);

            if (request == null)
            {
                return(0);
            }
            request.DriverName  = r.DriverName;
            request.UpdatedDate = DateTime.Now;
            db.SaveChanges();
            return(request.Id);
        }