예제 #1
0
        /// <summary>
        ///     Retrieves a single <see cref="CodeModel" /> instance from the data store.
        /// </summary>
        /// <param name="type">
        ///     The type code which distinctly identifies the type of <see cref="CodeModel" /> instance to be returned.
        /// </param>
        /// <param name="codeValue3">
        ///     The unique value which distinctly identifies the <see cref="CodeModel" /> instance to be returned.
        /// </param>
        /// <returns>
        ///     The <see cref="CodeModel" /> instance that matches the specified <paramref name="codeValue3" />; or null, if no matching instance can be found.
        /// </returns>
        public LocalCodeModel FetchByTypeAndCodeValue3(String codeType, String codeValue3)
        {
            CodeRecord     record = this.Provider.DataProvider.Common.Code.FetchByTypeAndCodeValue3(codeType, codeValue3);
            LocalCodeModel model  = record == null ? null : new LocalCodeModel(this.Provider, record);

            return(model);
        }
예제 #2
0
        /// <summary>
        ///     Creates a new <see cref="CodeRecord" /> object instance that is a shallow-copy of the current object instance.
        /// </summary>
        /// <returns>
        ///     The shallow-copy of the current <see cref="CodeRecord" /> object instance.
        /// </returns>
        public CodeRecord Clone()
        {
            CodeRecord record = new CodeRecord();

            record.Id          = this.Id;
            record.Lock        = this.Lock;
            record.AddDate     = this.AddDate;
            record.AddBy       = this.AddBy;
            record.ModDate     = this.ModDate;
            record.ModBy       = this.ModBy;
            record.RcvDate     = this.RcvDate;
            record.RcvFrom     = this.RcvFrom;
            record.Type        = this.Type;
            record.Value1      = this.Value1;
            record.Value2      = this.Value2;
            record.Value3      = this.Value3;
            record.Description = this.Description;
            record.Notes       = this.Notes;
            record.Value4      = this.Value4;
            record.System      = this.System;
            record.Deleted     = this.Deleted;
            record.Instruct    = this.Instruct;
            record.ReadOnly    = this.ReadOnly;
            record.OrigValue   = this.OrigValue;
            record.Value5      = this.Value5;
            record.Order       = this.Order;
            return(record);
        }
        public override void RemoveById(CodeRecord record)
        {
            DbCommand command = this.Provider.GetStoredProcedure("spRemoveSystemCode");

            //this.MapParameterIn(command, "@PA_CODE_ID", "dev");
            this.MapParametersIn(command, record, true);
            this.Execute(command);
            this.MapParametersOut(command, record);
        }
예제 #4
0
        /// <summary>
        ///     Indicates whether the current <see cref="CodeRecord" /> instance is equal to another <see cref="CodeRecord" /> instance.
        /// </summary>
        /// <param name="that">
        ///     The <see cref="CodeRecord" /> instance to be compared against this instance.
        /// </param>
        /// <returns>
        ///     True if both instances are considered equal; otherwise, false.
        /// </returns>
        public Boolean Equals(CodeRecord that)
        {
            Boolean result = true;

            result = result && (this.Id.TrimOrNullify() == that.Id.TrimOrNullify());
            result = result && (this.Lock.TrimOrNullify() == that.Lock.TrimOrNullify());
            result = result && (this.Type.TrimOrNullify() == that.Type.TrimOrNullify());
            result = result && (this.Value1.TrimOrNullify() == that.Value1.TrimOrNullify());
            result = result && (this.Value2.TrimOrNullify() == that.Value2.TrimOrNullify());
            result = result && (this.Value3.TrimOrNullify() == that.Value3.TrimOrNullify());
            result = result && (this.Description.TrimOrNullify() == that.Description.TrimOrNullify());
            result = result && (this.Notes.TrimOrNullify() == that.Notes.TrimOrNullify());
            result = result && (this.Value4.TrimOrNullify() == that.Value4.TrimOrNullify());
            result = result && (this.System == that.System);
            result = result && (this.Deleted == that.Deleted);
            result = result && (this.Instruct.TrimOrNullify() == that.Instruct.TrimOrNullify());
            result = result && (this.ReadOnly == that.ReadOnly);
            result = result && (this.OrigValue.TrimOrNullify() == that.OrigValue.TrimOrNullify());
            result = result && (this.Value5.TrimOrNullify() == that.Value5.TrimOrNullify());
            result = result && (this.Order == that.Order);
            return(result);
        }