예제 #1
0
        public LogMessageFromRepo Update(ClientAddressItem item)
        {
            try
            {
                _context.ClientAddressItem.Update(item);
                result = _context.SaveChanges();

                if (result != 1 && result > 0)
                {
                    logMessage.Success    = false;
                    logMessage.LogMessage = "Oops.. more than one row were affected";
                }
                else if (result < 0)
                {
                    logMessage.Success    = false;
                    logMessage.LogMessage = "Can't update the selected address due to errors on the darkside";
                }
            }
            catch (Exception ex) // TODO  create log de errores en db
            {
                logMessage.Success    = false;
                logMessage.LogMessage = "Something quite bad happend, ask Ruben for help.";
            }

            return(logMessage);
        }
예제 #2
0
        public LogMessageFromRepo Add(ClientAddressItem item)
        {
            try
            {
                _context.ClientAddressItem.Add(item);
                result = _context.SaveChanges();

                if (result <= 0)
                {
                    logMessage.Success    = false;
                    logMessage.LogMessage = "Can't create the new address due to errors on the darkside";
                }
            }
            catch (Exception ex) // TODO  create log de errores en db
            {
                logMessage.Success    = false;
                logMessage.LogMessage = "Something quite bad happend, ask Ruben for help.";
            }

            return(logMessage);
        }