private void OnSelectedRecipeInfoEvent(RecipeInfo recipeInfo)
 {
     this.SelectedRecipeInfo = recipeInfo;
     if (SelectedRecipeInfoEvent != null)
     {
         SelectedRecipeInfoEvent(recipeInfo);
     }
 }
Exemple #2
0
        public EditorRecipeForm(RecipeInfo srcRecipeInfo, RecipeInfo destRecipeInfo)
        {
            InitializeComponent();

            _srcRecipeInfo           = srcRecipeInfo;
            _destRecipeInfo          = destRecipeInfo;
            this.txtRecipeNo.Text    = srcRecipeInfo.RecipeNo.ToString();
            this.txtRecipeID.Text    = srcRecipeInfo.RecipeID;
            this.txtDescription.Text = srcRecipeInfo.Description;
        }
Exemple #3
0
        public CopyRecipeForm(RecipeInfo srcRecipeInfo, RecipeInfo destRecipeInfo)
        {
            InitializeComponent();

            _recipeInfo = destRecipeInfo;
            this.txtOldRecipeNo.Text    = srcRecipeInfo.RecipeNo.ToString();
            this.txtOldRecipeID.Text    = srcRecipeInfo.RecipeID;
            this.txtOldDescription.Text = srcRecipeInfo.Description;
            this.txtNewRecipeNo.Text    = destRecipeInfo.RecipeNo.ToString();
            this.txtNewRecipeID.Text    = srcRecipeInfo.RecipeID + "(Copy)";
            this.txtNewDescription.Text = srcRecipeInfo.Description + "(Copy)";
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection selectedRowCollection = this.dataGridView.SelectedRows;

            foreach (DataGridViewRow selectedRow in selectedRowCollection)
            {
                if (selectedRow.Cells[0].Value != null)
                {
                    RecipeInfo recipeInfo = selectedRow.DataBoundItem as RecipeInfo;
                    this.SelectedRecipeInfoCollection.Add(recipeInfo);
                }
            }
        }
Exemple #5
0
        public RecipeInfo Find(int recipeNo)
        {
            RecipeInfo recipeInfo = null;

            foreach (RecipeInfo item in base.InnerList)
            {
                if (item.RecipeNo == recipeNo)
                {
                    recipeInfo = item;
                    break;
                }
            }
            return(recipeInfo);
        }
