예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                CategoryBL    categoryBL     = new CategoryBL();
                BindingSource categoryListBS = (BindingSource)dgvCategory.DataSource;
                var           categoryList   = (List <Category>)categoryListBS.DataSource;

                if (categoryList.Count > 0)
                {
                    foreach (Category category in categoryList)
                    {
                        if (category.IsChanged)
                        {
                            categoryBL.Save(category);
                        }
                    }
                    PoupulateCategoryGrid();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (FormValidate() == true)
     {
         CategoryBL objcate = new CategoryBL()
         {
             CategoryName = txtCategory.Text
         };
         objcate.Save();
         MessageBox.Show("Saved Successfull");
         LoadData();
         ClearGroup();
         btnAddnew.Enabled = true;
     }
     else
     {
         MessageBox.Show("Some Error Occur");
     }
 }
 public Boolean ManageSave(CategoryVO category)
 {
     return(_categoryBL.Save(category));
 }