Esempio n. 1
0
    public static IEnumerable GetAppointments()
    {
        DBScheduleMVCV001 db = new DBScheduleMVCV001();

        //var aptt =from obj in db.ScheduleCalendars.Where(t => t.UserId == 1) select obj;
        return(db.ScheduleCalendars.ToList());//(from apt in db.ScheduleCalendars select apt).ToList();// db.ScheduleCalendars.Local;//from apt in db.ScheduleCalendars  select apt;
    }
Esempio n. 2
0
    public static IEnumerable GetCustomerResources()
    {
        DBScheduleMVCV001 db = new DBScheduleMVCV001();

        //var t = db.Cars.ToList();
        //var ttt = (from res in db.Cars select res).ToList();
        return(db.Customers.ToList());// (from res in db.Cars select res).ToList();//db.Cars.Local;//from res in db.Cars select res;
    }
Esempio n. 3
0
    public static void RemoveAppointment(ScheduleCalendar appt)
    {
        DBScheduleMVCV001 db    = new DBScheduleMVCV001();
        ScheduleCalendar  query = (ScheduleCalendar)(from carSchedule in db.ScheduleCalendars where carSchedule.ID == appt.ID select carSchedule).SingleOrDefault();

        db.ScheduleCalendars.Remove(query);
        db.SaveChanges();
        //db.ScheduleCalendars.DeleteOnSubmit(query);
        //db.SubmitChanges();
    }
Esempio n. 4
0
    public static void InsertAppointment(ScheduleCalendar appt)
    {
        if (appt == null)
        {
            return;
        }
        DBScheduleMVCV001 db = new DBScheduleMVCV001();

        appt.ID = appt.GetHashCode();
        db.ScheduleCalendars.Local.Add(appt);
        db.SaveChanges();
        //db.ScheduleCalendars.InsertOnSubmit(appt);
        //db.SubmitChanges();
    }
Esempio n. 5
0
    public static void UpdateAppointment(ScheduleCalendar appt)
    {
        if (appt == null)
        {
            return;
        }
        DBScheduleMVCV001 db    = new DBScheduleMVCV001();
        ScheduleCalendar  query = (ScheduleCalendar)(from carSchedule in db.ScheduleCalendars 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;
        #region dn Custom Field
        query.OpportunityId  = appt.OpportunityId;
        query.CustomerId     = appt.CustomerId;
        query.ScheduleTypeId = appt.ScheduleTypeId;
        query.RequestBy      = appt.RequestBy;
        query.RequestDate    = appt.RequestDate;
        query.UserId         = appt.UserId;
        query.Estimation     = appt.Estimation;
        query.SpentTime      = appt.SpentTime;
        query.Comment        = appt.Comment;
        query.ContactInfo    = appt.ContactInfo;
        query.Price          = appt.Price;
        #endregion

        db.SaveChanges();
        //db.SubmitChanges();
    }
Esempio n. 6
0
    public static IEnumerable GetResources()
    {
        DBScheduleMVCV001 db = new DBScheduleMVCV001();

        return(db.Opportunitys.ToList());
    }
Esempio n. 7
0
    public static IEnumerable GetScheduleTypeResources()
    {
        DBScheduleMVCV001 db = new DBScheduleMVCV001();

        return(db.ScheduleTypes.ToList());
    }