Example #1
0
 public object createcontact(Registration rvm)
 {
     try
     {
         dbNewBusEntities1 db       = new dbNewBusEntities1();
         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 #2
0
 public object createbus(AddBus b)
 {
     try
     {
         dbNewBusEntities1 db = new dbNewBusEntities1();
         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."
     });
 }