예제 #1
0
        /// <summary>
        /// Create a stub CS_PhoneNumber from a PhoneNumberVO, for saving
        /// </summary>
        /// <param name="additionalPhoneNumbersList">List of PhoneNumberVO</param>
        /// <returns>List of CS_PhoneNumber</returns>
        private List<CS_PhoneNumber> GetListFromPhoneVO(List<PhoneNumberVO> additionalPhoneNumbersList)
        {
            List<CS_PhoneNumber> returnList = new List<CS_PhoneNumber>();

            for (int i = 0; i < additionalPhoneNumbersList.Count; i++)
            {
                PhoneNumberVO vo = additionalPhoneNumbersList[i];

                CS_PhoneNumber item = new CS_PhoneNumber()
                {
                    ID = vo.ID,
                    Number = vo.Number,
                    PhoneTypeID = vo.TypeID
                };

                returnList.Add(item);
            }

            return returnList;
        }
        public void LoadContactInformation()
        {
            if (_view.ContactId.HasValue)
            {
                CS_Contact selectedContact = _customerModel.GetContactById(_view.ContactId.Value);
                IList<CS_Request> resquests = selectedContact.CS_Request.Where(e => e.Status == (int)Globals.CustomerMaintenance.RequestStatus.Pending && e.Active).ToList();

                _view.ContactId = selectedContact.ID;

                _view.ContactName = selectedContact.Name;
                _view.ContactLastName = selectedContact.LastName;
                _view.ContactAlias = selectedContact.Alias;
                _view.ContactNumber = selectedContact.ContactNumber;
                _view.ContactAttn = selectedContact.Attn;
                _view.ContactAddress = selectedContact.Address1;
                _view.ContactAddress2 = selectedContact.Address2;
                _view.ContactState = selectedContact.State;
                _view.ContactCity = selectedContact.City;
                _view.ContactCountry = selectedContact.Country;
                _view.ContactZipcode = selectedContact.Zip;
                _view.ContactHomePhoneCodeArea = selectedContact.HomePhoneCodeArea;
                _view.ContactHomePhone = selectedContact.ContactEditingPhoneNumber;
                _view.ContactFaxPhoneCodeArea = selectedContact.FaxCodeArea;
                _view.ContactFaxPhone = selectedContact.ContactEditingFaxNumber;
                _view.ContactEmail = selectedContact.Email;
                _view.ContactWebpage = selectedContact.Webpage;
                _view.ContactIMAddress = selectedContact.IMAddress;
                _view.ContactType = selectedContact.DynamicsContact;

                IList<CS_PhoneNumber> lstPhoneNumber = _customerModel.GetAdditionalPhonesByContact(_view.ContactId.Value);
                if (!string.IsNullOrEmpty(selectedContact.ContactEditingPhoneNumber))
                {
                    CS_PhoneNumber pn = new CS_PhoneNumber();
                    pn.CS_PhoneType = new CS_PhoneType();
                    pn.Number = selectedContact.ContactEditingPhoneNumber;
                    pn.CS_PhoneType.Name = "Work";
                    lstPhoneNumber.Add(pn);
                }

                if (!string.IsNullOrEmpty(selectedContact.ContactEditingFaxNumber))
                {
                    CS_PhoneNumber pn = new CS_PhoneNumber();
                    pn.CS_PhoneType = new CS_PhoneType();
                    pn.Number = selectedContact.ContactEditingFaxNumber;
                    pn.CS_PhoneType.Name = "Fax";
                    lstPhoneNumber.Add(pn);
                }

                _view.AdditionalContactPhoneGridDataSource = lstPhoneNumber;

                _view.ContactType = selectedContact.DynamicsContact;
                _view.ContactRequestWarning = resquests.Count > 0;
                LoadContactBillinfInfo(selectedContact);
                _view.CallCriteriaContactID = _view.ContactId;

                _view.EditingCustomer = false;
                _view.EditingContact = true;
            }
            else
                _view.CallCriteriaContactID = null;
        }
 public EmployeePhoneVO(CS_PhoneNumber phone)
 {
     EmployeeName = phone.CS_Employee_Phone.FullName;
     PhoneType = phone.CS_PhoneType.Name;
     PhoneNumber = phone.Number;
 }