예제 #1
0
        static void sendNotification(PersonDto pPerson,
                                     CustomerAcctPaymentDto pCustomerAcctPayment,
                                     CustomerAcctRow_Base pCustomerAcctRow,
                                     PartnerDto pPartner,
                                     ContactInfoDto pContactInfo)
        {
            try {
                var _subject = "Balance Adjustment, [Partner]> " + pPartner.Name + " [Acct]> " + pCustomerAcctRow.Name;
                var _body    = "Server Time>      " + pCustomerAcctPayment.DateTime.ToString("yyyy-MM-dd HH:mm:ss");
                _body += Environment.NewLine;
                _body += "Adjust Amount>    " + pCustomerAcctPayment.Amount.ToString("c");
                _body += Environment.NewLine;
                _body += "Previous Balance> " + pCustomerAcctPayment.PreviousAmount.ToString("c");
                _body += Environment.NewLine;
                _body += "Current Balance>  " + decimal.Add(pCustomerAcctPayment.PreviousAmount, pCustomerAcctPayment.Amount).ToString("c");
                _body += Environment.NewLine;
                _body += "Comments>  " + pCustomerAcctPayment.Comments;

                Email.SetForSending(Path.Combine(Configuration.Instance.Folders.EmailFolder, Guid.NewGuid().ToString("N")),
                                    Configuration.Instance.Email.ClientFrom,
                                    Configuration.Instance.Email.ClientTo,
                                    string.Empty,
                                    pContactInfo.Email,
                                    Configuration.Instance.Email.ClientEmailServer,
                                    Configuration.Instance.Email.ClientEmailPassword,
                                    _subject,
                                    _body);
                TimokLogger.Instance.LogRbr(LogSeverity.Status, "CustomerAcctController.sendNotification", string.Format("Adjusted by:      {0}\r\n{1} {2}", pPerson.Name, _subject, _body));
            }
            catch (Exception _ex) {
                TimokLogger.Instance.LogRbr(LogSeverity.Critical, "CustomerAcctController.sendNotification", string.Format("Exception sending notification\r\n{0}", _ex));
            }
        }
예제 #2
0
        internal static void Add(Rbr_Db pDb, ContactInfoDto pContactInfo)
        {
            ContactInfoRow _contactInfoRow = MapToContactInfoRow(pContactInfo);

            pDb.ContactInfoCollection.Insert(_contactInfoRow);
            pContactInfo.ContactInfoId = _contactInfoRow.Contact_info_id;
        }
        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));
        }
        public ContactInfoDto Delete(IObjectIdentifier <ulong> id)
        {
            var contactInfo = _repository.FindById(id);

            _repository.Delete(contactInfo.Id);
            return(ContactInfoDto.FromDomain(contactInfo));
        }
예제 #5
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));
        }
예제 #6
0
        private Guid AddOrUpdateCompanyContactInfo(ContactInfoDto contactInfoDto, Guid companyId)
        {
            if (contactInfoDto == null)
            {
                return(Guid.Empty);
            }
            var contactInf = _dbContext.ContactInfos.FirstOrDefault(x => x.CompanyId == companyId);

            if (contactInf == null)
            {
                contactInf = new ContactInfo
                {
                    Phone     = contactInfoDto.Phone,
                    Email     = contactInfoDto.Email,
                    CompanyId = companyId
                };
                _dbContext.ContactInfos.Add(contactInf);
            }
            else
            {
                contactInf.Phone = contactInfoDto.Phone;
                contactInf.Email = contactInfoDto.Email;
            }

            _dbContext.SaveChanges();
            return(contactInf.Id);
        }
예제 #7
0
 private EntitySupplierDto(
     IObjectIdentifier <ulong> id,
     BillingInfoDto billingInfo,
     ContactInfoDto contactInfo
     ) : base(id, billingInfo, contactInfo)
 {
 }
예제 #8
0
        public static ICollection <EmailDto> ToEmailDto(ContactInfoDto src)
        {
            var results = new List <EmailDto>();

            if (!string.IsNullOrWhiteSpace(src.Email))
            {
                results.Add(
                    new EmailDto()
                {
                    EmailType = EmailType.PRIMARY,
                    Value     = src.Email
                });
            }
            ;
            if (!string.IsNullOrWhiteSpace(src.AlternateEmail))
            {
                results.Add(
                    new EmailDto()
                {
                    EmailType = EmailType.ALTERNATE,
                    Value     = src.AlternateEmail
                });
            }
            ;
            return(results);
        }
