Exemple #1
0
 public bool Delete(ScheduleChange obj)
 {
     try
     {
         _db.ScheduleChanges.DeleteOnSubmit(obj);
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(false);
     }
     return(true);
 }
Exemple #2
0
        public bool Update(ScheduleChange obj)
        {
            try
            {
                obj.UpdatedDate = DateTime.Now;

                _db.SubmitChanges();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(false);
            }
            return(true);
        }
Exemple #3
0
        public int Add(ScheduleChange obj)
        {
            try
            {
                obj.CreatedDate = DateTime.Now;

                _db.ScheduleChanges.InsertOnSubmit(obj);
                _db.SubmitChanges();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(-1);
            }
            return(_db.ScheduleChanges.Max(x => x.ScheduleChangeId));
        }