Exemplo n.º 1
0
        public Business(BusinessViewModel NewBusiness)
        {
            this.Name           = NewBusiness.Name;
            this.CategoryId     = NewBusiness.CategoryId;
            this.CategoryTypeId = NewBusiness.CategoryTypeId;
            this.Address        = NewBusiness.Address;
            this.City           = NewBusiness.City;
            this.State          = NewBusiness.State;
            this.ZipCode        = NewBusiness.ZipCode;

            string _phone = NewBusiness.Phone;

            _phone = _phone.Replace("(", "");
            _phone = _phone.Replace(")", "");
            _phone = _phone.Replace("-", "");
            _phone = _phone.Replace(" ", "");
            if (_phone[0] == '1')
            {
                _phone = _phone.Substring(1);
            }
            _phone                = "(" + _phone.Substring(0, 3) + ") " + _phone.Substring(3, 3) + "-" + _phone.Substring(6);
            this.Phone            = _phone;
            this.Website          = NewBusiness.Website;
            this.CreatedAt        = DateTime.Now;
            this.UpdatedAt        = DateTime.Now;
            this.Reviews          = new List <Review>();
            this.BusinessProperty = new BusProperties();
            this.BusinessHours    = new BusHours();
        }
Exemplo n.º 2
0
 // Default Constructor without parameters
 public Business()
 {
     this.CreatedAt   = DateTime.Now;
     this.UpdatedAt   = DateTime.Now;
     Reviews          = new List <Review>();
     BusinessProperty = new BusProperties();
     BusinessHours    = new BusHours();
 }