private void btnAddRecipe_Click(object sender, EventArgs e)
        {
            if (tbNewRecipe.Text == "")
            {
                AppUtility.ShowKryptonMessageBox("No Recipe Name", "Please input recipe name", "", ComponentFactory.Krypton.Toolkit.TaskDialogButtons.OK, MessageBoxIcon.Error, this);
                return;
            }

            if (_allRecipe.ChildExists(tbNewRecipe.Text))
            {
                AppUtility.ShowKryptonMessageBox("Recipe Name Exist", String.Format("Recipe name \"{0}\" already exist.", tbNewRecipe.Text), "", ComponentFactory.Krypton.Toolkit.TaskDialogButtons.OK, MessageBoxIcon.Error, this);
                return;
            }

            try
            {
                AppProductRecipe newRecipe = new AppProductRecipe(tbNewRecipe.Text);
                newRecipe.PropertyValChanged += new PropertyChangedEventHandler(AppMachine.Comp.AppMachine.This.RecipePropValue_OnChange);
                _allRecipe.Add(newRecipe);
                componentBrowser.Rebuild(_allRecipe);
                AppUtility.ShowKryptonMessageBox("Add New Product Completed", String.Format("Add New Product \"{0}\" Completed", tbNewRecipe.Text), "", ComponentFactory.Krypton.Toolkit.TaskDialogButtons.OK, MessageBoxIcon.Information, this);
                tbNewRecipe.Clear();
            }
            finally
            {
            }
        }
예제 #2
0
        private void btnAddUser_Click(object sender, EventArgs e)
        {
            if (tbNewUser.Text == "")
            {
                AppUtility.ShowKryptonMessageBox("No User Name", "Please input user name", "", ComponentFactory.Krypton.Toolkit.TaskDialogButtons.OK, MessageBoxIcon.Error, this);
                return;
            }

            if (_allUsers.ChildExists(tbNewUser.Text))
            {
                AppUtility.ShowKryptonMessageBox("Duplicate User Name", String.Format("User name \"{0}\" already exist.", tbNewUser.Text), "", ComponentFactory.Krypton.Toolkit.TaskDialogButtons.OK, MessageBoxIcon.Error, this);
                return;
            }

            try
            {
                DefaultLogger logger = U.GetComponent(AppConstStaticName.DEFAULT_LOGGER) as DefaultLogger;
                logger.Abort();
                AppUserInfo newUser = new AppUserInfo(tbNewUser.Text);
                newUser.Initialize();
                _allUsers.Add(newUser);
                newUser.InitializeIDReferences();
                logger.Abort();
                componentBrowser.Rebuild(_allUsers);
                AppUtility.ShowKryptonMessageBox("Add New User Completed", String.Format("Add New User \"{0}\" Completed", tbNewUser.Text), "", ComponentFactory.Krypton.Toolkit.TaskDialogButtons.OK, MessageBoxIcon.Information, this);
                tbNewUser.Clear();
            }
            finally
            {
            }
        }
예제 #3
0
        public void LoadStartupRecipe()
        {
            string startupCurrentRecipe = CurrentProdRecipeName;

            CurrentProdRecipeName = "";

            CompBase _allRecipe = U.GetComponent(AppConstStaticName.ALL_RECIPES) as CompBase;

            if (_allRecipe.ChildExists(startupCurrentRecipe))
            {
                CurrentProdRecipeName = startupCurrentRecipe;
            }
            else if (startupCurrentRecipe == "")
            {
                CurrentProdRecipeName = AppConstStaticName.SAMPLE_RECIPE;
            }
        }