public ErrorData Delete(Context context, SiteSettings ss, bool notice = false) { var statements = new List <SqlStatement>(); var where = Rds.DeptsWhere().DeptId(DeptId); statements.AddRange(new List <SqlStatement> { Rds.DeleteDepts( factory: context, where : where), StatusUtilities.UpdateStatus( tenantId: context.TenantId, type: StatusUtilities.Types.DeptsUpdated), }); Repository.ExecuteNonQuery( context: context, transactional: true, statements: statements.ToArray()); var deptHash = SiteInfo.TenantCaches.Get(context.TenantId)?.DeptHash; if (deptHash.Keys.Contains(DeptId)) { deptHash.Remove(DeptId); } return(new ErrorData(type: Error.Types.None)); }
public Error.Types Delete(SiteSettings ss, bool notice = false) { Rds.ExecuteNonQuery( transactional: true, statements: new SqlStatement[] { Rds.DeleteDepts( where : Rds.DeptsWhere().DeptId(DeptId)), StatusUtilities.UpdateStatus(StatusUtilities.Types.DeptsUpdated) }); var deptHash = SiteInfo.TenantCaches[Sessions.TenantId()].DeptHash; if (deptHash.Keys.Contains(DeptId)) { deptHash.Remove(DeptId); } return(Error.Types.None); }
public Error.Types Delete(SiteSettings ss, bool notice = false) { var statements = new List <SqlStatement>(); var where = Rds.DeptsWhere().DeptId(DeptId); statements.AddRange(new List <SqlStatement> { Rds.DeleteDepts(where : where), StatusUtilities.UpdateStatus(StatusUtilities.Types.DeptsUpdated), }); var response = Rds.ExecuteScalar_response( transactional: true, statements: statements.ToArray()); var deptHash = SiteInfo.TenantCaches[Sessions.TenantId()].DeptHash; if (deptHash.Keys.Contains(DeptId)) { deptHash.Remove(DeptId); } return(Error.Types.None); }