void CustomerEditorControl_ReflectFormToData(object sender, DataEditorReflectEventArgs e)
        {
            Customer customer = e.GetData <Customer>();

            customer.Code = codeTextBox.Text;
            customer.Name = nameTextBox.Text;
        }
        void WebsiteGeneralEditorControl_ReflectFormToData(object sender, DataEditorReflectEventArgs e)
        {
            Website website = e.GetData <Website>();

            website.CustomerID    = getSelectedCustomer().DataID;
            website.PrimaryHostID = getSelectedPrimaryHost().DataID;

            if (iisSiteEnableCheckBox.Checked)
            {
                if (iisStandardRadioButton.Checked)
                {
                    website.IisSite.Mode = WebsiteIisMode.Standard;
                }
                else if (iisRedirectRadioButton.Checked)
                {
                    website.IisSite.Mode        = WebsiteIisMode.Redirect;
                    website.IisSite.RedirectUrl = iisRedirectTextBox.Text;
                }
            }
            else
            {
                website.IisSite.Mode = WebsiteIisMode.Disabled;
            }

            website.IisSite.ManagedPipelineMode   = getSelectedIisManagedPipelineMode();
            website.IisSite.ManagedRuntimeVersion = iisManagedRuntimeVersionComboBox.Text;
        }
        void CustomerEditorControl_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
        {
            Customer customer = e.GetData <Customer>();

            codeTextBox.Text = customer.Code;
            nameTextBox.Text = customer.Name;

            if (e.Mode == DataEditorMode.Update)
            {
                codeTextBox.ReadOnly = true;
            }
        }
Beispiel #4
0
 void CustomerFtpUsersEditorControl_ReflectFormToData(object sender, DataEditorReflectEventArgs e)
 {
     if (enableCheckBox.Checked)
     {
         dataGridView.EndEdit();
         e.GetData <Customer>().FtpUserArray = resultList.ToArray();
         e.GetData <Customer>().FtpEnabled   = true;
     }
     else
     {
         e.GetData <Customer>().FtpEnabled = false;
     }
 }
Beispiel #5
0
        void CustomerFtpUsersEditorControl_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
        {
            resultList.Clear();
            if (e.GetData <Customer>().FtpUserArray != null)
            {
                resultList.AddRange(e.GetData <Customer>().FtpUserArray);
            }

            bindingList.Clear();
            if (e.GetData <Customer>().FtpEnabled)
            {
                enableCheckBox.Checked = true;
                resultList.ForEach(ftpUser => bindingList.Add(ftpUser));
            }
            bindingList.ResetBindings();
        }
Beispiel #6
0
        void WebsiteDnsZoneEditorControl_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
        {
            if (e.GetData <Website>().DnsZoneArray != null)
            {
                int selectedIndex = getSelectedIndex();

                resultList.Clear();
                bindingList.Clear();

                resultList.AddRange(e.GetData <Website>().DnsZoneArray);
                resultList.ForEach(ftpUser => bindingList.Add(ftpUser));
                bindingList.ResetBindings();

                selectGridViewRow(selectedIndex);
            }
        }
Beispiel #7
0
        void WebsiteHostNameEditorControl_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
        {
            lastKnownMode = e.Mode;

            if (e.GetData <Website>().HostArray != null)
            {
                int selectedIndex = getSelectedIndex();

                hostList.Clear();
                hostList.AddRange(e.GetData <Website>().HostArray);

                hostBindingList.Clear();
                hostList.ForEach(h => hostBindingList.Add(h));
                hostBindingList.ResetBindings();

                selectGridViewRow(selectedIndex);
            }
        }
        void WebsiteGeneralEditorControl_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
        {
            Website website = e.GetData <Website>();

            customerComboBox.DisplayMember = "CodeAndName";
            customerComboBox.DataSource    = ParentForm.CustomerList;

            switch (website.IisSite.Mode)
            {
            case WebsiteIisMode.Disabled:
                iisSiteEnableCheckBox.Checked = false;
                break;

            case WebsiteIisMode.Standard:
                iisSiteEnableCheckBox.Checked  = true;
                iisStandardRadioButton.Checked = true;
                break;

            case WebsiteIisMode.Redirect:
                iisSiteEnableCheckBox.Checked  = true;
                iisRedirectRadioButton.Checked = true;
                break;
            }

            // Always assign whether redirect enabled or not.
            iisRedirectTextBox.Text = website.IisSite.RedirectUrl;

            // Remember the original host so we can detect change later.
            OriginalPrimaryHostName = website.PrimaryHost.Name;

            if (e.Mode == DataEditorMode.Update)
            {
                customerComboBox.Enabled = false;
                setSelectedCustomer(website.CustomerID);

                // Update primary hosts then set primary host.
                UpdatePrimaryHostCombobox(website.HostArray);
                setSelectedPrimaryHost(website.PrimaryHostID);
            }

            iisManagedPipelineModeComboBox.SelectedValue = website.IisSite.ManagedPipelineMode;
            setIisManagedRuntimeVersion(website.IisSite.ManagedRuntimeVersion);
        }
Beispiel #9
0
        void WebsiteSecurityEditorControl_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
        {
            int selectedIndex = 0;

            if (dataGridView.SelectedRows.Count != 0)
            {
                selectedIndex = dataGridView.SelectedRows.Cast <DataGridViewRow>().First().Index;
            }

            if (e.GetData <Website>().SecurityArray != null)
            {
                ruleResultList.Clear();
                ruleBindingList.Clear();

                ruleResultList.AddRange(e.GetData <Website>().SecurityArray);
                ruleResultList.ForEach(s => ruleBindingList.Add(s));
                ruleBindingList.ResetBindings();

                selectGridViewRow(selectedIndex);
            }
        }
 void websiteHostNameEditorControl1_ReflectDataToForm(object sender, DataEditorReflectEventArgs e)
 {
     //updatePrimaryHostCombobox();
 }
Beispiel #11
0
 void WebsiteHostNameEditorControl_ReflectFormToData(object sender, DataEditorReflectEventArgs e)
 {
     lastKnownMode = e.Mode;
     dataGridView.EndEdit();
     e.GetData <Website>().HostArray = hostList.ToArray();
 }
Beispiel #12
0
 void WebsiteSecurityEditorControl_ReflectFormToData(object sender, DataEditorReflectEventArgs e)
 {
     e.GetData <Website>().SecurityArray = ruleResultList.ToArray();
 }
Beispiel #13
0
 void WebsiteDnsZoneEditorControl_ReflectFormToData(object sender, DataEditorReflectEventArgs e)
 {
     dataGridView.EndEdit();
     e.GetData <Website>().DnsZoneArray = resultList.ToArray();
 }