protected void btnDelete_Click(object sender, EventArgs e) { var unitToDelete = new Unit { Id = UnitId }; _unitManager.Delete(unitToDelete); Response.Redirect("UnitManagementPanel.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { var unit = new Unit { Code = txtUnitCode.Text, DepartmentId = int.Parse(DDLDepartments.SelectedValue), Description = txtUnitDescription.Text, UniqueId = Guid.NewGuid(), Id = UnitId }; _unitManager.Save(unit); Response.Redirect("UnitManagementPanel.aspx"); }