public List <Models.BranchDo> GetBranchAutoComplete(Models.BranchCriteriaDo criteria) { List <Models.BranchDo> result = new List <Models.BranchDo>(); db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) => { command.CommandText = "[dbo].[sp_Get_BranchAutoComplete]"; command.CommandType = System.Data.CommandType.StoredProcedure; command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode); result = command.ToList <Models.BranchDo>(); })); return(result); }
public Models.BranchResultDo GetBranchList(Models.BranchCriteriaDo criteria) { Models.BranchResultDo result = new Models.BranchResultDo(); db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) => { command.CommandText = "[dbo].[sp_Get_BranchList]"; command.CommandType = System.Data.CommandType.StoredProcedure; command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode); command.AddParameter(typeof(string), "BranchName", criteria.BranchName); command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive); Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria); result.Rows = command.ToList <Models.BranchFSDo>(); result.TotalRecordParameter(output); })); return(result); }
public Models.BranchDo GetBranch(Models.BranchCriteriaDo criteria) { Models.BranchDo result = null; if (Utils.CommonUtil.IsNullOrEmpty(criteria.BranchID) == false || Utils.CommonUtil.IsNullOrEmpty(criteria.BranchName) == false) { db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) => { command.CommandText = "[dbo].[sp_Get_Branch]"; command.CommandType = System.Data.CommandType.StoredProcedure; command.AddParameter(typeof(int), "BranchID", criteria.BranchID); System.Collections.IList[] dbls = command.ToList(typeof(Models.BranchDo), typeof(Models.ZoneDo)); if (dbls != null) { List <Models.BranchDo> dbbs = dbls[0] as List <Models.BranchDo>; List <Models.ZoneDo> dbzs = dbls[1] as List <Models.ZoneDo>; if (dbbs != null) { if (dbbs.Count > 0) { result = dbbs[0]; if (dbzs != null) { result.Zones = dbzs; } } } } })); } return(result); }