예제 #9
0
        public void AddContactInfo(ContactInfoDto contactInfoDto)
        {
            ContactInfo contactInfo = ConvertToContact(contactInfoDto);

            uof.contactInfoRepository.AddContactInfo(contactInfo);
            uof.Complete();
        }
예제 #10
0
        public RecordDto PostRecordCounts(ContactInfoDto contactInfoDto)
        {
            RecordDto recordDto = new RecordDto();

            recordDto = _contactInfoDtoManager.GetRecordUserCount(contactInfoDto.Address);
            return(recordDto);
        }
예제 #11
0
        public ContactInfoDto GetContactPerson(UserOfContactInfoDto userOfContactInfoDto)
        {
            Guid           ID             = userOfContactInfoDto.ID;
            ContactInfoDto contactInfoDto = _contactInfoDtoManager.GetContactPerson(ID);

            return(contactInfoDto);
        }
 public static EntityReceiverDto FromDomain(EntityReceiver receiver)
 {
     return(new EntityReceiverDto(
                receiver.Id,
                BillingInfoDto.FromDomain(receiver.BillingInfo),
                ContactInfoDto.FromDomain(receiver.ContactInfo)
                ));
 }
예제 #13
0
 public static EntitySupplierDto FromDomain(EntitySupplier supplier)
 {
     return(new EntitySupplierDto(
                supplier.Id,
                BillingInfoDto.FromDomain(supplier.BillingInfo),
                ContactInfoDto.FromDomain(supplier.ContactInfo)
                ));
 }
예제 #14
0
        public ContactInfo ConvertToContact(ContactInfoDto contactInfoDto)
        {
            ContactInfo contactInfo = new ContactInfo();

            contactInfo.PhoneNumber = contactInfoDto.PhoneNumber;
            contactInfo.Email       = contactInfoDto.Email;
            contactInfo.Address     = contactInfoDto.Address;
            contactInfo.UserID      = contactInfoDto.UserID;
            return(contactInfo);
        }
예제 #15
0
 protected EntityDto(
     IObjectIdentifier <ulong> id,
     BillingInfoDto billingInfo,
     ContactInfoDto contactInfo
     )
 {
     _id          = id;
     _billingInfo = billingInfo;
     _contactInfo = contactInfo;
 }
예제 #16
0
 private static ContactInfo FromContactInfoDto(ContactInfoDto contactInfoDto)
 {
     return(new ContactInfo
     {
         ID = contactInfoDto.Id,
         Category = contactInfoDto.Category,
         Data = contactInfoDto.Data,
         InfoType = contactInfoDto.InfoType,
         IsPrimary = contactInfoDto.IsPrimary
     });
 }
예제 #17
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));
        }
예제 #18
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());
        }
예제 #20
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));
        }
예제 #21
0
        public void CreatePerson(UserOfContactInfoDto userOfContactInfoDto)
        {
            ContactInfoDto contactInfoDto = new ContactInfoDto();
            Guid           guid           = Guid.NewGuid();

            userOfContactInfoDto.ID = guid;
            _userDtoManager.AddPerson(userOfContactInfoDto);
            contactInfoDto.Address     = userOfContactInfoDto.Address;
            contactInfoDto.Email       = userOfContactInfoDto.Email;
            contactInfoDto.PhoneNumber = userOfContactInfoDto.PhoneNumber;
            contactInfoDto.UserID      = userOfContactInfoDto.ID;
            _contactInfoDtoManager.AddContactInfo(contactInfoDto);
        }
예제 #22
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);
 }
