public PriorityCode DeletePriorityCode(PriorityCode entity)
        {
            string mySQL        = "DELETE From [dbo].[TM_MDC_LOG_PRIORITY] Where PRIORITY = '" + entity.Priority + "'";
            int    rowsAffected = _db.Execute(mySQL, entity);

            return(entity);
        }
        public PriorityCode FindPriorityCode(int PriorityCode)
        {
            string       findSQL      = listSQL + " Where PRIORITY = '" + PriorityCode + "'";
            PriorityCode priorityCode = _db.QuerySingle <PriorityCode>(findSQL);

            return(priorityCode);
        }
        public PriorityCode InsertPriorityCode(PriorityCode entity)
        {
            string mySQL = " INSERT INTO [TM_MDC_LOG_PRIORITY] ([PRIORITY],[DESCR]) VALUES " +
                           " ( '" + entity.Priority + "','" + entity.Descr + "')";
            int rowsAffected = _db.Execute(mySQL);

            return(entity);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns true if NotificationViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of NotificationViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(NotificationViewModel other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     EventId == other.EventId ||
                     EventId != null &&
                     EventId.Equals(other.EventId)
                 ) &&
                 (
                     Event2Id == other.Event2Id ||
                     Event2Id != null &&
                     Event2Id.Equals(other.Event2Id)
                 ) &&
                 (
                     HasBeenViewed == other.HasBeenViewed ||
                     HasBeenViewed != null &&
                     HasBeenViewed.Equals(other.HasBeenViewed)
                 ) &&
                 (
                     IsWatchNotification == other.IsWatchNotification ||
                     IsWatchNotification != null &&
                     IsWatchNotification.Equals(other.IsWatchNotification)
                 ) &&
                 (
                     IsExpired == other.IsExpired ||
                     IsExpired != null &&
                     IsExpired.Equals(other.IsExpired)
                 ) &&
                 (
                     IsAllDay == other.IsAllDay ||
                     IsAllDay != null &&
                     IsAllDay.Equals(other.IsAllDay)
                 ) &&
                 (
                     PriorityCode == other.PriorityCode ||
                     PriorityCode != null &&
                     PriorityCode.Equals(other.PriorityCode)
                 ) &&
                 (
                     UserId == other.UserId ||
                     UserId != null &&
                     UserId.Equals(other.UserId)
                 ));
        }
        public PriorityCode EditPriorityCode(PriorityCode entity)
        {
            string mySQL = "UPDATE[dbo].[TM_MDC_LOG_PRIORITY] SET [PRIORITY] = '" + entity.Priority + "'" +
                           ",[DESCR] = '" + entity.Descr + "'" +
                           " WHERE[PRIORITY] = '" + entity.Priority + "'";
            int rowsAffected = _db.Execute(mySQL);

            return(entity);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (EventId != null)
                {
                    hash = hash * 59 + EventId.GetHashCode();
                }

                if (Event2Id != null)
                {
                    hash = hash * 59 + Event2Id.GetHashCode();
                }

                if (HasBeenViewed != null)
                {
                    hash = hash * 59 + HasBeenViewed.GetHashCode();
                }

                if (IsWatchNotification != null)
                {
                    hash = hash * 59 + IsWatchNotification.GetHashCode();
                }

                if (IsExpired != null)
                {
                    hash = hash * 59 + IsExpired.GetHashCode();
                }

                if (IsAllDay != null)
                {
                    hash = hash * 59 + IsAllDay.GetHashCode();
                }

                if (PriorityCode != null)
                {
                    hash = hash * 59 + PriorityCode.GetHashCode();
                }

                if (UserId != null)
                {
                    hash = hash * 59 + UserId.GetHashCode();
                }

                return(hash);
            }
        }
Exemplo n.º 7
0
        public DeletePriorityCodeVM DeletePriorityCode(DeletePriorityCodeVM ThisPriorityCode)
        {
            var deletePriorityCode = new PriorityCode()
            {
                Priority = ThisPriorityCode.Priority,
                Descr    = ThisPriorityCode.Descr
            };

            _PriorityCodeRepo.DeletePriorityCode(deletePriorityCode);
            return(ThisPriorityCode);
        }
