Example #1
0
        internal bool Parse_configurationInfo_getZone(s2sMessage target, DLZoneCollectionDto collection)
        {
            ModuleProc PROC   = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getZone");
            bool       result = default(bool);

            try
            {
                configurationInfo ci = target.p_body.p_configuration.p_configurationInfo;
                if (collection != null)
                {
                    List <zone> Zones = new List <zone>();
                    foreach (var dto in collection)
                    {
                        Zones.Add(new zone()
                        {
                            zoneId     = dto.ZoneID.ToStringSafe(),
                            zoneName   = dto.ZoneName,
                            zoneActive = dto.IsActive
                        });
                    }
                    ci.zone = Zones.ToArray();
                    result  = true;
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
        internal bool Parse_configurationInfo_getZone(s2sMessage target, DLZoneCollectionDto collection)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getZone");
            bool result = default(bool);

            try
            {
                configurationInfo ci = target.p_body.p_configuration.p_configurationInfo;
                if (collection != null)
                {
                    List<zone> Zones = new List<zone>();
                    foreach (var dto in collection)
                    {
                        Zones.Add(new zone()
                        {
                            zoneId = dto.ZoneID.ToStringSafe(),
                            zoneName = dto.ZoneName,
                            zoneActive = dto.IsActive
                        });
                    }
                    ci.zone = Zones.ToArray();
                    result = true;
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return result;
        }
Example #3
0
        internal bool Parse_configurationInfo_getZone(s2sMessage target, object source)
        {
            ModuleProc PROC             = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getZone");
            bool       result           = default(bool);
            getConfigurationGetZone s2s = source as getConfigurationGetZone;

            try
            {
                DLZoneCollectionDto collection = _di.GetZones(target.p_body.p_configuration.propertyId, s2s.zoneId.s2sId());
                result = this.Parse_configurationInfo_getZone(target, collection);
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
Example #4
0
        public DLZoneCollectionDto GetZones(string siteCode, int zoneID)
        {
            ModuleProc          PROC   = new ModuleProc(this.DYN_MODULE_NAME, "GetZones");
            DLZoneCollectionDto result = new DLZoneCollectionDto();

            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("@ZoneID", DBNull.Value);
                    if (zoneID > 0)
                    {
                        parameters[1].Value = zoneID;
                    }
                    DataSet   ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetZoneDetails]", parameters);
                    DataTable dt = ds.GetDataTable(0);
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            DLZoneDto dto = new DLZoneDto();
                            dto.ZoneID   = dr.Field <int>("ZoneID");
                            dto.ZoneName = dr.Field <string>("ZoneName");
                            dto.IsActive = dr.Field <bool>("IsActive");
                            result.Add(dto);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
Example #5
0
        public DLZoneCollectionDto GetZones(string siteCode, int zoneID)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "GetZones");
            DLZoneCollectionDto result = new DLZoneCollectionDto();

            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("@ZoneID", DBNull.Value);
                    if (zoneID > 0) parameters[1].Value = zoneID;
                    DataSet ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetZoneDetails]", parameters);
                    DataTable dt = ds.GetDataTable(0);
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            DLZoneDto dto = new DLZoneDto();
                            dto.ZoneID = dr.Field<int>("ZoneID");
                            dto.ZoneName = dr.Field<string>("ZoneName");
                            dto.IsActive = dr.Field<bool>("IsActive");
                            result.Add(dto);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return result;
        }