예제 #23
0
        public static void Credit(PersonDto pPerson, CustomerAcctPaymentDto pCustomerAcctPayment)
        {
            using (var _db = new Rbr_Db()) {
                using (var _tx = new Transaction(_db, pPerson, pCustomerAcctPayment)) {
                    pCustomerAcctPayment.DateTime = DateTime.Now;
                    //NOTE: make sure we got prev amnt
                    CustomerAcctRow _customerAcctRow = CustomerAcctManager.Get(_db, pCustomerAcctPayment.CustomerAcctId);
                    pCustomerAcctPayment.PreviousAmount = _customerAcctRow.Current_amount;
                    pCustomerAcctPayment.Person         = pPerson;
                    CustomerAcctManager.Credit(_db, pCustomerAcctPayment);
                    _tx.Commit();

                    PartnerDto     _partner     = PartnerManager.Get(_db, _customerAcctRow.Partner_id);
                    ContactInfoDto _contactInfo = ContactInfoManager.Get(_db, _partner.ContactInfo.ContactInfoId);
                    sendNotification(pPerson, pCustomerAcctPayment, _customerAcctRow, _partner, _contactInfo);
                }
            }
        }
예제 #24
0
        public OkResult AddContact([FromBody] ContactInfoDto contactInfoDto)
        {
            var contactInfoEntity = new ContactInfo
            {
                Email        = contactInfoDto.Email,
                Surname      = contactInfoDto.Surname,
                Name         = contactInfoDto.Name,
                Phone        = contactInfoDto.Phone,
                Answer       = contactInfoDto.Answer,
                CourseName   = contactInfoDto.CourseName,
                CourseNumber = contactInfoDto.CourseNumber,
                Degree       = contactInfoDto.Degree,
                Created      = DateTime.Now
            };

            _contactInfoRepository.InsertIfNotExists(contactInfoEntity);

            return(Ok());
        }
예제 #25
0
        static PersonDto mapToPerson(PersonRow pPersonRow, ContactInfoDto pContactInfo, CustomerSupportGroupDto pCustomerSupportGroup, VirtualSwitchDto pVirtualSwitch)
        {
            if (pPersonRow == null)
            {
                return(null);
            }
            var _person = new PersonDto();

            _person.PersonId           = pPersonRow.Person_id;
            _person.Name               = pPersonRow.Name;
            _person.Login              = pPersonRow.Login;
            _person.Password           = pPersonRow.Password;
            _person.AccessScope        = pPersonRow.AccessScope;
            _person.PermissionType     = pPersonRow.PermissionType;
            _person.RegistrationStatus = pPersonRow.RegistrationStatus;
            _person.Status             = pPersonRow.PersonStatus;
            _person.Salt               = pPersonRow.Salt;

            if (!pPersonRow.IsPartner_idNull)
            {
                _person.PartnerId = pPersonRow.Partner_id;
            }
            if (!pPersonRow.IsRetail_acct_idNull)
            {
                _person.RetailAcctId = pPersonRow.Retail_acct_id;
            }
            if (pCustomerSupportGroup != null)
            {
                _person.CustomerSupportGroup = pCustomerSupportGroup;
            }
            if (pVirtualSwitch != null)
            {
                _person.VirtualSwitch = pVirtualSwitch;
            }
            if (pContactInfo != null)
            {
                _person.ContactInfo = pContactInfo;
            }

            return(_person);
        }
예제 #26
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)));
        }
예제 #27
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)));
        }
예제 #28
0
        static internal ContactInfoDto MapToContactInfo(ContactInfoRow pContactInfoRow)
        {
            if (pContactInfoRow == null)
            {
                return(null);
            }
            ContactInfoDto _contactInfo = new ContactInfoDto();

            _contactInfo.ContactInfoId = pContactInfoRow.Contact_info_id;
            _contactInfo.Address1      = pContactInfoRow.Address1;
            _contactInfo.Address2      = pContactInfoRow.Address2;
            _contactInfo.City          = pContactInfoRow.City;
            _contactInfo.State         = pContactInfoRow.State;
            _contactInfo.Zip           = pContactInfoRow.Zip_code;
            _contactInfo.Email         = pContactInfoRow.Email;
            _contactInfo.HomePhone     = pContactInfoRow.Home_phone_number;
            _contactInfo.CellPhone     = pContactInfoRow.Cell_phone_number;
            _contactInfo.WorkPhone     = pContactInfoRow.Work_phone_number;

            return(_contactInfo);
        }
예제 #29
0
 public void DeleteContactInfo(ContactInfoDto contactInfoDto)
 {
     _contactInfoDtoManager.DeleteContactInfoById(contactInfoDto.ID);
 }
예제 #30
0
 public void CreateContactInfo(ContactInfoDto contactInfoDto)
 {
     _contactInfoDtoManager.AddContactInfo(contactInfoDto);
 }