Exemplo n.º 8
0
        public EditPriorityCodeVM EditPriorityCode(EditPriorityCodeVM ThisPriorityCode)
        {
            var editPriorityCode = new PriorityCode()
            {
                Priority = ThisPriorityCode.Priority,
                Descr    = ThisPriorityCode.Descr
            };

            _PriorityCodeRepo.EditPriorityCode(editPriorityCode);
            return(ThisPriorityCode);
        }
Exemplo n.º 9
0
        public CreatePriorityCodeVM InsertPriorityCode(CreatePriorityCodeVM ThisPriorityCode)
        {
            var insertPriorityCode = new PriorityCode()
            {
                Priority = ThisPriorityCode.Priority,
                Descr    = ThisPriorityCode.Descr
            };

            _PriorityCodeRepo.InsertPriorityCode(insertPriorityCode);
            return(ThisPriorityCode);
        }
        public void Validate()
        {
            if (PriorityCode.IsNullOrWhiteSpace())
            {
                throw new ChoNACHAConfigurationException("Priority Code must be not empty.");
            }
            if (DestinationBankRoutingNumber.IsNullOrWhiteSpace())
            {
                throw new ChoNACHAConfigurationException("Destination Bank Routing Number must be not empty.");
            }
            string v = DestinationBankRoutingNumber;

            if (!(((v.Length == 9 && !v.Where(c => !Char.IsDigit(c)).Any()) /*|| (v.Length == 10 && v[0] == ' ' && !v.Skip(1).Where(c => !Char.IsDigit(c)).Any())*/)))
            {
                throw new ChoNACHAConfigurationException("Invalid Destination Bank Routing Number specified.");
            }
            if (OriginatingCompanyId.IsNullOrWhiteSpace())
            {
                throw new ChoNACHAConfigurationException("Originating Company Id must be not empty.");
            }
            v = OriginatingCompanyId;
            if (!(((v.Length == 9 && !v.Where(c => !Char.IsDigit(c)).Any()) || (v.Length == 10 && v[0] == ' ' && !v.Skip(1).Where(c => !Char.IsDigit(c)).Any()) || (v.Length == 10 && !v.Where(c => !Char.IsDigit(c)).Any()))))
            {
                throw new ChoNACHAConfigurationException("Invalid Originating Company Id specified.");
            }
            if (FileIDModifier.ToString().IsNullOrWhiteSpace())
            {
                throw new ChoNACHAConfigurationException("FileIDModifier must be not empty.");
            }
            if (DestinationBankName.IsNullOrWhiteSpace())
            {
                throw new ChoNACHAConfigurationException("Destination Bank Name must be not empty.");
            }
            if (OriginatingCompanyName.ToString().IsNullOrWhiteSpace())
            {
                throw new ChoNACHAConfigurationException("Originating Company Name must be not empty.");
            }
        }
Exemplo n.º 11
0
 /// <summary>
 /// Add <c>Priority</c>.
 /// </summary>
 /// <param name="priority"></param>
 /// <returns><see cref="XrmEmail"/></returns>
 public XrmEmail Priority(PriorityCode priority)
 {
     _priority = (int)priority;
     return(this);
 }
Exemplo n.º 12
0
 public TaskPriority()
 {
     Code = PriorityCode.Low;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Add <c>priority</c>
 /// </summary>
 /// <param name="priority"></param>
 /// <returns><see cref="XrmAppointment"/></returns>
 public XrmAppointment Priority(PriorityCode priority)
 {
     _priority = (int)priority;
     return(this);
 }
Exemplo n.º 14
0
 public PriorityCode SavePriorityCode(PriorityCode entity)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 15
0
 public IPriority GetPriority(PriorityCode code)
 {
     return clsRepository.GetPriority((int)code);
 }