Exemple #6
0
        public RecipeInfo Find(string recipeID)
        {
            RecipeInfo recipeInfo = null;

            foreach (RecipeInfo item in base.InnerList)
            {
                if (item.RecipeID == recipeID)
                {
                    recipeInfo = item;
                    break;
                }
            }
            return(recipeInfo);
        }
        private void btnRecipeCopy_Click(object sender, EventArgs e)
        {
            if (this.SelectedRecipeInfo.RecipeNo == 0 || this.SelectedRecipeInfo.RecipeID == "RecipeID")
            {
                MessageBox.Show(ResourceHelper.Language.GetString("SelectRecipeMsg"));
                return;
            }

            RecipeInfo recipeInfo = new RecipeInfo();

            recipeInfo.RecipeNo = RecipeNoGenerator();

            CopyRecipeForm copyRecipeForm = new CopyRecipeForm(this.SelectedRecipeInfo, recipeInfo);

            if (copyRecipeForm.ShowDialog() == DialogResult.OK)
            {
                if (RecipeInfoManager.GetInstance().CopyRecipeInfo(this.SelectedRecipeInfo, recipeInfo))
                {
                    //RefreshRecipeInfoCollection();
                }
            }
        }
        private void btnRecipeEdit_Click(object sender, EventArgs e)
        {
            if (this.SelectedRecipeInfo.RecipeNo == 0 || this.SelectedRecipeInfo.RecipeID == "RecipeID")
            {
                MessageBox.Show(ResourceHelper.Language.GetString("SelectRecipeMsg"));
                return;
            }

            RecipeInfo recipeInfo = new RecipeInfo();

            EditorRecipeForm editorRecipeForm = new EditorRecipeForm(this.SelectedRecipeInfo, recipeInfo);

            editorRecipeForm.Text = ((Button)sender).Text == "Create" ? "Recipe Create" : "Recipe Edit";

            if (editorRecipeForm.ShowDialog() == DialogResult.OK)
            {
                if (RecipeInfoManager.GetInstance().EditRecipeInfo(this.SelectedRecipeInfo, recipeInfo))
                {
                    //RefreshRecipeInfoCollection();
                }
            }
        }
        private void btnRecipeDelete_Click(object sender, EventArgs e)
        {
            if (this.SelectedRecipeInfo.RecipeNo == 0 || this.SelectedRecipeInfo.RecipeID == "RecipeID")
            {
                MessageBox.Show(ResourceHelper.Language.GetString("SelectRecipeMsg"));
                return;
            }
            RecipeInfo activeRecipe = RecipeInfoManager.GetInstance().ActiveRecipe;

            if (this.SelectedRecipeInfo.RecipeNo == activeRecipe.RecipeNo || this.SelectedRecipeInfo.RecipeID == activeRecipe.RecipeID)
            {
                MessageBox.Show(ResourceHelper.Language.GetString("DeleteRecipeMsg"));
                return;
            }
            if (RecipeInfoManager.GetInstance().DeleteRecipeInfo(this.SelectedRecipeInfo))
            {
                if (DeleteRecipeInfoEvent != null)
                {
                    DeleteRecipeInfoEvent();
                }
                //RefreshRecipeInfoCollection();
            }
        }
        private void RecipeEditorControl_Load(object sender, EventArgs e)
        {
            if (ProcessInfo.IsDesignMode())
            {
                return;
            }
            _recipeInfoCollection   = new RecipeInfoCollection();
            this.SelectedRecipeInfo = new RecipeInfo();

            RecipeInfoManager.GetInstance().RecipeInfoSelectedIndexChanged += new RecipeInfoManager.RecipeInfoSelectedIndexChangedEventHandler(RecipeEditorControl_RecipeInfoSelectedIndexChangedEvent);
            RecipeInfoManager.GetInstance().RecipeInfoCollectionChanged    += new RecipeInfoManager.RecipeInfoCollectionChangedEventHandler(RecipeEditorControl_RecipeInfoCollectionChangedEvent);
            RecipeInfoManager.GetInstance().RecipeInfoCopyChanged          += new RecipeInfoManager.RecipeInfoCopyChangedEventHandler(RecipeEditorControl_RecipeInfoCopyChangedEvent);
            RefreshRecipeInfoCollection();

            RecipeInfo actRecipeInfo = RecipeInfoManager.GetInstance().ActiveRecipe;

            if (actRecipeInfo != null)
            {
                RefreshRecipeStatus(actRecipeInfo.RecipeNo.ToString("D3"), actRecipeInfo.RecipeID);
            }

            LanguageManager.Apply(this);
        }
        private void btnRecipeChange_Click(object sender, EventArgs e)
        {
            //v1.0.2.31 避免短時間內重複切換Recipe
            if (this.ChangeRecipeTimeInterval > 0 && (DateTime.Now - _lastRecipeChangeTime).TotalSeconds < this.ChangeRecipeTimeInterval)
            {
                MessageBox.Show(ResourceHelper.Language.GetString("ChagneRecipeRepeatMsg"));
                return;
            }
            _lastRecipeChangeTime = DateTime.Now;
            if (this.cboCurrentRecipeChange.SelectedItem == null)
            {
                MessageBox.Show(ResourceHelper.Language.GetString("SelectRecipeMsg"));
                return;
            }
            RecipeInfo recipeInfo = (RecipeInfo)this.cboCurrentRecipeChange.SelectedItem;

            if (MessageBox.Show(string.Format("{0} {1:000} {2}", ResourceHelper.Language.GetString("ChangeRecipeMsg1"), recipeInfo, ResourceHelper.Language.GetString("ChangeRecipeMsg2")), "",
                                MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (RecipeInfoManager.GetInstance().SetRecipeNo(recipeInfo.RecipeNo))
                {
                }
            }
        }
Exemple #12
0
 public bool Contains(RecipeInfo value)
 {
     return(base.InnerList.Contains(value));
 }
Exemple #13
0
 public int IndexOf(RecipeInfo value)
 {
     return(base.InnerList.IndexOf(value));
 }
Exemple #14
0
 public void Remove(RecipeInfo value)
 {
     base.InnerList.Remove(value);
 }
Exemple #15
0
 public void Insert(int index, RecipeInfo value)
 {
     base.InnerList.Insert(index, value);
 }
Exemple #16
0
 public int Add(RecipeInfo value)
 {
     return(base.InnerList.Add(value));
 }
Exemple #17
0
 private void RecipeEditorForm_RecipeInfoSelectedIndexChangedEvent(RecipeInfo recipeInfo)
 {
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
 private void RecipeEditorControl_RecipeInfoCopyChangedEvent(RecipeInfo oldRecipeInfo, RecipeInfo newRecipeInfo)
 {
 }
 private void RecipeEditorControl_RecipeInfoSelectedIndexChangedEvent(RecipeInfo recipeInfo)
 {
     RefreshRecipeStatus(recipeInfo.RecipeNo.ToString("D3"), recipeInfo.RecipeID);
 }