Пример #1
0
 public static void PopulateCustomer(Customer input, System.Data.IDataReader reader)
 {
     PopulateRecord(input, reader);
     input.RecordId = Utilities.ToInt(reader[Mimosa.Apartment.Common.Customer.ColumnNames.CustomerId]);
     input.OrganisationId = Utilities.ToInt(reader[Mimosa.Apartment.Common.Customer.ColumnNames.OrganisationId]);
     input.FirstName = Utilities.ToString(reader[Mimosa.Apartment.Common.Customer.ColumnNames.FirstName]);
     input.LastName = Utilities.ToString(reader[Mimosa.Apartment.Common.Customer.ColumnNames.LastName]);
     input.IsLegacy = Utilities.ToBool(reader[Mimosa.Apartment.Common.Customer.ColumnNames.IsLegacy]);
     input.Gender = Utilities.ToNInt(reader[Mimosa.Apartment.Common.Customer.ColumnNames.Gender]);
     input.Age = Utilities.ToNInt(reader[Mimosa.Apartment.Common.Customer.ColumnNames.Age]);
     input.ContactInformationId = Utilities.ToInt(reader[Mimosa.Apartment.Common.Customer.ColumnNames.ContactInformationId]);
     input.SiteName = Utilities.ToString(reader[Mimosa.Apartment.Common.Customer.ColumnNames.SiteName]);
     input.RoomName = Utilities.ToString(reader[Mimosa.Apartment.Common.Customer.ColumnNames.RoomName]);
 }
Пример #2
0
        public static Customer Customer(System.Data.IDataReader reader)
        {
            Customer result = null;

            if (null != reader && reader.Read())
            {
                result = new Customer();
                PopulateCustomer(result, reader);
            }

            return result;
        }
Пример #3
0
        void btnNewBooking_Click(object sender, RoutedEventArgs e)
        {
            if (this.CustomerItem != null)
            {
                if (this.CustomerItem.ContactInformation == null)
                {
                    this.CustomerItem.ContactInformation = new ContactInformation();
                    this.CustomerItem.ContactInformation.IsChanged = true;
                    this.CustomerItem.ContactInformation.ContactTypeId = (int)ContactType.Customer;
                }
                ucBookingNew.ucCustomerDetails.CustomerItem = this.CustomerItem;

                Customer customer2 = new Customer();
                customer2.IsChanged = true;
                customer2.OrganisationId = Globals.UserLogin.UserOrganisationId;
                customer2.ContactInformation = new ContactInformation();
                customer2.ContactInformation.IsChanged = true;
                customer2.ContactInformation.ContactTypeId = (int)ContactType.Customer;
                ucBookingNew.ucCustomerDetails2.CustomerItem = customer2;

                ucBookingNew.ucCustomerDetails.IsEnabled = ucBookingNew.ucCustomerDetails2.IsEnabled = false;
                ucBookingNew.ucCustomerDetails.ucCntactInfoPanel.IsEnabled = ucBookingNew.ucCustomerDetails2.ucCntactInfoPanel.IsEnabled = false;
            }
            else
            {
                Customer customer1 = new Customer();
                customer1.IsChanged = true;
                customer1.OrganisationId = Globals.UserLogin.UserOrganisationId;
                customer1.ContactInformation = new ContactInformation();
                customer1.ContactInformation.ContactTypeId = (int)ContactType.Customer;
                ucBookingNew.ucCustomerDetails.CustomerItem = customer1;
                Customer customer2 = new Customer();
                customer2.IsChanged = true;
                customer2.OrganisationId = Globals.UserLogin.UserOrganisationId;
                customer2.ContactInformation = new ContactInformation();
                customer2.ContactInformation.IsChanged = true;
                customer2.ContactInformation.ContactTypeId = (int)ContactType.Customer;
                ucBookingNew.ucCustomerDetails2.CustomerItem = customer2;

            }
            ucBookingNew.ucCustomerDetails.radMale.GroupName = ucBookingNew.ucCustomerDetails.radFemale.GroupName = "GenderGroup1";

            uiPopupNewBooking.ShowDialog();
        }
Пример #4
0
        private void CustomerButton_Click(object sender, RoutedEventArgs e)
        {
            HyperlinkButton button = sender as HyperlinkButton;
            bool isNewCustomer = false;
            if (button != null)
            {
                if (button.Tag == null)
                {
                    isNewCustomer = true;
                }
                else
                {
                    int customerId = Convert.ToInt32(button.Tag);
                    if (customerId > 0)
                    {
                        ucCustomerDetails.BoookingId = null;
                        DataServiceHelper.ListCustomerAsync(Globals.UserLogin.UserOrganisationId, customerId, null, null, null, false, null, null, true, ListCustomerCompleted);
                    }
                    else
                    {
                        isNewCustomer = true;
                    }
                }
            }

            if (isNewCustomer)
            {
                Booking booking = button.DataContext as Booking;
                if (booking != null)
                {
                    Customer newCustomer = new Customer();
                    newCustomer.IsChanged = true;
                    newCustomer.OrganisationId = Globals.UserLogin.UserOrganisationId;
                    newCustomer.ContactInformation = new ContactInformation();
                    newCustomer.ContactInformation.IsChanged = true;
                    newCustomer.ContactInformation.ContactTypeId = (int)ContactType.Customer;

                    ucCustomerDetails.BoookingId = booking.BookingId;
                    ucCustomerDetails.DataContext = newCustomer;
                    ucCustomerDetails.ucCntactInfoPanel.DataContext = newCustomer.ContactInformation;
                    ucCustomerDetails.ucCntactInfoPanel.btnSaveContact.Visibility = Visibility.Collapsed;
                    uiPopupCustomer.ShowDialog();
                }
            }
        }
Пример #5
0
        //void gvwCustomers_BeginningEdit(object sender, Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e)
        //{
        //    if (e.Cell.Column.UniqueName == "NumberOfRooms")
        //    {
        //        e.Cancel = true;
        //    }
        //}
        void gvwCustomers_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            Customer newItem = new Customer();
            newItem.RecordId = null;
            newItem.OrganisationId = Globals.UserLogin.UserOrganisationId;
            newItem.CreatedBy = Globals.UserLogin.UserName;
            newItem.DateCreated = Globals.Now;
            newItem.ContactInformation = new ContactInformation();
            newItem.ContactInformation.CountryId = _defaultCountryId;
            newItem.ContactInformation.ContactTypeId = (int)ContactType.Customer;
            newItem.IsChanged = newItem.ContactInformation.IsChanged = true;
            e.NewObject = newItem;

            gridDetails.Visibility = ucCntactInfoPanel.Visibility = System.Windows.Visibility.Collapsed;
        }