public virtual FakeProductDomain CreateFakeProductDomain() { FakeProductEntity entity = new FakeProductEntity(); entity.FakeProductId = Guid.NewGuid().ToString(); return new FakeProductDomain(entity); }
public virtual void UpdateFakeProductEntity(FakeProductEntity entity, DataAccessBroker broker) { DataAccess.Update(entity, broker); }
public virtual void InsertFakeProductEntity(FakeProductEntity entity, DataAccessBroker broker) { DataAccess.Insert(entity, broker); }
public static ProductEntity GetEntity(FakeProductEntity fakeEntity, DateTime actionDate) { string sqlTemp = "SELECT * from Product_View Where ( Product_StartDate <=CONVERT(datetime,'{0}') AND ISNULL(Product_EndDate,DATEADD(dd,-1,CONVERT(datetime,'{0}'))) > CONVERT(datetime,'{0}') ) "; string strSelectSql = string.Format(sqlTemp, actionDate.ToString("yyyy-MM-dd")); if (!string.IsNullOrEmpty(fakeEntity.Gbu)) { strSelectSql += string.Format(" AND {0} = '{1}'",ProductTable.C_GBU, fakeEntity.Gbu); } if (!string.IsNullOrEmpty(fakeEntity.Category)) { strSelectSql += string.Format(" AND {0} = '{1}'", ProductTable.C_Category, fakeEntity.Category); } if (!string.IsNullOrEmpty(fakeEntity.Brand)) { strSelectSql += string.Format(" AND {0} = '{1}'", ProductTable.C_Brand, fakeEntity.Brand); } if (!string.IsNullOrEmpty(fakeEntity.SubCategory)) { strSelectSql += string.Format(" AND {0} = '{1}'", ProductTable.C_SubCategory, fakeEntity.SubCategory); } if (!string.IsNullOrEmpty(fakeEntity.Brandtype)) { strSelectSql += string.Format(" AND {0} = '{1}'", ProductTable.C_BrandType, fakeEntity.Brandtype); } if (!string.IsNullOrEmpty(fakeEntity.DescCn)) { strSelectSql += string.Format(" AND {0} = '{1}'", ProductTable.C_DESC_CN, fakeEntity.DescCn); } if (!string.IsNullOrEmpty(fakeEntity.ProductSize)) { strSelectSql += string.Format(" AND {0} = '{1}'", ProductTable.C_Product_Size, fakeEntity.ProductSize); } //DataTable dt = DataAccess.SelectDataSet(strSelectSql).Tables[0]; Suzsoft.Smart.EntityCore.EntityCollection<ProductEntity> list = new Suzsoft.Smart.EntityCore.EntityCollection<ProductEntity>(); list = DataAccess.Select<ProductEntity>(strSelectSql, null, CommandType.Text); if (list.Count > 0) return list[0]; else return null; }
public FakeProductDomain(FakeProductEntity entity) : base(entity) { masterEntity = entity; }