Example #1
0
        private void Save_Button_Click(object sender, EventArgs e)
        {
            if (this.ItemGroup != null)
            {
                if (this.Name_Box.Text == string.Empty || this.Name_Box.Text.Length < 3)
                {
                    MessageBox.Show("Lütfen en az 3 karakterden oluşan bir ürün grubu adı giriniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    using (MuhasebeEntities m_Context = new MuhasebeEntities())
                    {
                        ItemGroup m_Actual = m_Context.ItemGroups.Where(q => q.ID == this.ItemGroup.ID).FirstOrDefault();
                        m_Actual.Name = this.Name_Box.Text;
                        m_Context.SaveChanges();

                        InvokeItemGroupEdited(m_Actual);
                    }

                    this.Close();
                }
            }
        }
 private void Pop_ItemGroupEdited(ItemGroup group)
 {
     this.PopulateListView();
 }