public ServiceResponse <HeadstoneUserRole> Update(HeadstoneUserRole model) { using (var bo = new UserRoleDAO()) { int result = bo.Update(model as HeadstoneUserRole); if (result > 0) { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Success, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { model } }); } else { return(new ServiceResponse <HeadstoneUserRole>() { Type = ServiceResponseTypes.Error, Source = ServiceResponseSources.MsSQL, Result = new List <HeadstoneUserRole>() { model } }); } } }
public void Save(Connection connection, MySqlTransaction transaction = null) { using (var dao = new UserRoleDAO(connection)) { if (Id == 0) { dao.Insert(this, transaction); } else { dao.Update(this, transaction); } } }
public override bool Update(object dto) { return(dao.Update(dto)); }