示例#1
0
 private void ComponentTypeDropDown_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (ComponentTypeDropDown.SelectedIndex == -1)
     {
         ComponentErrorProvider.SetError(ComponentTypeDropDown, Resources.ValidationMandatory);
         e.Cancel = true;
     }
     else
     {
         ComponentErrorProvider.SetError(ComponentTypeDropDown, "");
     }
 }
示例#2
0
 private void NameTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (NameTextBox.Text.IsNullOrWhiteSpace())
     {
         ComponentErrorProvider.SetError(NameTextBox, Resources.ValidationMandatory);
         e.Cancel = true;
     }
     else if (NameTextBox.Text.Length > 100)
     {
         ComponentErrorProvider.SetError(NameTextBox, Resources.ValidationLength.FormatWith(100));
         e.Cancel = true;
     }
     else
     {
         ComponentErrorProvider.SetError(NameTextBox, "");
     }
 }
示例#3
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            ComponentErrorProvider.Clear();

            if (componentID > 0)
            {
                ViewComponentDetailTab(componentID);
            }
            else
            {
                ViewComponentListingTab();

                componentID = -1;

                ComponentGrid.ClearSelection();
            }
        }
示例#4
0
        private void ComponentTabControl_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComponentErrorProvider.Clear();

            if (ComponentTabControl.SelectedTab == ListingTab)
            {
                RibbonMode = RibbonMode.Listing;
            }
            else if (ComponentTabControl.SelectedTab == DetailTab)
            {
                if (IsWork)
                {
                    RibbonMode = RibbonMode.Edit;
                }
                else
                {
                    RibbonMode = RibbonMode.Detail;
                }
            }
        }