public Models.MemberTypeDo GetMemberType(Models.MemberTypeCriteriaDo criteria) { Models.MemberTypeDo result = null; db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) => { command.CommandText = "[dbo].[sp_Get_MemberType]"; command.CommandType = System.Data.CommandType.StoredProcedure; command.AddParameter(typeof(int), "MemberTypeID", criteria.MemberTypeID); System.Collections.IList[] dbls = command.ToList(typeof(Models.MemberTypeDo), typeof(Models.MemberTypeBrandDo)); if (dbls != null) { List <Models.MemberTypeDo> dbmts = dbls[0] as List <Models.MemberTypeDo>; List <Models.MemberTypeBrandDo> dbmtbs = dbls[1] as List <Models.MemberTypeBrandDo>; if (dbmts != null) { if (dbmts.Count > 0) { result = dbmts[0]; if (dbmtbs != null) { result.Brands = dbmtbs; } } } } })); return(result); }
public Models.MemberTypeResultDo GetMemberTypeList(Models.MemberTypeCriteriaDo criteria) { Models.MemberTypeResultDo result = new Models.MemberTypeResultDo(); db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) => { command.CommandText = "[dbo].[sp_Get_MemberTypeList]"; command.CommandType = System.Data.CommandType.StoredProcedure; command.AddParameter(typeof(string), "MemberTypeName", criteria.MemberTypeName); command.AddParameter(typeof(decimal), "DiscountValue", criteria.DiscountValue); command.AddParameter(typeof(string), "DiscountType", criteria.DiscountType); command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive); Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria); result.Rows = command.ToList <Models.MemberTypeFSDo>(); result.TotalRecordParameter(output); })); return(result); }