internal bool Parse_configurationInfo_getManufacturer(s2sMessage target, DLManufacturerCollectionDto collection) { ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getManufacturer"); bool result = default(bool); try { configurationInfo ci = target.p_body.p_configuration.p_configurationInfo; if (collection != null) { List<manufacturer> manufacturers = new List<manufacturer>(); foreach (var dto in collection) { manufacturers.Add(new manufacturer() { manufacturerId = dto.ManufacturerId.ToString(), manufacturerName = dto.ManufacturerName, manufacturerValue = dto.ManufacturerValue, manufacturerActive = dto.IsActive, }); } ci.manufacturer = manufacturers.ToArray(); result = true; } } catch (Exception ex) { Log.Exception(PROC, ex); } return result; }
internal bool Parse_configurationInfo_getManufacturer(s2sMessage target, DLManufacturerCollectionDto collection) { ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getManufacturer"); bool result = default(bool); try { configurationInfo ci = target.p_body.p_configuration.p_configurationInfo; if (collection != null) { List <manufacturer> manufacturers = new List <manufacturer>(); foreach (var dto in collection) { manufacturers.Add(new manufacturer() { manufacturerId = dto.ManufacturerId.ToString(), manufacturerName = dto.ManufacturerName, manufacturerValue = dto.ManufacturerValue, manufacturerActive = dto.IsActive, }); } ci.manufacturer = manufacturers.ToArray(); result = true; } } catch (Exception ex) { Log.Exception(PROC, ex); } return(result); }
internal bool Parse_configurationInfo_getManufacturer(s2sMessage target, object source) { ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getManufacturer"); bool result = default(bool); getConfigurationGetManufacturer s2s = source as getConfigurationGetManufacturer; try { DLManufacturerCollectionDto collection = _di.GetManufacturers(target.p_body.p_configuration.propertyId, s2s.manufacturerId.s2sId()); result = this.Parse_configurationInfo_getManufacturer(target, collection); } catch (Exception ex) { Log.Exception(PROC, ex); } return(result); }
public DLManufacturerCollectionDto GetManufacturers(string siteCode, int manufacturerId) { ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "GetManufacturers"); DLManufacturerCollectionDto result = new DLManufacturerCollectionDto(); try { using (Database db = DbFactory.OpenDB(_connectionString)) { db.Open(); DbParameter[] parameters = db.CreateParameters(2); parameters[0] = db.CreateParameter("@SiteCode", DbType.AnsiString, 50, siteCode); parameters[1] = db.CreateParameter("@Manufacturer_Id", DBNull.Value); if (manufacturerId > 0) { parameters[1].Value = manufacturerId; } DataSet ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetManufacturerDetails]", parameters); DataTable dt = ds.GetDataTable(0); if (dt != null) { foreach (DataRow dr in dt.Rows) { DLManufacturerDto dto = new DLManufacturerDto(); dto.ManufacturerId = dr.Field <int>("ManufacturerId"); dto.ManufacturerName = dr.Field <string>("ManufacturerName"); dto.ManufacturerValue = dr.Field <string>("ManufacturerValue"); dto.IsActive = dr.Field <bool>("IsActive"); result.Add(dto); } } } } catch (Exception ex) { Log.Exception(PROC, ex); } return(result); }
public DLManufacturerCollectionDto GetManufacturers(string siteCode, int manufacturerId) { ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "GetManufacturers"); DLManufacturerCollectionDto result = new DLManufacturerCollectionDto(); try { using (Database db = DbFactory.OpenDB(_connectionString)) { db.Open(); DbParameter[] parameters = db.CreateParameters(2); parameters[0] = db.CreateParameter("@SiteCode", DbType.AnsiString, 50, siteCode); parameters[1] = db.CreateParameter("@Manufacturer_Id", DBNull.Value); if (manufacturerId > 0) parameters[1].Value = manufacturerId; DataSet ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetManufacturerDetails]", parameters); DataTable dt = ds.GetDataTable(0); if (dt != null) { foreach (DataRow dr in dt.Rows) { DLManufacturerDto dto = new DLManufacturerDto(); dto.ManufacturerId = dr.Field<int>("ManufacturerId"); dto.ManufacturerName = dr.Field<string>("ManufacturerName"); dto.ManufacturerValue = dr.Field<string>("ManufacturerValue"); dto.IsActive = dr.Field<bool>("IsActive"); result.Add(dto); } } } } catch (Exception ex) { Log.Exception(PROC, ex); } return result; }