public static void UpdateAppointment(CarScheduling appt)
    {
        if (appt == null)
        {
            return;
        }
        CarsDataContext db    = new CarsDataContext();
        CarScheduling   query = (CarScheduling)(from carSchedule in db.CarSchedulings where carSchedule.ID == appt.ID select carSchedule).SingleOrDefault();

        query.ID             = appt.ID;
        query.StartTime      = appt.StartTime;
        query.EndTime        = appt.EndTime;
        query.AllDay         = appt.AllDay;
        query.Subject        = appt.Subject;
        query.Description    = appt.Description;
        query.Location       = appt.Location;
        query.RecurrenceInfo = appt.RecurrenceInfo;
        query.ReminderInfo   = appt.ReminderInfo;
        query.Status         = appt.Status;
        query.EventType      = appt.EventType;
        query.Label          = appt.Label;
        query.CarId          = appt.CarId;
        query.ContactInfo    = appt.ContactInfo;
        query.Price          = appt.Price;
        db.SubmitChanges();
    }
예제 #2
0
        public static XtraReportsDemos.AnchorVertical.Report Fill(this XtraReportsDemos.AnchorVertical.Report report)
        {
            CarsDataContext dataContext = new CarsDataContext();

            dataContext.Cars.CopyToDataTable(report.dsCars1.Cars);
            return(report);
        }
    public static void RemoveAppointment(CarScheduling appt)
    {
        CarsDataContext db    = new CarsDataContext();
        CarScheduling   query = (CarScheduling)(from carSchedule in db.CarSchedulings where carSchedule.ID == appt.ID select carSchedule).SingleOrDefault();

        db.CarSchedulings.DeleteOnSubmit(query);
        db.SubmitChanges();
    }
    public static void InsertAppointment(CarScheduling appt)
    {
        if (appt == null)
        {
            return;
        }
        CarsDataContext db = new CarsDataContext();

        appt.ID = appt.GetHashCode();
        db.CarSchedulings.InsertOnSubmit(appt);
        db.SubmitChanges();
    }
 public CarController(CarsDataContext context)
 {
     _context = context;
 }
    public static IEnumerable GetAppointments()
    {
        CarsDataContext db = new CarsDataContext();

        return(from apt in db.CarSchedulings select apt);
    }
    public static IEnumerable GetResources()
    {
        CarsDataContext db = new CarsDataContext();

        return(from res in db.Cars select res);
    }