Exemplo n.º 1
0
        public async Task UpdateADMessageNotification(ADMessageNotification objADMessageNotification)
        {
            try
            {
                _Context.Entry(objADMessageNotification).State = Microsoft.EntityFrameworkCore.EntityState.Modified;

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 2
0
        public async Task InsertADMessageNotification(ADMessageNotification objADMessageNotification)
        {
            try
            {
                _Context.ADMessageNotifications.Add(objADMessageNotification);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 3
0
        public async Task DeleteADMessageNotification(long MessageNotification)
        {
            try
            {
                ADMessageNotification objADMessageNotification = _Context.ADMessageNotifications.Find(MessageNotification);
                _Context.ADMessageNotifications.Remove(objADMessageNotification);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 4
0
        public async Task <ActionResult <MessageNotificationResult> > PutADMessageNotification(long id, ADMessageNotification objADMessageNotification)
        {
            if (id != objADMessageNotification.MasterMessageNotificationId)
            {
                return(BadRequest());
            }


            try
            {
                await _IMessageNotificationInterface.UpdateADMessageNotification(objADMessageNotification);

                return(_IMessageNotificationInterface.GetADMessageNotificationByID(id));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_IMessageNotificationInterface.ADMessageNotificationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(NoContent());
        }
Exemplo n.º 5
0
        public async Task <ActionResult <MessageNotificationResult> > PostADMessageNotification(ADMessageNotification objADMessageNotification)
        {
            try
            {
                await _IMessageNotificationInterface.InsertADMessageNotification(objADMessageNotification);

                return(CreatedAtAction("GetADMessageNotification", new { id = objADMessageNotification.MasterMessageNotificationId }, objADMessageNotification));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }