private void Save() { try { var Type = _TypeRepo.GetById(id); if (id > 0 && Type != null) { Type.NAME = txtName.Value; Type.NOTE = txtNote.Value; _TypeRepo.Update(Type); } else { Type = new TYPE(); Type.NAME = txtName.Value; Type.NOTE = txtNote.Value; _TypeRepo.Create(Type); } } catch (Exception) { throw; } finally { Response.Redirect("loai-hang.aspx"); } }
public void UpdateType(OrganizationType type) { var unit_of_work = UnitOfWorkProvider.GetUnitOfWork(); unit_of_work.BeginTransaction(); TypeRepo.Update(type); unit_of_work.Commit(); _is_type_cache_valid = false; }