Example #1
0
        public void updateseats(string BusNo, int length)
        {
            dbNewBusEntities7 db = new dbNewBusEntities7();

            tblBu f = (from p in db.tblBus
                       where p.BusNo == BusNo
                       select p).SingleOrDefault();

            f.Availableseats = f.Availableseats - length;
            db.SaveChanges();
        }
Example #2
0
        public IHttpActionResult uncreatebookings(string Source_B, string Destination_B, string StartDate, string StartTime, float TravelFare, string EmailId, string BusNo, string SelectedSeats, string TicketType, string paymentBy)
        {
            dbNewBusEntities7 db       = new dbNewBusEntities7();
            tblBooking        customer = new tblBooking();

            customer.Source_B      = Source_B;
            customer.Destination_B = Destination_B;
            customer.StartDate     = StartDate;
            customer.StartTime     = StartTime;
            customer.TravelFare    = TravelFare;
            customer.EmailId       = EmailId;
            customer.BusNo         = BusNo;
            customer.SelectedSeats = SelectedSeats;
            customer.paymentBy     = paymentBy;
            // customer.WalletDetails = wallet;
            customer.TicketType      = TicketType;
            customer.CancellationBit = "0";
            db.tblBookings.Add(customer);
            db.SaveChanges();
            return(Ok());
        }
Example #3
0
 public object createcontact(Registration rvm)
 {
     try
     {
         dbNewBusEntities7 db       = new dbNewBusEntities7();
         tblCustomer       customer = new tblCustomer();
         if (customer.EmailId == null)
         {
             customer.username  = rvm.username;
             customer.Fname     = rvm.Fname;
             customer.Lname     = rvm.Lname;
             customer.Password_ = rvm.Password_;
             customer.EmailId   = rvm.EmailId;
             customer.ContactNo = rvm.ContactNo;
             customer.Address   = rvm.Address;
             customer.DOB       = rvm.DOB;
             customer.Gender    = rvm.Gender;
             // customer.WalletDetails = wallet;
             db.tblCustomers.Add(customer);
             db.SaveChanges();
             return(new Response
             {
                 Status = "Success",
                 Message = "SuccessFully Saved."
             });
         }
     }
     catch (Exception)
     {
         throw;
     }
     return(new Response
     {
         Status = "Error",
         Message = "Invalid Data."
     });
 }
Example #4
0
 public object createbus(AddBus b)
 {
     try
     {
         dbNewBusEntities7 db = new dbNewBusEntities7();
         tblBu             bu = new tblBu();
         if (bu.BusNo == null)
         {
             bu.BusNo       = b.BusNo;
             bu.NoOfSeats   = b.NoOfSeats;
             bu.Source_     = b.Source_;
             bu.Destination = b.Destination;
             bu.ViaStop     = b.ViaStop;
             bu.StartTime   = b.StartTime;
             bu.EndTime     = b.EndTime;
             bu.PerSeatCost = b.PerSeatCost;
             bu.BusType     = b.BusType;
             bu.BusName     = b.BusName;
             db.tblBus.Add(bu);
             db.SaveChanges();
             return(new Response
             {
                 Status = "Success", Message = "SuccessFully Saved."
             });
         }
     }
     catch (Exception)
     {
         throw;
     }
     return(new Response
     {
         Status = "Error",
         Message = "Invalid Data."
     });
 }