Esempio n. 1
0
        public ActionResult AddApp(CustomAppoinmentModel app)
        {
            var id = System.Web.HttpContext.Current.User.Identity.GetUserId();

            app.CreatedBy = id;
            AppointmentService.AddAppointment(app);
            return(Json(true, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
 public static void DeleteAppointment(CustomAppoinmentModel source)
 {
     using (var db = new KaamShaamEntities())
     {
         var dbObj = db.Appointments.FirstOrDefault(app => app.Id == source.Id);
         if (dbObj != null)
         {
             db.Appointments.Remove(dbObj);
         }
         db.SaveChanges();
     }
 }
Esempio n. 3
0
 public static void EditAppointment(CustomAppoinmentModel source)
 {
     using (var db = new KaamShaamEntities())
     {
         var dbObj = db.Appointments.FirstOrDefault(app => app.Id == source.Id);
         if (dbObj != null)
         {
             dbObj.DateTime   = source.DateTime;
             dbObj.Title      = source.Title;
             dbObj.Type       = source.Type;
             dbObj.WithId     = source.WithId;
             dbObj.IsAttended = source.IsAttended;
         }
         db.SaveChanges();
     }
 }
Esempio n. 4
0
 public static void AddAppointment(CustomAppoinmentModel source)
 {
     using (var db = new KaamShaamEntities())
     {
         db.Appointments.Add(new Appointment
         {
             DateTime   = source.DateTime,
             CreatedBy  = source.CreatedBy,
             Title      = source.Title,
             Type       = source.Type,
             WithId     = source.WithId,
             IsAttended = false
         });
         db.SaveChanges();
     }
 }
Esempio n. 5
0
 public ActionResult Update(CustomAppoinmentModel app)
 {
     AppointmentService.EditAppointment(app);
     return(Json(true, JsonRequestBehavior.AllowGet));
 }