Esempio n. 1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     var categoryToDelete = new Category
     {
         Id = CategoryId
     };
     _categoryManager.Delete(categoryToDelete);
     Response.Redirect("~/CategoryManagementPanel");
 }
Esempio n. 2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     var categoryCode = Category.Code;
     if (Mode ==Transaction.TransactionMode.NewEntry)
     {
         categoryCode = Transaction.
             TransactionType.CAT + "-" +_categoryManager.ReferenceNumber+1;
     }
     var newCategory = new Category
     {
         Code = categoryCode,
         DepartmentId = int.Parse(DDLDepartments.SelectedValue),
         Description = txtCategoryName.Text,
         UniqueId = Guid.NewGuid(),
         Id = CategoryId
     };
     _categoryManager.Save(newCategory);
     Response.Redirect("~/CategoryManagementPanel");
 }