Exemplo n.º 1
0
 public Task <int> DeleteAsync(SqlEntityBase entity, DbTransaction txn = null)
 {
     return(null);
 }
Exemplo n.º 2
0
 public Task SaveAsync(SqlEntityBase entity, DbTransaction txn = null)
 {
     return(null);
 }
 private void AttachFeeCollection(DomainEntityCollection<Fee> fees, SqlEntityBase attachTo, string feeTypeCode)
 {
     foreach (Fee f in fees)
     {
         Fee_assignment fa = new Fee_assignment();
         fa.PopulateFrom(f);
         fa.business_unit_product_id.Value = attachTo.Variable;
         fa.fee_schedule_id.Value = _feeScheduleMap[f];
         fa.fee_type_cd_id.Value = GSC(SystemCodeType.FEE_TYPE, feeTypeCode);
         fa.business_unit_product_order_method_id.Value = GSC(SystemCodeType.ORDER_METHOD, f.OrderMethod);
         fa.business_unit_product_payment_method_id.Value = GSC(SystemCodeType.PAYMENT_TYPE, f.PaymentMethod);
         _sqlEntities.Add(fa);
     }
 }
        private void DoSqlValidations(SqlEntityBase e, StreamWriter writer)
        {
            var validations = e.Validate();
            _sqlValidations.AddRange(validations);
            if (validations.Count() > 0)
            {
                writer.WriteLine();

                foreach (var v in e.Validate())
                {
                    writer.Write(@"=-=-=-=-=-=-=-SQL entity failed validation for field ""{0}"": {1}", v.Field.ColumnName, v.Validation.ToString());
                    writer.WriteLine();

                    string entityName;
                    if (v.Entity.Variable != null)
                    {
                        entityName = v.Entity.Variable.Name;
                    }
                    else
                    {
                        entityName = v.Entity.GetType().Name;
                    }
                }
            }
        }
        private SqlVariable AddUniqueSqlEntity(SqlEntityBase entity)
        {
            if (entity == null)
                throw new ArgumentNullException("entity");

            //
            // Use Equals(...) instead of == for the comparison!
            //
            SqlEntityBase current = _sqlEntities.Where(x => x.Equals(entity)).FirstOrDefault();
            if (current == null)
            {
                _sqlEntities.Add(entity);
                entity.GenVariable();
                current = entity;
            }

            return current.Variable;
        }