internal static CustomerSupportVendorDto GetCustomerSupportVendor(Rbr_Db pDb, int pVendorId)
        {
            CustomerSupportVendorRow _customerSupportVendorRow = pDb.CustomerSupportVendorCollection.GetByPrimaryKey(pVendorId);
            ContactInfoDto           _contactInfo = ContactInfoManager.Get(pDb, _customerSupportVendorRow.Contact_info_id);

            return(mapToCustomerSupportVendor(_customerSupportVendorRow, _contactInfo));
        }
Beispiel #2
0
        internal static PersonDto GetByLogin(Rbr_Db pDb, string pLogin)
        {
            PersonRow _personRow = pDb.PersonCollection.GetByLogin(pLogin);

            if (_personRow == null)
            {
                return(null);
            }

            ContactInfoDto          _contactInfo          = null;
            CustomerSupportGroupDto _customerSupportGroup = null;
            VirtualSwitchDto        _virtualSwitch        = null;

            if (!_personRow.IsContact_info_idNull)
            {
                _contactInfo = ContactInfoManager.Get(pDb, _personRow.Contact_info_id);
            }
            if (!_personRow.IsGroup_idNull)
            {
                _customerSupportGroup = CustomerSupportManager.GetCustomerSupportGroup(pDb, _personRow.Group_id);
            }
            if (!_personRow.IsVirtual_switch_idNull)
            {
                _virtualSwitch = VirtualSwitchManager.Get(pDb, _personRow.Virtual_switch_id);
            }
            return(mapToPerson(_personRow, _contactInfo, _customerSupportGroup, _virtualSwitch));
        }
Beispiel #3
0
        static VirtualSwitchDto getInfo(Rbr_Db pDb, VirtualSwitchRow pVirtualSwitchRow)
        {
            if (pVirtualSwitchRow == null)
            {
                return(null);
            }

            ContactInfoDto _contactInfo = ContactInfoManager.Get(pDb, pVirtualSwitchRow.Contact_info_id);

            return(MapToVirtualSwitch(pVirtualSwitchRow, _contactInfo));
        }
Beispiel #4
0
        internal static PersonDto[] GetActiveResellAgents(Rbr_Db pDb, int pPartnerId)
        {
            var _list = new List <PersonDto>();

            PersonRow[] _personRows = pDb.PersonCollection.GetActiveResellAgents(pPartnerId);
            foreach (PersonRow _personRow in _personRows)
            {
                ContactInfoDto _contactInfo = ContactInfoManager.Get(pDb, _personRow.Contact_info_id);
                _list.Add(mapToPerson(_personRow, _contactInfo, null, null));
            }
            return(_list.ToArray());
        }
        internal static CustomerSupportVendorDto[] GetAllCustomerSupportVendors(Rbr_Db pDb)
        {
            List <CustomerSupportVendorDto> _list = new List <CustomerSupportVendorDto>();

            CustomerSupportVendorRow[] _customerSupportVendorRows = pDb.CustomerSupportVendorCollection.GetAll();
            foreach (CustomerSupportVendorRow _customerSupportVendorRow in _customerSupportVendorRows)
            {
                ContactInfoDto _contactInfo = ContactInfoManager.Get(pDb, _customerSupportVendorRow.Contact_info_id);
                _list.Add(mapToCustomerSupportVendor(_customerSupportVendorRow, _contactInfo));
            }
            return(_list.ToArray());
        }
Beispiel #6
0
        static PartnerDto getInfo(Rbr_Db pDb, PartnerRow pPartnerRow)
        {
            if (pPartnerRow == null)
            {
                return(null);
            }

            ScheduleDto    _billingSchedule = ScheduleManager.Get(pDb, pPartnerRow.Billing_schedule_id);
            ContactInfoDto _contactInfo     = ContactInfoManager.Get(pDb, pPartnerRow.Contact_info_id);

            PersonDto[] _employees = PersonManager.GetByPartnerId(pDb, pPartnerRow.Partner_id);
            return(MapToPartner(pPartnerRow, _billingSchedule, _contactInfo, _employees));
        }
Beispiel #7
0
 internal static PersonDto GetByRetailAcctId(Rbr_Db pDb, int pRetailAcctId)
 {
     PersonRow[] _personRows = pDb.PersonCollection.GetByRetail_acct_id(pRetailAcctId);
     if (_personRows != null && _personRows.Length > 0)
     {
         PersonRow      _personRow   = _personRows[0];
         ContactInfoDto _contactInfo = null;
         if (!_personRow.IsContact_info_idNull)
         {
             _contactInfo = ContactInfoManager.Get(pDb, _personRow.Contact_info_id);
         }
         return(mapToPerson(_personRows[0], _contactInfo, null, null));
     }
     return(null);
 }
Beispiel #8
0
        internal static PersonDto[] GetByVirtualSwitchId(Rbr_Db pDb, int pVirtualSwitchId)
        {
            var _list = new ArrayList();
            VirtualSwitchDto _virtualSwitch = VirtualSwitchManager.Get(pDb, pVirtualSwitchId);

            PersonRow[] _personRows = pDb.PersonCollection.GetByVirtual_switch_id(pVirtualSwitchId);
            foreach (PersonRow _personRow in _personRows)
            {
                ContactInfoDto _contactInfo = null;
                if (!_personRow.IsContact_info_idNull)
                {
                    _contactInfo = ContactInfoManager.Get(pDb, _personRow.Contact_info_id);
                }
                _list.Add(mapToPerson(_personRow, _contactInfo, null, _virtualSwitch));
            }
            if (_list.Count > 1)
            {
                _list.Sort(new GenericComparer(PersonDto.Name_PropName, ListSortDirection.Ascending));
            }
            return((PersonDto[])_list.ToArray(typeof(PersonDto)));
        }
Beispiel #9
0
        internal static PersonDto[] GetByGroupId(Rbr_Db pDb, int pGroupId)
        {
            var _list = new ArrayList();
            CustomerSupportGroupDto _customerSupportGroup = CustomerSupportManager.GetCustomerSupportGroup(pDb, pGroupId);

            PersonRow[] _personRows = pDb.PersonCollection.GetByGroup_id(pGroupId);
            foreach (PersonRow _personRow in _personRows)
            {
                ContactInfoDto _contactInfo = null;
                if (!_personRow.IsContact_info_idNull)
                {
                    _contactInfo = ContactInfoManager.Get(pDb, _personRow.Contact_info_id);
                }
                _list.Add(mapToPerson(_personRow, _contactInfo, _customerSupportGroup, null));
            }
            if (_list.Count > 1)
            {
                _list.Sort(new GenericComparer(PersonDto.Name_PropName, ListSortDirection.Ascending));
            }
            return((PersonDto[])_list.ToArray(typeof(PersonDto)));
        }